/* ════════════════════════════════════════════════════════════════
   inshe — main.css (revision 3)
   Tokens, typography, grid, components for both pages.
   Motion lives in motion.css.
   ════════════════════════════════════════════════════════════════ */

/* ─── Tokens — typographic & rhythmic system (per ТЗ § 2, § 3) ──
   Six discrete levels, three breakpoints. No fluid clamps in the
   scale — designer intent is preserved exactly. Spacing tokens
   below follow the 8px grid baseline.
   ─────────────────────────────────────────────────────────────── */
:root {
  /* ── Colours ─────────────────────────────────────────────── */
  --carbon:    #0A0908;
  --bone:      #F2EFEA;
  --ash:       #8B8985;
  --ash-faint: rgba(10, 9, 8, 0.12);
  --ash-mid:   rgba(10, 9, 8, 0.22);

  --cyan:    #00AEEF;
  --magenta: #EC008C;
  --yellow:  #FFF200;

  /* ── Motion ──────────────────────────────────────────────── */
  --d: 0px;
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);

  /* ── Container ───────────────────────────────────────────── */
  --max:      1440px;
  --gutter:   80px;
  --pad-x:    max(var(--gutter), calc(50vw - (var(--max) / 2)));

  /* ── Type scale (desktop defaults) ───────────────────────── */
  --t-h1:        88px;
  --t-h2:        56px;
  --t-h3:        32px;
  --t-body:      17px;
  --t-secondary: 15px;
  --t-caption:   12px;

  /* The wordmark is a brand glyph, not a typographic H1.
     Kept as a fluid display size so it scales with viewport. */
  --t-wordmark:  clamp(72px, 13vw, 200px);

  --t-lead:      clamp(20px, 2.4vw, 34px);
  --t-email:     32px;

  /* Line heights, letter-spacing, weights */
  --lh-h1:        1.05;
  --lh-h2:        1.1;
  --lh-h3:        1.15;
  --lh-body:      1.55;
  --lh-presence:  1.4;

  --ls-h1:        -0.02em;
  --ls-h2:        -0.015em;
  --ls-h3:        -0.01em;
  --ls-body:      0;
  --ls-mono:      0.08em;

  --w-light:      300;
  --w-regular:    400;
  --w-medium:     500;

  /* ── Vertical rhythm (8px grid) ──────────────────────────── */
  --gap-section:        160px;  /* between sections */
  --gap-head-content:   80px;   /* H2 → block content */
  --gap-h3-body:        24px;   /* H3 → its description */
  --gap-within-module:  16px;   /* between caption / body in module */
  --gap-cards:          48px;   /* between horizontal cards */
  --gap-label-top:      40px;   /* section top → section label */
  --gap-label-h2:       80px;   /* section label → H2 */
}

/* ── Tablet overrides (≤ 980px) ─────────────────────────────── */
@media (max-width: 980px) {
  :root {
    --gutter:           40px;

    --t-h1:             56px;
    --t-h2:             40px;
    --t-h3:             24px;
    --t-body:           16px;
    --t-secondary:      14px;
    --t-caption:        11px;
    --t-email:          28px;

    --gap-section:      120px;
    --gap-head-content: 64px;
    --gap-cards:        32px;
    --gap-label-h2:     64px;
  }
}

/* ── Mobile overrides (≤ 760px) ─────────────────────────────── */
@media (max-width: 760px) {
  :root {
    --gutter:           24px;

    --t-h1:             40px;
    --t-h2:             32px;
    --t-h3:             22px;
    --t-body:           15px;
    --t-secondary:      14px;
    --t-caption:        11px;
    --t-email:          24px;

    --gap-section:      80px;
    --gap-head-content: 48px;
    --gap-h3-body:      16px;
    --gap-cards:        48px;
    --gap-label-h2:     48px;
  }
}

/* ── A11y · screen-reader-only text ─────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Geist (self-hosted) ────────────────────────────────────── */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/Geist-Light.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Geist-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Geist-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/GeistMono-Regular.woff2') format('woff2');
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

::selection { background: var(--carbon); color: var(--bone); }

html { scroll-behavior: smooth; text-size-adjust: 100%; }

body {
  background: var(--bone);
  color: var(--carbon);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               'Helvetica Neue', Arial, sans-serif;
  font-weight: 300;
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.mono {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-feature-settings: "tnum";
}

img, svg { display: block; max-width: 100%; height: auto; }

/* ─── Meta rails ─────────────────────────────────────────────── */
.meta {
  font-size: var(--t-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
  font-weight: 400;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meta .dot {
  width: 5px; height: 5px;
  background: var(--carbon);
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.7em;
  transform: translateY(-1px);
  box-shadow: -1px 0 0 var(--cyan), 1px 0 0 var(--magenta);
}

/* ─── Top navigation — simple sticky bar with gutter padding ───
   .top-nav owns the padding (single source).
   Legacy .top-nav-inner wrapper (if present in old HTML) is dissolved
   via display:contents so it can't add a second layer of padding. */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.4vh var(--gutter) 2vh;
  background: var(--bone);
  font-size: var(--t-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.top-nav.is-scrolled { border-bottom-color: var(--ash-faint); }

/* Neutralize legacy wrapper so it never doubles the gutter */
.top-nav .top-nav-inner {
  display: contents;
}

.brand-mark {
  color: var(--ash);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  font-weight: 400;
}

.nav-items { display: flex; align-items: center; gap: 2.2em; }

.nav-link {
  color: var(--carbon);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link.is-current,
.nav-link[aria-current="page"] {
  color: var(--ash);
  cursor: default;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-left: 0.6em;
  padding-left: 1.4em;
  border-left: 1px solid var(--ash-faint);
  color: var(--ash);
}

.lang-switch button {
  background: none;
  border: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--ash);
  cursor: pointer;
  padding: 0;
  font-weight: 500;
  transition: color 0.25s ease;
}

.lang-switch button.is-active,
.lang-switch button.active {
  color: var(--carbon);
  cursor: default;
}

.lang-switch .lang-sep { color: var(--ash-mid); font-weight: 300; }

/* ════════════════════════════════════════════════════════════════
   HOME PAGE — hero, works, contact
   ════════════════════════════════════════════════════════════════ */

/* ─── Hero (vantage) ─────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - 7vh);
  padding: 2vh var(--gutter) 4vh;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 2vh;
}

.hero .anchor { align-self: end; padding-bottom: 6vh; }

/* Wordmark — brand glyph (intentionally bigger than typographic H1).
   Per ТЗ §5 note 2: "inshe" as H1 is a rare case where H1 is a brand
   mark, not a statement. Kept on its own fluid scale. */
.wordmark {
  font-size: var(--t-wordmark);
  font-weight: var(--w-light);
  letter-spacing: -0.05em;
  line-height: 0.85;
  margin-bottom: clamp(40px, 6vw, 88px);
}

/* Lede on home — per ТЗ § 6.1 — body-level paragraph supporting the wordmark.
   Was a big display statement; now a quiet paragraph with the same first line. */
.hero-statement {
  font-size: var(--t-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--carbon);
  max-width: 56ch;
}

.hero-foot {
  border-top: 1px solid var(--ash-faint);
  padding-top: 2vh;
}

/* ─── Works list (traces) ────────────────────────────────────── */
.works {
  padding: var(--gap-label-top) var(--gutter) calc(var(--gap-section) - var(--gap-label-top));
}

.works-head { margin-bottom: var(--gap-label-h2); }

.works-list { border-top: 1px solid var(--ash-faint); }

.work {
  border-bottom: 1px solid var(--ash-faint);
  display: grid;
  grid-template-rows: auto 0fr;
  transition: grid-template-rows 0.55s var(--ease-out);
}

.work:hover, .work.is-open { grid-template-rows: auto 1fr; }

.work-row {
  display: grid;
  grid-template-columns: 5ch 1fr 26ch 3ch;
  align-items: center;
  padding: 1.7em 0;
  gap: 3vw;
  cursor: default;
}

.work-year {
  font-size: 11px;
  color: var(--ash);
  letter-spacing: 0.12em;
  font-feature-settings: "tnum";
  font-weight: 500;
  align-self: center;
}

.work-name {
  font-size: var(--t-h3);
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-h3);
  line-height: var(--lh-h3);
  color: var(--carbon);
}

.work-tags {
  font-size: var(--t-caption);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
  text-align: right;
  align-self: center;
  font-weight: 500;
}

.work-marker {
  /* Fixed-size flex box so the rotation pivot is exact —
     no baseline/inline-block quirks during the +/× swap. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 1;
  color: var(--ash);
  font-weight: 300;
  align-self: center;
  justify-self: end;
  transform-origin: 50% 50%;
  transition: transform 0.5s var(--ease-out), color 0.4s ease;
  will-change: transform;
}

.work:hover .work-marker, .work.is-open .work-marker {
  transform: rotate(45deg);
  color: var(--carbon);
}

.work-detail { overflow: hidden; }

.work-detail-inner {
  padding: 0 0 2.4em calc(5ch + 3vw);
  max-width: 70ch;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.45s ease 0.08s, transform 0.45s ease 0.08s;
}

.work:hover .work-detail-inner, .work.is-open .work-detail-inner {
  opacity: 1;
  transform: translateY(0);
}

.work-detail p {
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--carbon);
  font-weight: 300;
  max-width: 56ch;
}

.work-detail small {
  display: inline-block;
  margin-top: 1.4em;
  font-size: var(--t-caption);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
  font-weight: 500;
  border-top: 1px solid var(--ash-faint);
  padding-top: 0.9em;
}

/* Work title that links to a full case page — inherits the H3
   look, no underline, refraction on hover via .disp. */
.work-name .work-link {
  color: inherit;
  text-decoration: none;
}

/* "open case →" inside the expanded detail. Tiny, monospace-rail
   eyebrow style so it sits beside the small/meta line without
   shouting. Pulled to the right so the row reads:
   description · meta · open case → */
.work-open {
  display: inline-block;
  margin-top: 1.4em;
  margin-left: 1.6em;
  font-size: var(--t-caption);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--carbon);
  font-weight: 500;
  text-decoration: none;
  border-top: 1px solid var(--ash-faint);
  padding-top: 0.9em;
  transition: color 0.2s ease;
}

.work-open:hover { --d: 1.6px; }

@media (max-width: 760px) {
  .work-open { margin-left: 0; display: block; }
}

/* ─── Contact (consequence) ──────────────────────────────────── */
.contact {
  padding: var(--gap-label-top) var(--gutter) calc(var(--gap-section) - var(--gap-label-top));
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 6vw;
  align-items: end;
}

.contact-statement {
  font-size: var(--t-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  color: var(--carbon);
  max-width: 36ch;
}

.contact-statement small {
  display: block;
  margin-top: 1.4em;
  font-size: var(--t-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
}

.contact-link {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 12px 8px;
  flex-wrap: wrap;
}

.contact-email {
  font-size: var(--t-email);
  font-weight: var(--w-light);
  color: var(--carbon);
  text-decoration: none;
  letter-spacing: var(--ls-h2);
  transition: color 0.25s ease;
}

.contact-email:hover { --d: 1.8px; }

/* ════════════════════════════════════════════════════════════════
   ABOUT (we are) — six scenes
   ════════════════════════════════════════════════════════════════ */

/* Section rhythm — per ТЗ § 3:
   Top: --gap-label-top (40 / 32 / 24)  · sets label distance from top
   Bottom: gap-section minus top, makes the inter-section gap = 160/120/80
   Full-width with gutter padding — aligned with the top-nav. */
.scene {
  padding: var(--gap-label-top) var(--gutter) calc(var(--gap-section) - var(--gap-label-top));
}

.scene-meta {
  margin-bottom: var(--gap-label-h2);
  padding-bottom: 1.5vh;
  border-bottom: 1px solid var(--ash-faint);
}

.scene-title {
  font-size: var(--t-h2);
  font-weight: var(--w-light);
  letter-spacing: var(--ls-h2);
  line-height: var(--lh-h2);
  margin-bottom: var(--gap-head-content);
  max-width: 22ch;
  color: var(--carbon);
}

.scene-context {
  font-size: var(--t-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  color: var(--ash);
  max-width: 50ch;
  margin-top: 5vh;
}

/* ─── Scene 1 · Definition (mirrors hero) ────────────────────── */
.scene-definition {
  min-height: calc(100vh - 7vh);
  padding: 4vh var(--gutter) 4vh;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 2vh;
}

.scene-definition .anchor { align-self: end; padding-bottom: 6vh; }

.definition-statement {
  font-size: var(--t-h1);
  font-weight: var(--w-light);
  letter-spacing: var(--ls-h1);
  line-height: var(--lh-h1);
  margin-bottom: 0.9em;
  max-width: 14ch;
}

/* Lede under H1 on About — per ТЗ § 6.2 — body paragraph, Carbon (not Ash).
   Reads as a statement, not as a subtitle. */
.definition-context {
  font-size: var(--t-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  color: var(--carbon);
  max-width: 64ch;
}

.scene-definition .scene-foot {
  border-top: 1px solid var(--ash-faint);
  padding-top: 2vh;
}

/* ─── Scene 2 · Method (horizontal filter sequence) ──────────
   Three modules in one row, read left → right. Each module:
   name → thin line under the name → short attribute below.
   Block sits airy (extra top/bottom padding) — per ТЗ Block 03,
   it should breathe in contrast to the dense services grid below.
   No outer frame: the only horizontal line is under each name,
   matching the ТЗ schema.
   ───────────────────────────────────────────────────────────── */
/* Scene padding & title margins driven by global rhythm tokens.
   Per ТЗ § 7 — dynamic height accordion (matches works behaviour).
   Four filters: Data / Intuition / Aesthetics / Silence — each cuts
   one category of weight a brand accumulates. */
.filters-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--gap-cards);
  align-items: start;          /* critical: cards don't stretch to row height */
}

.filter {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 0fr;   /* name · short · collapsed detail */
  transition: grid-template-rows 350ms ease-out;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.filter:hover,
.filter.is-open { grid-template-rows: auto auto 1fr; }

.filter-name {
  font-size: var(--t-h3);
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-h3);
  line-height: var(--lh-h3);
  margin: 0 0 var(--gap-h3-body);
  padding: 0 2em var(--gap-h3-body) 0;
  border-bottom: 1px solid var(--ash-faint);
  color: var(--carbon);
}

.filter-short {
  margin: 0;
  font-size: var(--t-secondary);
  font-weight: var(--w-regular);
  color: var(--ash);
  letter-spacing: 0.015em;
}

.filter-marker {
  position: absolute;
  top: 0.35em;
  right: 0;
  font-size: 14px;
  font-weight: 300;
  color: var(--ash);
  line-height: 1;
  transition: transform 0.3s ease, color 0.3s ease;
}

.filter:hover .filter-marker,
.filter.is-open .filter-marker {
  transform: rotate(45deg);
  color: var(--carbon);
}

.filter-detail { overflow: hidden; }

.filter-detail-inner {
  padding-top: 2.2em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 250ms ease-out 100ms, transform 350ms ease-out 100ms;
}

.filter:hover .filter-detail-inner,
.filter.is-open .filter-detail-inner {
  opacity: 1;
  transform: translateY(0);
}

.filter-detail p {
  margin: 0;
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--carbon);
  max-width: 30ch;
}

/* ─── Scene 3 · Services (4-column grid) ─────────────────────── */
/* H2 returned per ТЗ § 4 — "Чотири практики" / "Four practices".
   Spacing driven by global rhythm tokens. */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5vh var(--gap-cards);
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.service-card:hover { --d: 1.1px; }

.service-num {
  font-size: 11px;
  color: var(--ash);
  letter-spacing: 0.12em;
  font-feature-settings: "tnum";
  font-weight: 500;
}

.service-name {
  font-size: var(--t-h3);
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-h3);
  line-height: var(--lh-h3);
  margin-bottom: var(--gap-h3-body);
  color: var(--carbon);
}

.service-desc {
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--carbon);
  font-weight: var(--w-regular);
}

/* ─── Scene 4 · Phases (4-column rail with output tag) ───────── */
.phases-rail { display: block; }

.phase {
  display: grid;
  grid-template-columns: 5ch minmax(180px, 22ch) 1fr 14ch;
  align-items: start;
  padding: 1.6em 0;
  gap: 3vw;
  border-bottom: 1px solid var(--ash-faint);
}

.phase:hover { --d: 1.2px; }

.phase-num {
  font-size: 11px;
  color: var(--ash);
  letter-spacing: 0.12em;
  font-feature-settings: "tnum";
  font-weight: 500;
  padding-top: 0.4em;
}

.phase-name {
  font-size: var(--t-h3);
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-h3);
  line-height: var(--lh-h3);
}

.phase-desc {
  font-size: var(--t-body);
  color: var(--ash);
  line-height: var(--lh-body);
  max-width: 70ch;
}

.phase-output {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
  text-align: right;
  font-weight: 500;
  padding-top: 0.4em;
}

/* ─── Scene 5 · Presence (closing + email) ───────────────────── */
.scene-presence {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-cards);
  align-items: end;
}

.scene-presence .scene-meta { grid-column: 1 / -1; }
.presence-content { grid-column: 1; }

.presence-statement {
  font-size: var(--t-h2);
  font-weight: var(--w-light);
  letter-spacing: var(--ls-h2);
  line-height: var(--lh-h2);
  margin-bottom: 48px;
  max-width: 22ch;
}

/* Presence description — closing paragraph under H2.
   Body type, ~640px wide. */
.presence-description {
  font-size: var(--t-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  color: var(--carbon);
  max-width: 64ch;
  margin: 0;
}

.presence-contact {
  grid-column: 2;
  align-self: end;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 12px 8px;
  flex-wrap: wrap;
}

.presence-email {
  font-size: var(--t-email);
  font-weight: var(--w-light);
  color: var(--carbon);
  text-decoration: none;
  letter-spacing: var(--ls-h2);
  transition: color 0.25s ease;
}

.presence-email:hover { --d: 1.8px; }

/* ─── Footer ─────────────────────────────────────────────────── */
/* ════════════════════════════════════════════════════════════════
   CASE PAGES — dark theme override + verois page components
   The .theme-dark hook swaps surface/text and re-tints rules.
   Components below (.case-*) only live on case pages.
   ════════════════════════════════════════════════════════════════ */

body.theme-dark {
  background: var(--carbon);
  color: var(--bone);
}

body.theme-dark .top-nav,
body.theme-dark footer {
  background: var(--carbon);
}

body.theme-dark .top-nav.is-scrolled {
  border-bottom-color: rgba(242, 239, 234, 0.10);
}

body.theme-dark .nav-link {
  color: var(--bone);
}

body.theme-dark .nav-link.is-current,
body.theme-dark .nav-link[aria-current="page"] {
  color: rgba(242, 239, 234, 0.55);
}

body.theme-dark .brand-mark,
body.theme-dark .lang-switch,
body.theme-dark .lang-switch button,
body.theme-dark .footer-grid,
body.theme-dark .footer-grid .social a {
  color: rgba(242, 239, 234, 0.55);
}

body.theme-dark .lang-switch {
  border-left-color: rgba(242, 239, 234, 0.12);
}

body.theme-dark .lang-switch button.is-active {
  color: var(--bone);
}

body.theme-dark .lang-switch .lang-sep {
  color: rgba(242, 239, 234, 0.22);
}

body.theme-dark .footer-grid .social a:hover {
  color: var(--bone);
}

body.theme-dark footer {
  border-top-color: rgba(242, 239, 234, 0.10);
}

body.theme-dark .meta {
  color: rgba(242, 239, 234, 0.55);
}

body.theme-dark .meta .dot {
  background: var(--bone);
}

body.theme-dark ::selection {
  background: var(--bone);
  color: var(--carbon);
}

/* Inversions for shared components used on dark pages */
body.theme-dark .contact-sep {
  color: rgba(242, 239, 234, 0.30);
}

/* ─── Reveal primitive ───────────────────────────────────────
   Elements with .reveal start out faded + nudged. engine.js
   toggles .is-in via IntersectionObserver. Reduced-motion users
   see the final state immediately.
   ───────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ═══════════ verois case · editorial restraint ═══════════
   The case mirrors the home page rhythm: numbered sections,
   small uppercase eyebrows, one wordmark, one statement,
   then prose and image-led blocks. Variants are reserved for
   the two pillars where structure carries meaning (split for
   the paradox, duo for the opening ritual). All others share
   one quiet rhythm.
   ────────────────────────────────────────────────────────── */

.case {
  --quiet: rgba(10, 9, 8, 0.55);
  --rule:  rgba(10, 9, 8, 0.12);
}

/* Match page surface so a heavy PNG doesn't flash a different
   colour while it's still decoding. */
.case main img { background: var(--bone); }

/* ─── 01 · Cover · textual, mirrors home hero ─────────────
   Reuses .hero / .anchor / .hero-statement / .hero-foot
   from the home page. Only the em-quiet tint differs. */
.case-cover .hero-statement em {
  font-style: normal;
  color: var(--quiet);
}

/* ─── Shared · case-block + eyebrow ───────────────────────
   All non-cover sections use the same gutter as .works on
   home, with a thin ash-faint rule above the section label. */
.case-block {
  padding: var(--gap-label-top) var(--pad-x) calc(var(--gap-section) - var(--gap-label-top));
}

/* Zero the last child's trailing margin so block bottom-padding
   does the spacing on its own — no compounded gap before the
   next section's eyebrow. */
.case-block > :last-child { margin-bottom: 0; }

.case-eyebrow {
  margin-bottom: var(--gap-label-h2);
  border-top: 1px solid var(--ash-faint);
  padding-top: 2vh;
}

/* ─── Shared · case-figure (full-bleed within block) ──── */
.case-figure {
  width: 100%;
  margin: 0 0 var(--gap-label-h2);
}

.case-figure img,
.case-figure-video {
  display: block;
  width: 100%;
  height: auto;
}

.case-figure-video {
  background: var(--carbon);
}

/* ─── 02 · Manifest · narrative prose ─────────────────── */
.case-prose {
  max-width: 64ch;
  margin: 0 auto;
  display: grid;
  gap: clamp(20px, 2.4vh, 32px);
}

.case-prose p {
  font-size: clamp(17px, 1.2vw, 19px);
  font-weight: var(--w-light);
  line-height: 1.6;
  letter-spacing: -0.003em;
  color: var(--carbon);
  margin: 0;
}

/* The opening manifest line sets the tone — slightly larger
   without becoming theatrical. */
.case-prose p:first-child {
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-bottom: clamp(8px, 1.2vh, 16px);
}

/* ─── 03 · Material · five pillars ────────────────────── */
.case-pillar {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 6vh, 72px);
  margin-bottom: clamp(96px, 14vh, 160px);
}

/* Tail pillar relaxes its bottom margin so the macro figure
   that closes the material section sits closer to the rhythm. */
.case-pillar:last-of-type { margin-bottom: clamp(64px, 8vh, 96px); }

.case-pillar-figure {
  width: 100%;
  margin: 0;
}

.case-pillar-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.case-pillar-text {
  max-width: 64ch;
  margin: 0 auto;
  width: 100%;
}

.case-pillar-num {
  display: block;
  font-size: var(--t-caption);
  letter-spacing: 0.22em;
  color: var(--quiet);
  font-weight: 500;
  margin-bottom: clamp(20px, 3vh, 32px);
}

.case-pillar-name {
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: var(--w-light);
  letter-spacing: -0.015em;
  line-height: 1.12;
  color: var(--carbon);
  margin-bottom: clamp(20px, 3vh, 32px);
  max-width: 20ch;
}

.case-pillar-body {
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.65;
  color: var(--carbon);
  font-weight: 300;
  margin: 0 0 1.2em;
  max-width: 56ch;
}

.case-pillar-body:last-child { margin-bottom: 0; }
.case-pillar-body + .case-pillar-body { color: var(--quiet); }

/* Pillar I · split — image | text on desktop. */
.case-pillar--split {
  flex-direction: row;
  gap: 0;
  align-items: center;
}
.case-pillar--split > .case-pillar-figure { flex: 1 1 50%; }
.case-pillar--split > .case-pillar-text {
  flex: 1 1 50%;
  margin: 0;
  padding: clamp(32px, 5vh, 64px) clamp(32px, 4vw, 72px);
  max-width: none;
}

/* Pillar V · duo — closed + open, side by side. */
.case-pillar-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  background: var(--ash-faint);
}

.case-pillar-figure--half {
  width: 100%;
  margin: 0;
}
.case-pillar-figure--half img {
  display: block;
  width: 100%;
  height: auto;
}

/* ─── 04 · Consequence · slogan + links ─────────────────── */
.case-block--final {
  min-height: 60vh;
}

.case-finale-slogan {
  font-size: clamp(36px, 5.5vw, 72px);
  font-weight: var(--w-light);
  letter-spacing: -0.025em;
  line-height: 1.06;
  color: var(--carbon);
  max-width: 22ch;
  margin: 0 0 clamp(16px, 2.4vh, 32px);
}

.case-finale-sub {
  font-size: var(--t-body);
  font-weight: 300;
  line-height: 1.5;
  color: var(--quiet);
  max-width: 40ch;
  margin: 0;
}

.case-finale-links {
  margin-top: clamp(48px, 8vh, 96px);
  display: inline-flex;
  align-items: baseline;
  gap: 1.2em;
  flex-wrap: wrap;
}

/* Native button reset + matching anchor — one selector covers both. */
.case-finale-link {
  font: inherit;
  font-size: var(--t-caption);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--carbon);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.25s ease;
}

.case-finale-link:hover { --d: 1.4px; }

.case-finale-sep {
  color: var(--ash-mid);
  font-weight: 300;
  user-select: none;
}

/* ─── Tablet (≤ 980px) ──────────────────────────────────── */
@media (max-width: 980px) {
  .case-pillar--split {
    flex-direction: column;
    gap: clamp(40px, 6vh, 72px);
  }
  .case-pillar--split > .case-pillar-figure,
  .case-pillar--split > .case-pillar-text {
    flex: none;
  }
  .case-pillar--split > .case-pillar-text {
    padding: 0;
    max-width: 64ch;
    margin: 0 auto;
  }

  .case-pillar-duo { grid-template-columns: 1fr; gap: 24px; }
}

/* ─── Mobile (≤ 760px) ──────────────────────────────────── */
@media (max-width: 760px) {
  .case-pillar { gap: 32px; margin-bottom: 72px; }
  .case-pillar-name { font-size: clamp(24px, 6.5vw, 32px); }
  .case-prose p:first-child { font-size: clamp(20px, 5vw, 24px); }
  .case-finale-slogan { font-size: clamp(28px, 8vw, 40px); }
  .case-finale-links { gap: 0.7em; }
}

/* ════════════════════════════════════════════════════════════════
   THANK-YOU page — must fit one viewport, no scroll
   ════════════════════════════════════════════════════════════════ */
.thanks {
  /* Subtract top-nav (~7vh) + footer (~12vh) so .thanks fills what
     remains without forcing a scroll on a standard 1080px viewport. */
  min-height: calc(100vh - 18vh);
  padding: 4vh var(--gutter);
  display: grid;
  align-items: center;
}

.thanks-anchor {
  max-width: 64ch;
}

.thanks-eyebrow {
  display: block;
  margin-bottom: 18px;
  color: var(--ash);
}

.thanks-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: var(--w-light);
  letter-spacing: var(--ls-h1);
  line-height: 1.04;
  margin: 0 0 24px;
  max-width: 14ch;
}

.thanks-body {
  font-size: var(--t-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  color: var(--carbon);
  margin: 0 0 32px;
  max-width: 56ch;
}

.thanks-actions {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: baseline;
}

.thanks-link {
  font-size: var(--t-body);
  color: var(--carbon);
  text-decoration: none;
  letter-spacing: var(--ls-body);
  transition: color 0.25s ease;
}

.thanks-link:hover { --d: 1.8px; }

.thanks-link--quiet { color: var(--ash); }
.thanks-link--quiet:hover { color: var(--carbon); --d: 1.8px; }

footer {
  border-top: 1px solid var(--ash-faint);
  margin-top: 4vh;
  background: var(--bone);
  /* explicitly zero out any inherited inline padding-left/right */
  padding-left: 0;
  padding-right: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4vw;
  padding: 3.5vh var(--gutter);
  font-size: var(--t-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ash);
  font-weight: 400;
}

.footer-grid .social {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  justify-self: center;
}

.footer-grid .social a {
  color: var(--ash);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.25s ease;
}

.footer-grid .social a:hover { color: var(--carbon); }

.footer-grid .social .sep { color: var(--ash-mid); font-weight: 300; }

.footer-grid .tagline { text-align: right; }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — tablet (≤ 980px)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 4vh 3vw; }
  .filters-row   { grid-template-columns: repeat(2, 1fr); row-gap: 4vh; }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile (≤ 760px)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 760px) {
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9em;
    padding: 2vh var(--gutter) 1.6vh;
  }

  .nav-items { gap: 1.4em; font-size: 9px; width: 100%; }

  .lang-switch {
    margin-left: auto;
    padding-left: 0;
    border-left: none;
  }

  /* Home */
  .hero {
    padding: 2vh var(--gutter) 3vh;
    min-height: calc(100vh - 14vh);
  }
  .hero-statement { max-width: 100%; }

  .works { padding: 10vh var(--gutter) 8vh; }
  .work-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.6em 1em;
    padding: 1.5em 0;
  }
  .work-year { grid-row: 1; grid-column: 1; align-self: start; }
  .work-tags { grid-row: 1; grid-column: 2; align-self: start; text-align: right; }
  .work-name { grid-row: 2; grid-column: 1 / -1; }
  .work-marker { display: none; }
  .work-detail-inner { padding-left: 0; padding-bottom: 1.8em; }

  .contact { grid-template-columns: 1fr; gap: 4vh; }
  .contact-link { text-align: left; }

  /* About */
  .scene { padding: 6vh var(--gutter) 9vh; }
  .scene-definition { padding: 4vh var(--gutter) 3vh; }
  .definition-statement { max-width: 12ch; }

  /* Method — stack the three filters vertically */
  .filters-row { grid-template-columns: 1fr; column-gap: 0; row-gap: 3.6vh; }
  .filter-marker { top: 0.2em; }
  .filter-detail-inner { padding-top: 1.6em; }

  /* Services — mobile only: borrow the "phases" layout.
     Number on the left, name + body in the right column,
     thin separator between cards — matches the .phase pattern. */
  .services-grid { grid-template-columns: 1fr; gap: 0; }
  .service-card {
    display: grid;
    grid-template-columns: 4ch 1fr;
    grid-template-rows: auto auto;
    gap: 0.4em 1em;
    padding: 1.6em 0;
    border-bottom: 1px solid var(--ash-faint);
  }
  .service-num  { grid-row: 1 / 3; grid-column: 1; padding-top: 0.4em; }
  .service-name { grid-column: 2; grid-row: 1; margin-bottom: 0; }
  .service-desc { grid-column: 2; grid-row: 2; margin-top: 0.4em; }

  .phase {
    grid-template-columns: 4ch 1fr;
    grid-template-rows: auto auto;
    gap: 0.4em 1em;
  }
  .phase-num { grid-row: 1 / 3; }
  .phase-name { grid-column: 2; grid-row: 1; }
  .phase-desc { grid-column: 2; grid-row: 2; margin-top: 0.4em; }
  .phase-output { display: none; }
  .scene-presence {
    grid-template-columns: 1fr;
    gap: 4vh;
  }
  .presence-statement { margin-bottom: 32px; }
  .presence-contact {
    grid-column: 1;
    text-align: left;
  }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 1.2em; }
  .footer-grid .social, .footer-grid .tagline {
    justify-self: start;
    text-align: left;
  }

  /* .meta size is driven by --t-caption from the mobile :root */
}
