/* amirdav.id — Duotone Index. Source of truth: дизайн-спецификация.md */

/* self-hosted fonts (latin, latin-ext, cyrillic subsets; Geist is variable, one file serves 400 and 500) */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/geist-cyrillic-dd9286.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/geist-latin-ext-e2aaf8.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/geist-latin-e09adc.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/geist-cyrillic-dd9286.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/geist-latin-ext-e2aaf8.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/geist-latin-e09adc.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/geist-mono-cyrillic-216093.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/geist-mono-latin-ext-24db3a.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/geist-mono-latin-c8d271.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Spectral'; font-style: italic; font-weight: 300; font-display: swap; src: url('fonts/spectral-italic-cyrillic-3e8b36.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Spectral'; font-style: italic; font-weight: 300; font-display: swap; src: url('fonts/spectral-italic-latin-ext-742637.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Spectral'; font-style: italic; font-weight: 300; font-display: swap; src: url('fonts/spectral-italic-latin-45ba1e.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F7F7F5;
  --fg: #111111;
  --muted: #6B6B66;
  --line: #E3E3DF;
  --dim: #CFCFCA;
  --chip: #ECECE8;
  --ok: #2FBF71;
  --halo: transparent;

  --f-sans: 'Geist', 'Segoe UI', system-ui, sans-serif;
  --f-serif: 'Spectral', Georgia, serif;
  --f-mono: 'Geist Mono', ui-monospace, Consolas, monospace;

  --ease: cubic-bezier(.32, .72, 0, 1);
  --pad: 72px;
  --sec: 128px;
  --nav-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B0B0C;
  --fg: #EDEDED;
  --muted: #8A8A90;
  --line: #1F1F22;
  --dim: #3A3A3E;
  --chip: #18181B;
  --ok: #3DDC84;
  --halo: rgba(255, 255, 255, .04);
  color-scheme: dark;
}
/* no-JS fallback follows the system */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0B0B0C; --fg: #EDEDED; --muted: #8A8A90; --line: #1F1F22; --dim: #3A3A3E; --chip: #18181B; --ok: #3DDC84; --halo: rgba(255, 255, 255, .04);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.5 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .7s var(--ease), color .7s var(--ease);
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1440px; margin-inline: auto; padding-inline: var(--pad); }
.mono { font-family: var(--f-mono); font-size: 12px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
em { font-family: var(--f-serif); font-style: italic; font-weight: 300; letter-spacing: -.02em; }
.mt { color: var(--muted); }

.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 99px; transition: top .3s var(--ease); }
.skip:focus { top: 12px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background-color .7s var(--ease);
}
.nav-in { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 500; }
.nav-r { display: flex; align-items: center; gap: 28px; color: var(--muted); }
.nav-a { transition: color .3s var(--ease); }
.nav-a:hover { color: var(--fg); }

.lang { position: relative; }
.lang-btn { display: inline-flex; gap: 6px; align-items: center; background: none; border: 0; padding: 10px 2px; cursor: pointer; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.lang-btn:hover { color: var(--fg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px; padding: 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .25);
}
.lang-menu button { width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 12px; cursor: pointer; color: var(--fg); }
.lang-menu button:hover, .lang-menu button[aria-current="true"] { background: var(--chip); }

.sw { position: relative; width: 54px; height: 28px; flex: none; border-radius: 99px; background: var(--chip); border: 1px solid var(--line); padding: 0; cursor: pointer; transition: background-color .7s var(--ease); }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--fg); transition: transform .6s var(--ease), background-color .7s var(--ease); }
.sw[aria-checked="true"]::after { transform: translateX(26px); }
/* larger hit area without changing the look */
.sw::before { content: ""; position: absolute; inset: -8px; }

/* ---------- cta / links ---------- */
.cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 22px; border-radius: 99px;
  background: var(--fg); color: var(--bg); font-weight: 500; white-space: nowrap;
  transition: transform .5s var(--ease), background-color .7s var(--ease), color .7s var(--ease);
}
.cta i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: var(--bg); color: var(--fg); transition: transform .5s var(--ease), background-color .7s var(--ease), color .7s var(--ease); }
.cta:hover i { transform: translate(3px, -2px) scale(1.06); }
.cta:active { transform: scale(.98); }
.lnk { border-bottom: 1px solid currentColor; padding-bottom: 2px; transition: border-color .3s var(--ease); }
.lnk:hover { border-bottom-color: transparent; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }

/* ---------- hero ---------- */
.hero {
  /* photo column has its own width; height follows from the 3:4 image, so it never squashes */
  --fig-w: clamp(280px, 31vw, 440px);
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--fig-w); column-gap: 48px; padding-top: 96px;
}
.hero-copy { align-self: center; max-width: 720px; padding-bottom: 64px; }
.hero-title { font-size: clamp(1.625rem, 1rem + 1.9vw, 2.5rem); font-weight: 400; line-height: 1.15; letter-spacing: -.035em; text-wrap: balance; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; margin-top: 40px; color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 10px; }
/* suit photo: stands on the top line of "Работы" */
/* stands on the top line of «Работы»: bottom-aligned, flush with the right content edge */
.hero-fig-wrap { grid-column: 2; align-self: end; display: flex; justify-content: flex-end; margin-bottom: -1px; position: relative; z-index: 1; }
.hero-fig { width: 100%; height: auto; aspect-ratio: 900 / 1200; }
.hero::after { content: ""; position: absolute; right: calc(var(--pad) - var(--fig-w) * .15); bottom: 0; width: calc(var(--fig-w) * 1.3); aspect-ratio: 1; background: radial-gradient(closest-side, var(--halo), transparent); pointer-events: none; }

/* ---------- section label ---------- */
.lab { display: flex; justify-content: space-between; align-items: baseline; padding: 20px 0 8px; }
.h5 { margin-bottom: 24px; }
.h6 { font-size: 11px; letter-spacing: .06em; margin-bottom: 12px; }

/* ---------- work index ---------- */
.work, .ct, .ft { position: relative; }
.work::before, .ct::before, .ft::before { content: ""; position: absolute; top: 0; left: var(--pad); right: var(--pad); height: 1px; background: var(--line); }
.rows { border-bottom: 1px solid var(--line); }
.row + .row { border-top: 1px solid var(--line); }
.row h3 { font: inherit; }
.row-hd {
  --cols: 72px minmax(0, 1fr) 260px 170px 80px 40px;
  display: grid; grid-template-columns: var(--cols); align-items: baseline;
  width: 100%; padding: 22px 0; background: none; border: 0; text-align: left; cursor: pointer;
  transition: padding .6s var(--ease), color .5s var(--ease);
}
.c-name { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.row-hd .t { font-size: clamp(1.875rem, 1rem + 3.4vw, 3.625rem); font-weight: 500; line-height: 1; letter-spacing: -.055em; overflow-wrap: anywhere; }
.row-hd .d { font-size: 15px; line-height: 1.4; color: var(--muted); transition: color .5s var(--ease); }
.row-hd .c-y { text-align: right; }
.pl { justify-self: end; font-size: 26px; line-height: 1; color: var(--muted); transition: transform .6s var(--ease); }
.row.open .pl { transform: rotate(45deg); }
/* hover: the others fade, the row under the cursor gets richer (tinted band, full-contrast meta).
   :not(:hover) keeps the fade off the hovered row itself. */
.row { transition: background-color .5s var(--ease); border-radius: 12px; }
@media (hover: hover) {
  .rows:hover .row:not(:hover):not(.open) .row-hd,
  .rows:hover .row:not(:hover):not(.open) .row-hd .mono,
  .rows:hover .row:not(:hover):not(.open) .row-hd .d,
  .rows:hover .row:not(:hover):not(.open) .pl { color: var(--dim); }
  .row:not(.open):hover { background: var(--chip); }
  .row:not(.open):hover .row-hd { padding-left: 20px; padding-right: 16px; }
  .row:hover .row-hd .mono, .row:hover .row-hd .d, .row:hover .pl { color: var(--fg); }
}

.case { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .7s var(--ease); }
.row.open .case { grid-template-rows: 1fr; }
.case-clip { overflow: hidden; min-height: 0; }
/* photo starts exactly under the project name; the gutter is its own column */
.case-in { display: grid; grid-template-columns: 72px minmax(0, 1fr) 48px minmax(0, 1.25fr); padding: 8px 0 40px; }
.case-in > .kv { grid-column: 4; }
.case-img { grid-column: 2; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; background: var(--chip); }
.case-in.no-img .kv { grid-column: 2 / -1; max-width: 760px; }
.kv > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv > div:first-child { border-top: 0; padding-top: 0; }
.kv dt { padding-top: 3px; }
.kv .res dd { font-size: 20px; font-weight: 500; line-height: 1.3; letter-spacing: -.02em; }
.kv .links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.did { display: flex; flex-direction: column; gap: 8px; }
.did li { position: relative; padding-left: 18px; }
.did li::before { content: "—"; position: absolute; left: 0; color: var(--muted); }

/* «Об этом сайте»: a quiet note under the cases, aligned with the project names */
.about { display: grid; grid-template-columns: 72px minmax(0, 1fr); padding: 28px 0 0; }
.about h3 { grid-column: 1 / -1; margin-bottom: 10px; }
.about p { grid-column: 2; max-width: 46em; color: var(--muted); font-size: 15px; }

.pv {
  position: absolute; left: 0; top: 0; width: 300px; z-index: 2; pointer-events: none;
  opacity: 0; transform: translate3d(var(--px, 0), var(--py, 0), 0) translate(-50%, -50%) rotate(-2deg) scale(.92);
  transition: opacity .4s var(--ease), transform .7s var(--ease);
}
.pv.on { opacity: 1; transform: translate3d(var(--px, 0), var(--py, 0), 0) translate(-50%, -50%) rotate(-2deg) scale(1); }
.pv img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .45); }

/* ---------- path + stack ---------- */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; padding-top: var(--sec); }
.path li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); align-items: baseline; }
.path li:last-child { border-bottom: 1px solid var(--line); }
.path b { font-weight: 500; }
.path .now .dot { margin-left: 10px; vertical-align: 1px; }
.sg { display: flex; flex-direction: column; gap: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--chip); border-radius: 99px; padding: 7px 14px; font-size: 15px; transition: background-color .7s var(--ease); }

/* ---------- approach ---------- */
.ap { padding-top: var(--sec); }
.ap-g { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.ap-g li { border-top: 1px solid var(--fg); padding-top: 16px; }
.ap-g b { display: block; font-size: clamp(1.125rem, 1rem + .4vw, 1.375rem); font-weight: 500; letter-spacing: -.03em; margin: 28px 0 8px; }
.ap-g p { color: var(--muted); font-size: 15px; }

/* ---------- contact ---------- */
.ct { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; margin-top: var(--sec); padding-top: 80px; padding-bottom: 72px; position: relative; }
.ct-title { font-size: clamp(3.5rem, 2rem + 5.2vw, 6rem); font-weight: 500; line-height: .9; letter-spacing: -.065em; }
.ct-title em { letter-spacing: -.04em; }
.ct-text { color: var(--muted); max-width: 32em; margin-top: 24px; }
.ct-side { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; color: var(--muted); }
.ct-side .cta { margin-bottom: 6px; }

/* ---------- footer ---------- */
.ft { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 24px 32px; position: relative; }
.ft-l { display: flex; gap: 4px; }
.ft-l button { background: none; border: 0; padding: 8px 6px; cursor: pointer; font: inherit; letter-spacing: inherit; color: var(--muted); }
.ft-l button:hover, .ft-l button[aria-current="true"] { color: var(--fg); }

/* ---------- entrance ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); filter: blur(4px); } }
.hero .rv { animation: rise .9s var(--ease) backwards; }
.hero .rv + .rv { animation-delay: .08s; }
@keyframes fade { from { opacity: 0; } }
/* fade only: a slide would lift the photo off its line while it plays */
.hero-fig { animation: fade 1.1s .12s var(--ease) backwards; }
.js .reveal { opacity: 0; transform: translateY(16px); filter: blur(4px); transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- tablet ---------- */
@media (max-width: 1023px) {
  :root { --pad: 40px; --sec: 104px; }
  .hero { --fig-w: clamp(240px, 34vw, 320px); column-gap: 32px; padding-top: 72px; }
  .row-hd { --cols: 56px minmax(0, 1fr) 200px 64px 36px; }
  .row-hd .c-role { display: none; }
  .case-in { grid-template-columns: 56px minmax(0, 1fr) 32px minmax(0, 1.2fr); }
  .about { grid-template-columns: 56px minmax(0, 1fr); }
  .two { gap: 48px; }
  .ap-g { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
}

/* ---------- narrow hero: photo above the statement, standing on its own hairline ---------- */
@media (max-width: 767px) {
  .hero { --fig-w: min(72%, 300px); grid-template-columns: 1fr; padding-top: 24px; }
  .hero-fig-wrap { grid-column: 1; grid-row: 1; margin: 0 0 32px; border-bottom: 1px solid var(--line); }
  .hero-fig { width: var(--fig-w); margin-bottom: -1px; }
  .hero-copy { max-width: none; padding-bottom: 56px; }
  .hero::after { top: 0; bottom: auto; right: calc(var(--pad) - var(--fig-w) * .15); }
}

/* ---------- mobile ---------- */
@media (max-width: 599px) {
  :root { --pad: 20px; --sec: 72px; --nav-h: 56px; }
  .nav-a { display: none; }
  .nav-r { gap: 18px; }
  .hero-meta { margin-top: 28px; gap: 14px 24px; }
  .row-hd { --cols: minmax(0, 1fr) auto 32px; gap: 12px; padding: 18px 0; }
  .row-hd .c-n, .row-hd .c-st, .row-hd .c-role { display: none; }
  .case-in { grid-template-columns: 1fr; gap: 20px; padding: 0 0 28px; }
  .case-in > .kv { grid-column: 1; }
  .about { grid-template-columns: 1fr; }
  .about p { grid-column: 1; }
  .case-img, .case-in.no-img .kv { grid-column: 1; }
  .kv > div { grid-template-columns: 1fr; gap: 4px; }
  .kv .res dd { font-size: 18px; }
  .two { grid-template-columns: 1fr; gap: var(--sec); }
  .path li { grid-template-columns: 80px minmax(0, 1fr); }
  .ap-g { gap: 32px 20px; }
  .ct { flex-direction: column; align-items: flex-start; padding-top: 56px; padding-bottom: 56px; }
  .ct-side { align-items: flex-start; }
  .ft { flex-direction: column; align-items: flex-start; }
  .lab .mono:last-child { display: none; }
  .pv { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; filter: none; }
  .pv { display: none; }
}
