/* =========================================================================
   Waxym — design system
   Warm industrial palette, fluid type, light/dark, motion-safe animations.
   ========================================================================= */

/* --------------------------------------------------------------- fonts -- */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin.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: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/spacegrotesk-latin.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: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/spacegrotesk-latin-ext.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* -------------------------------------------------------------- tokens -- */

:root {
  color-scheme: light dark;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;

  /* Fluid type scale */
  --step--2: clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.97rem + 0.16vw, 1.075rem);
  --step-1: clamp(1.15rem, 1.09rem + 0.3vw, 1.32rem);
  --step-2: clamp(1.4rem, 1.24rem + 0.8vw, 1.9rem);
  --step-3: clamp(1.7rem, 1.4rem + 1.5vw, 2.6rem);
  --step-4: clamp(2.1rem, 1.6rem + 2.4vw, 3.5rem);
  --step-5: clamp(2.6rem, 1.55rem + 4.6vw, 5.5rem);

  --shell: 1180px;
  --shell-narrow: 760px;
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 9vw, 8.5rem);

  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 26px;
  --radius-pill: 999px;

  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  /* ---- Light palette (warm paper) ---- */
  --bg: #f7f3ee;
  --bg-alt: #f0e9e0;
  --surface: #fffdfb;
  --surface-2: #faf5ef;
  --border: #e3d9cc;
  --border-strong: #cdbfac;
  --ink: #1b1712;
  --ink-2: #453d33;
  --muted: #6b6055;
  --accent: #e97e24;
  --accent-soft: #fbe6d1;
  --accent-ink: #9a4a06;
  --on-accent: #1b1712;
  --shadow-sm: 0 1px 2px rgba(43, 30, 15, 0.05), 0 4px 14px rgba(43, 30, 15, 0.05);
  --shadow-md: 0 2px 6px rgba(43, 30, 15, 0.06), 0 18px 40px rgba(43, 30, 15, 0.1);
  --grain-opacity: 0.05;
  --grain-blend: multiply;
}

/* Dark palette — applied by the OS preference unless the visitor forced light,
   and by the explicit `data-theme` override set by the theme toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #13100c;
    --bg-alt: #191510;
    --surface: #1e1a14;
    --surface-2: #241f18;
    --border: #342d23;
    --border-strong: #4b4235;
    --ink: #f4efe7;
    --ink-2: #dcd3c6;
    --muted: #a89b8b;
    --accent: #f59042;
    --accent-soft: #3a2413;
    --accent-ink: #f0a05a;
    --on-accent: #1b1712;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.5), 0 20px 44px rgba(0, 0, 0, 0.45);
    --grain-opacity: 0.09;
    --grain-blend: overlay;
  }
}

:root[data-theme='dark'] {
  --bg: #13100c;
  --bg-alt: #191510;
  --surface: #1e1a14;
  --surface-2: #241f18;
  --border: #342d23;
  --border-strong: #4b4235;
  --ink: #f4efe7;
  --ink-2: #dcd3c6;
  --muted: #a89b8b;
  --accent: #f59042;
  --accent-soft: #3a2413;
  --accent-ink: #f0a05a;
  --on-accent: #1b1712;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.5), 0 20px 44px rgba(0, 0, 0, 0.45);
  --grain-opacity: 0.09;
  --grain-blend: overlay;
}

/* --------------------------------------------------------------- reset -- */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--ink); }

button, input, select, textarea { font: inherit; color: inherit; }

ul, ol { padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--on-accent); }

/* ----------------------------------------------------------- utilities -- */

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--narrow { max-width: var(--shell-narrow); }

.skip-link {
  position: absolute;
  top: 0.6rem;
  left: 50%;
  z-index: 300;
  transform: translate(-50%, -160%);
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); color: var(--on-accent); }

.grain {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Scroll-triggered reveal — only armed when scripting is available. */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s var(--ease) calc(var(--i, 0) * 80ms),
    transform 0.7s var(--ease) calc(var(--i, 0) * 80ms);
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ------------------------------------------------------------- buttons -- */

.btn {
  --btn-py: 0.7rem;
  --btn-px: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: var(--btn-py) var(--btn-px);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s var(--ease-soft), border-color 0.25s var(--ease-soft),
    color 0.25s var(--ease-soft), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn--lg { --btn-py: 0.95rem; --btn-px: 1.7rem; font-size: var(--step-0); min-height: 52px; }
.btn--sm { --btn-py: 0.5rem; --btn-px: 1rem; font-size: var(--step--1); min-height: 40px; }

.btn__icon { transition: transform 0.3s var(--ease); flex: none; }

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, var(--shadow-sm);
}
.btn--primary:hover {
  color: var(--on-accent);
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, var(--shadow-md);
}
.btn--primary:hover .btn__icon { transform: translateX(4px); }
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn--ghost:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-2px);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  cursor: pointer;
}
.link-arrow svg { transition: transform 0.25s var(--ease); }
.link-arrow:hover { color: var(--ink); }
.link-arrow:hover svg { transform: translate(2px, -2px); }

.link-quiet { color: var(--muted); text-decoration: none; }
.link-quiet:hover { color: var(--accent-ink); text-decoration: underline; }

.chip-list { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--step--1);
  text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--step--1);
}

.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s var(--ease-soft) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --------------------------------------------------------------- intro -- */
/* First-visit curtain. The orange disc lands, the W paints itself on left to
   right the way it is written, the wordmark rises, then the mark flies into
   the header logo it becomes. Plays once per session; see initIntro().

   Timings live here rather than in JS so the whole sequence can be retuned in
   one place — app.js only reads the exit cue from --intro-exit-ms. */

.intro {
  --mark: clamp(104px, 24vw, 164px);
  --intro-exit-ms: 620;

  position: fixed;
  inset: 0;
  /* Above the fixed header and the skip link, below the grain so the overlay
     carries the same film texture as the page it covers. */
  z-index: 350;
  display: grid;
  place-items: center;
  padding: var(--gutter, 1.5rem);
  background-color: var(--bg);
  overflow: hidden;
  /* Swallows clicks aimed at links the visitor cannot see yet. */
  pointer-events: auto;
  transition: background-color 460ms var(--ease-soft);
}

/* Inert unless the pre-paint script opted this visit in. */
.intro[hidden] { display: none; }
html.intro-active .intro[hidden] { display: grid; }
html.intro-active,
html.intro-active body { overflow: hidden; }

/* The header logo is the flight's destination, so it stays out of sight until
   the mark has arrived on top of it. */
html.intro-active .brand { opacity: 0; }
html.intro-active .brand { transition: opacity 220ms linear; }
html.intro-landed .brand { opacity: 1; }

.intro__glow {
  position: absolute;
  width: min(120vmin, 900px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 34%, transparent) 0%, transparent 62%);
  opacity: 0;
  animation: introGlow 1500ms var(--ease-soft) both;
}

.intro__lockup {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--mark) * 0.24);
}

.intro__mark {
  position: relative;
  flex: none;
  width: var(--mark);
  height: var(--mark);
  will-change: transform;
}

.intro__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.intro__layer--disc {
  opacity: 0;
  transform-origin: 46.7% 53.6%; /* the disc's centre inside the viewBox */
  animation: introDisc 560ms cubic-bezier(0.16, 1.1, 0.3, 1) both;
}

/* A single ring pulse at the moment the disc settles. */
.intro__ripple {
  position: absolute;
  left: 46.7%;
  top: 53.6%;
  width: 87.6%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: introRipple 900ms var(--ease) 380ms both;
}

/* The stroke is a filled outline, not a centreline, so it cannot be "drawn"
   with a dash offset — wiping it on in the direction of writing reads the
   same and costs nothing. */
.intro__ink {
  position: absolute;
  inset: 0;
  clip-path: inset(0 100% 0 0);
  animation: introInk 760ms cubic-bezier(0.5, 0.05, 0.2, 1) 300ms both;
}

.intro__word {
  display: flex;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: calc(var(--mark) * 0.58);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  transition: opacity 260ms linear, transform 460ms var(--ease);
}

.intro__word span {
  display: inline-block;
  animation: introLetter 520ms var(--ease) both;
  animation-delay: calc(700ms + var(--i) * 52ms);
}

/* Exit: the curtain dissolves while the mark flies to the header. */
.intro.is-leaving { background-color: transparent; pointer-events: none; }
.intro.is-leaving .intro__glow { opacity: 0; transition: opacity 320ms linear; animation: none; }
.intro.is-leaving .intro__word { opacity: 0; transform: translateY(calc(var(--mark) * 0.16)); }
.intro.is-leaving .intro__mark {
  transition: transform calc(var(--intro-exit-ms) * 1ms) cubic-bezier(0.65, 0, 0.25, 1);
}
.intro.is-done { opacity: 0; transition: opacity 180ms linear; }

@keyframes introGlow {
  0%   { opacity: 0; transform: scale(0.6); }
  35%  { opacity: 1; }
  100% { opacity: 0.35; transform: scale(1.15); }
}

@keyframes introDisc {
  0%   { opacity: 0; transform: scale(0.2) rotate(-28deg); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes introRipple {
  0%   { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.6); }
}

@keyframes introInk {
  0%   { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 -12% 0 0); }
}

@keyframes introLetter {
  0%   { opacity: 0; transform: translateY(0.42em) rotate(4deg); filter: blur(7px); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}

/* Belt and braces: the pre-paint script already skips the intro here. */
@media (prefers-reduced-motion: reduce) {
  html.intro-active .intro[hidden] { display: none; }
  html.intro-active,
  html.intro-active body { overflow: visible; }
  html.intro-active .brand { opacity: 1; }
}

/* -------------------------------------------------------------- header -- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  transition: background-color 0.3s var(--ease-soft), border-color 0.3s var(--ease-soft),
    box-shadow 0.3s var(--ease-soft);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--border);
}

.site-header__progress {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  overflow: hidden;
}
.site-header__progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 45%, transparent));
  transform: scaleX(var(--progress, 0));
  transform-origin: 0 50%;
  transition: transform 0.1s linear;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-decoration: none;
  flex: none;
}
.brand__mark img { width: 34px; height: 34px; transition: transform 0.5s var(--ease); }
.brand:hover .brand__mark img { transform: rotate(-12deg) scale(1.06); }
.brand:hover { color: var(--ink); }

.site-nav { margin-inline-start: auto; }
.site-nav__list { display: flex; align-items: center; gap: 0.35rem; }
.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  font-size: var(--step--1);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s var(--ease-soft), background-color 0.2s var(--ease-soft);
}
.site-nav__link::after {
  content: '';
  position: absolute;
  left: 0.85rem; right: 0.85rem; bottom: 0.35rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.3s var(--ease);
}
.site-nav__link:hover { color: var(--ink); }
.site-nav__link:hover::after,
.site-nav__link.is-active::after { transform: scaleX(1); }
.site-nav__link.is-active { color: var(--ink); }

.site-header__actions { display: flex; align-items: center; gap: 0.5rem; margin-inline-start: auto; }
.site-nav + .site-header__actions { margin-inline-start: 0; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.lang-switch__icon { display: inline-flex; margin-inline-end: 0.3rem; color: var(--muted); }
.lang-switch__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s var(--ease-soft);
}
.lang-switch__item:hover { color: var(--ink); }
.lang-switch__item[aria-current='true'] { color: var(--accent-ink); }
.lang-switch__sep { color: var(--border-strong); font-size: var(--step--1); }
.lang-switch--lg { padding: 0.35rem 0.8rem; }
.lang-switch--lg .lang-switch__item { min-width: 40px; min-height: 40px; font-size: var(--step-0); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s var(--ease-soft), border-color 0.2s var(--ease-soft),
    transform 0.3s var(--ease);
}
.theme-toggle:hover { color: var(--accent-ink); border-color: var(--accent); transform: rotate(-12deg); }
.theme-toggle__icon { grid-area: 1 / 1; display: none; }
:root:not([data-theme]) .theme-toggle__icon[data-theme-icon='system'],
:root[data-theme='light'] .theme-toggle__icon[data-theme-icon='light'],
:root[data-theme='dark'] .theme-toggle__icon[data-theme-icon='dark'] { display: block; }

.site-header__cta { flex: none; }

.menu-toggle {
  display: none;
  place-items: center;
  place-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  cursor: pointer;
}
.menu-toggle__bar {
  display: block;
  width: 17px; height: 1.8px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease-soft);
}
.menu-toggle[aria-expanded='true'] .menu-toggle__bar:first-child { transform: translateY(3.4px) rotate(45deg); }
.menu-toggle[aria-expanded='true'] .menu-toggle__bar:last-child { transform: translateY(-3.4px) rotate(-45deg); }

/* --------------------------------------------------------- mobile menu -- */

.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 190;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  min-height: 100%;
  padding-block: 2rem 3rem;
}
.mobile-menu__list { display: grid; gap: 0.25rem; }
.mobile-menu__list li { opacity: 0; transform: translateY(14px); animation: menuIn 0.45s var(--ease) forwards; animation-delay: calc(var(--i) * 55ms + 60ms); }
@keyframes menuIn { to { opacity: 1; transform: none; } }
.mobile-menu__list a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  text-decoration: none;
}
.mobile-menu__list a svg { margin-inline-start: auto; color: var(--muted); transition: transform 0.25s var(--ease); }
.mobile-menu__list a:hover svg { transform: translate(3px, -3px); color: var(--accent-ink); }
.mobile-menu__index { color: var(--accent); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.mobile-menu__footer { display: grid; gap: 1.25rem; justify-items: start; }
.mobile-menu__cta { width: 100%; }
.mobile-menu__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.theme-toggle--lg { width: 44px; height: 44px; }

/* ---------------------------------------------------------------- hero -- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(100svh, 900px);
  padding-block: calc(var(--header-h) + 4rem) clamp(4rem, 10vh, 7rem);
  overflow: hidden;
}
.hero__backdrop { position: absolute; inset: 0; z-index: -1; }
.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}
.hero__orb--a {
  width: min(46vw, 560px); aspect-ratio: 1;
  top: -14%; right: -8%;
  background: radial-gradient(circle at 35% 35%, var(--accent), transparent 68%);
  animation: float 17s var(--ease-soft) infinite alternate;
}
.hero__orb--b {
  width: min(38vw, 440px); aspect-ratio: 1;
  bottom: -18%; left: -10%;
  background: radial-gradient(circle at 60% 40%, color-mix(in srgb, var(--accent) 55%, #d9a441), transparent 70%);
  opacity: 0.34;
  animation: float 21s var(--ease-soft) infinite alternate-reverse;
}
@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-4%, 6%, 0) scale(1.14); }
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px);
  background-size: clamp(48px, 7vw, 92px) clamp(48px, 7vw, 92px);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 20%, transparent 78%);
}

.hero__inner { position: relative; }
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.95rem 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  color: var(--ink-2);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 500;
  animation: fadeUp 0.7s var(--ease) both;
}

.hero__title {
  max-width: 16ch;
  font-size: var(--step-5);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}
.hero__line {
  display: block;
  animation: fadeUp 0.9s var(--ease) both;
  animation-delay: calc(var(--i) * 110ms + 90ms);
}
.hero__line--accent {
  background: linear-gradient(100deg, var(--accent) 8%, color-mix(in srgb, var(--accent) 65%, #e0b268) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
  font-weight: 600;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

.hero__lead {
  max-width: 56ch;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1.6;
  animation: fadeUp 0.9s var(--ease) 0.45s both;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: clamp(2rem, 4vw, 2.75rem);
  animation: fadeUp 0.9s var(--ease) 0.6s both;
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: var(--step--2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  animation: fadeUp 0.9s var(--ease) 0.9s both;
}
.hero__scroll:hover { color: var(--accent-ink); }
.hero__scroll-icon { animation: nudge 2.2s var(--ease-soft) infinite; }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

/* ------------------------------------------------------------- marquee -- */

.marquee { padding-block: clamp(2.5rem, 5vw, 4rem); border-block: 1px solid var(--border); background: var(--bg-alt); }
.marquee__label {
  margin-bottom: 1.75rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
}
.marquee__mask {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__viewport {
  display: flex;
  gap: clamp(2rem, 5vw, 4rem);
  width: max-content;
  animation: scroll-x 34s linear infinite;
}
.marquee__viewport:hover,
.marquee__viewport:focus-within { animation-play-state: paused; }
.marquee__track { display: flex; align-items: center; gap: clamp(2rem, 5vw, 4rem); }
.marquee__item img {
  width: auto;
  height: clamp(26px, 3.4vw, 36px);
  max-width: clamp(90px, 11vw, 132px);
  object-fit: contain;
  filter: grayscale(1) contrast(0.85);
  opacity: 0.6;
  transition: filter 0.35s var(--ease-soft), opacity 0.35s var(--ease-soft), transform 0.35s var(--ease);
}
:root[data-theme='dark'] .marquee__item img { filter: grayscale(1) invert(1) contrast(1.05) brightness(1.05); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .marquee__item img { filter: grayscale(1) invert(1) contrast(1.05) brightness(1.05); }
}
.marquee__item img:hover { opacity: 1; filter: none; transform: scale(1.06); }
@keyframes scroll-x {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - clamp(1rem, 2.5vw, 2rem))); }
}

/* ------------------------------------------------------------ sections -- */

.section { padding-block: var(--section-y); }
.section--approach, .section--team { background: var(--bg-alt); border-block: 1px solid var(--border); }

.section-head { max-width: 62ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head__title { font-size: var(--step-4); font-weight: 500; }
.section-head__lead { margin-top: 1.1rem; color: var(--muted); font-size: var(--step-1); }

/* ------------------------------------------------------- service cards -- */

.card-grid {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 2.5vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.35s var(--ease-soft), box-shadow 0.4s var(--ease);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.5s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.card:hover::before { transform: scaleX(1); }

.card__icon {
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  margin-bottom: 1.35rem;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  transition: transform 0.45s var(--ease);
}
.card:hover .card__icon { transform: rotate(-8deg) scale(1.06); }
.card__title { font-size: var(--step-1); margin-bottom: 0.75rem; }
.card__body { color: var(--muted); font-size: var(--step--1); line-height: 1.65; }
.card__points {
  display: grid;
  gap: 0.45rem;
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
}
.card__points li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-2);
  font-size: var(--step--1);
}
.card__check { flex: none; color: var(--accent); }

/* --------------------------------------------------------------- steps -- */

.steps {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.25rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  counter-reset: step;
}
.step { position: relative; display: flex; flex-direction: column; gap: 1.15rem; }
.step__marker { display: flex; align-items: center; gap: 0.85rem; }
.step__num {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 700;
  color: color-mix(in srgb, var(--accent) 45%, transparent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}
.step__icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-ink);
  transition: transform 0.4s var(--ease), border-color 0.3s var(--ease-soft);
}
.step:hover .step__icon { transform: translateY(-4px); border-color: var(--accent); }
.step__marker::after {
  content: '';
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--border) 0 6px, transparent 6px 12px);
}
.step:last-child .step__marker::after { display: none; }
.step__title { font-size: var(--step-1); margin-bottom: 0.5rem; }
.step__body { color: var(--muted); font-size: var(--step--1); }

/* ----------------------------------------------------------- expertise -- */

.expertise {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.expertise__group {
  padding: clamp(1.35rem, 2vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.expertise__group-title {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: var(--step-0);
  letter-spacing: 0.02em;
}

.stats {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--border);
}
.stat__value {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--step-5);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat__label { margin-top: 0.6rem; color: var(--muted); font-size: var(--step--1); max-width: 22ch; }

/* ---------------------------------------------------------------- team -- */

.members {
  display: grid;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.member {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.5rem, 2.5vw, 2rem) 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
  transition: transform 0.4s var(--ease), border-color 0.3s var(--ease-soft), box-shadow 0.4s var(--ease);
}
.member:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.member__photo {
  position: relative;
  display: block;
  width: clamp(96px, 14vw, 128px);
  aspect-ratio: 1;
  margin-bottom: 1.15rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  outline: 2px solid transparent;
  outline-offset: 5px;
  transition: outline-color 0.35s var(--ease-soft);
}
.member:hover .member__photo { outline-color: var(--accent); }
.member__photo img { width: 100%; height: 100%; object-fit: cover; }
.member__name { font-size: var(--step-1); }
.member__role { margin-top: 0.35rem; color: var(--muted); font-size: var(--step--1); }
.member__link {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  margin-top: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.25s var(--ease-soft), border-color 0.25s var(--ease-soft), transform 0.3s var(--ease);
}
.member__link:hover { color: var(--accent-ink); border-color: var(--accent); transform: translateY(-3px); }

/* ------------------------------------------------------------- contact -- */

.contact__layout {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .contact__layout { grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.35fr); align-items: start; }
}

.contact-cards { display: grid; gap: 1rem; }
.contact-card {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.3s var(--ease-soft);
}
.contact-card:hover { border-color: var(--border-strong); }
.contact-card__icon { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 0.9rem; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.contact-card__title { font-size: var(--step-0); margin-bottom: 0.5rem; }
.contact-card address { font-style: normal; color: var(--muted); font-size: var(--step--1); line-height: 1.6; }
.contact-card__stack { display: grid; gap: 0.2rem; }
.contact-card__stack a { color: var(--ink-2); font-size: var(--step--1); text-decoration: none; }
.contact-card__stack a:hover { color: var(--accent-ink); text-decoration: underline; }
.contact-card .link-arrow { margin-top: 0.85rem; }

.contact-form {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.contact-form__title { font-size: var(--step-2); }
.contact-form__hint { margin-top: 0.6rem; color: var(--muted); font-size: var(--step--1); }
.contact-form__grid {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field--wide { grid-column: 1 / -1; }
.field__label { display: flex; align-items: baseline; gap: 0.35rem; font-size: var(--step--1); font-weight: 600; }
.field__req { color: var(--accent-ink); }
.field__opt { color: var(--muted); font-weight: 400; }
.field__input {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--step--1);
  transition: border-color 0.2s var(--ease-soft), box-shadow 0.2s var(--ease-soft);
}
.field__input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.field__input:hover { border-color: var(--muted); }
.field__input:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 1px;
  border-color: var(--accent-ink);
}
.field__input--area { min-height: 128px; resize: vertical; line-height: 1.6; }
.field__select { position: relative; display: block; }
.field__select select { appearance: none; padding-right: 2.5rem; cursor: pointer; }
.field__select svg { position: absolute; top: 50%; right: 0.9rem; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.field__error { color: #b3261e; font-size: var(--step--2); font-weight: 500; }
:root[data-theme='dark'] .field__error { color: #ffb4ab; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .field__error { color: #ffb4ab; }
}
.field.has-error .field__input { border-color: #b3261e; }
:root[data-theme='dark'] .field.has-error .field__input { border-color: #ffb4ab; }

.contact-form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.75rem; }
.contact-form__status { color: var(--muted); font-size: var(--step--1); flex: 1 1 16rem; }
.contact-form__status.is-error { color: #b3261e; font-weight: 500; }
:root[data-theme='dark'] .contact-form__status.is-error { color: #ffb4ab; }

/* ----------------------------------------------------------------- map -- */

.map {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  margin-top: clamp(3rem, 6vw, 4.5rem);
}
@media (min-width: 900px) {
  .map { grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.5fr); align-items: center; }
}
.map__title { font-size: var(--step-2); }
.map__body { margin-top: 0.75rem; color: var(--muted); font-size: var(--step--1); max-width: 44ch; }
.map__frame {
  position: relative;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-alt);
  aspect-ratio: 4 / 3;
  max-height: 420px;
}
@media (min-width: 640px) {
  .map__frame { aspect-ratio: 16 / 9; }
}
.map__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.map__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.9rem;
  padding: 1.5rem;
  text-align: center;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px);
  background-size: 34px 34px;
}
.map__pin { color: var(--accent); animation: nudge 2.6s var(--ease-soft) infinite; }

/* -------------------------------------------------------------- footer -- */

.site-footer {
  padding-block: clamp(3rem, 6vw, 5rem) 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.site-footer__top {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}
.site-footer__brand { grid-column: span 1; max-width: 34ch; }
@media (min-width: 900px) { .site-footer__brand { grid-column: span 1; } }
.site-footer__tagline { margin-top: 1rem; color: var(--muted); font-size: var(--step--1); }
.badge-privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.1rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--step--2);
  font-weight: 500;
}
.badge-privacy svg { color: var(--accent-ink); flex: none; }

.site-footer__title {
  margin-bottom: 1rem;
  color: var(--ink);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.site-footer__list { display: grid; gap: 0.55rem; }
.site-footer__list a {
  color: var(--muted);
  font-size: var(--step--1);
  text-decoration: none;
}
.site-footer__list a:hover { color: var(--accent-ink); text-decoration: underline; }
.site-footer__list a[aria-current='page'] { color: var(--ink); font-weight: 500; }
.site-footer__address { margin-top: 1rem; font-style: normal; color: var(--muted); font-size: var(--step--1); line-height: 1.6; }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--step--2);
}
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: var(--step--2);
  text-decoration: none;
}
.to-top:hover { color: var(--accent-ink); }
.to-top__icon { transform: rotate(180deg); transition: transform 0.3s var(--ease); }
.to-top:hover .to-top__icon { transform: rotate(180deg) translateY(3px); }

/* --------------------------------------------------------- legal pages -- */

.page--legal { --header-h: 72px; }
.legal__header {
  padding-block: calc(var(--header-h) + clamp(3rem, 7vw, 5rem)) clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: var(--step--1);
  text-decoration: none;
}
.back-link__icon { transform: rotate(180deg); transition: transform 0.25s var(--ease); }
.back-link:hover { color: var(--accent-ink); }
.back-link:hover .back-link__icon { transform: rotate(180deg) translateX(3px); }
.legal__title { font-size: var(--step-4); font-weight: 500; }
.legal__intro { margin-top: 1.25rem; max-width: 62ch; color: var(--ink-2); font-size: var(--step-1); }
.legal__meta { margin-top: 1.5rem; color: var(--muted); font-size: var(--step--1); }

.legal__body {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-block: clamp(3rem, 6vw, 4.5rem);
}
@media (min-width: 960px) {
  .legal__body { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
  .legal__toc { position: sticky; top: calc(var(--header-h) + 2rem); }
}
.legal__toc {
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.legal__toc-title {
  margin-bottom: 0.9rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.legal__toc-list { display: grid; gap: 0.5rem; counter-reset: toc; }
.legal__toc-list a {
  display: block;
  color: var(--ink-2);
  font-size: var(--step--1);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 0.7rem;
  transition: color 0.2s var(--ease-soft), border-color 0.2s var(--ease-soft);
}
.legal__toc-list a:hover,
.legal__toc-list a.is-active { color: var(--accent-ink); border-left-color: var(--accent); }

.legal__content { max-width: 74ch; }
.legal-section + .legal-section { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.legal-section__title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: var(--step-2);
  font-weight: 500;
  scroll-margin-top: calc(var(--header-h) + 2rem);
}
.legal-section__num {
  color: color-mix(in srgb, var(--accent) 60%, transparent);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.prose > * + * { margin-top: 1.1rem; }
.prose p { color: var(--ink-2); }
.prose code {
  padding: 0.15em 0.4em;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.prose-list { display: grid; gap: 0.6rem; }
.prose-list li { position: relative; padding-left: 1.4rem; color: var(--ink-2); }
.prose-list li::before {
  content: '';
  position: absolute;
  top: 0.65em; left: 0.15rem;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
ol.prose-list { counter-reset: item; }
ol.prose-list li::before {
  counter-increment: item;
  content: counter(item);
  top: 0; left: 0;
  width: auto; height: auto;
  border-radius: 0;
  background: none;
  color: var(--accent-ink);
  font-weight: 700;
  font-size: var(--step--1);
}

.identity {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.identity__row {
  display: grid;
  gap: 0.15rem 1rem;
  padding: 0.85rem 1.1rem;
}
.identity__row + .identity__row { border-top: 1px solid var(--border); }
@media (min-width: 600px) { .identity__row { grid-template-columns: 200px minmax(0, 1fr); align-items: baseline; } }
.identity dt { color: var(--muted); font-size: var(--step--1); }
.identity dd { margin: 0; color: var(--ink); font-size: var(--step--1); word-break: break-word; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.data-table th, .data-table td { padding: 0.85rem 1rem; text-align: left; vertical-align: top; }
.data-table thead th {
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--step--2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table tbody tr + tr { border-top: 1px solid var(--border); }
.data-table tbody th { font-weight: 500; color: var(--ink); }
.data-table td { color: var(--muted); }

.callout {
  display: flex;
  gap: 0.85rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.callout svg { flex: none; color: var(--accent-ink); margin-top: 0.15rem; }
.callout p { color: var(--ink-2); font-size: var(--step--1); }

.legal__footnote {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--step--1);
}

/* ----------------------------------------------------------------- 404 -- */

.notfound { display: grid; place-items: center; min-height: 78svh; padding-block: calc(var(--header-h) + 4rem) 4rem; text-align: center; }
.notfound__inner { display: grid; justify-items: center; gap: 1.25rem; }
.notfound__code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 22vw, 12rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: transparent;
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 25%, transparent));
  -webkit-background-clip: text;
  background-clip: text;
}
.notfound__title { font-size: var(--step-3); font-weight: 500; }
.notfound__body { max-width: 46ch; color: var(--muted); }
.notfound__hint { margin-top: 1.5rem; color: var(--muted); font-size: var(--step--1); }

/* --------------------------------------------------------- breakpoints -- */

@media (max-width: 1000px) {
  .site-nav { display: none; }
  .site-header__cta { display: none; }
  .menu-toggle { display: inline-grid; }
  .site-header__actions,
  .site-nav + .site-header__actions { margin-inline-start: auto; }
}

@media (max-width: 560px) {
  .lang-switch__icon { display: none; }
  /* Keep brand + language + theme + menu on one line on narrow phones. */
  .site-header__inner { gap: 0.5rem; }
  .site-header__actions { gap: 0.25rem; }
  .site-header__actions > .lang-switch { padding: 0.15rem 0.35rem; }
  .site-header__actions > .lang-switch .lang-switch__item { min-width: 26px; }
  .site-header__actions > .theme-toggle { width: 36px; height: 36px; }
  .hero__title { max-width: none; }
  .contact-form__foot .btn { width: 100%; }
}

/* Smallest phones: shrink the brand so the header controls still fit. */
@media (max-width: 380px) {
  .brand { font-size: 1.2rem; gap: 0.45rem; }
  .brand__mark img { width: 28px; height: 28px; }
}

/* Small phones / large text: stack data tables into readable blocks. */
@media (max-width: 640px) {
  .data-table thead { display: none; }
  .data-table tbody tr { display: grid; gap: 0.35rem; padding: 0.9rem 1rem; }
  .data-table tbody tr + tr { border-top: 1px solid var(--border); }
  .data-table th, .data-table td { padding: 0; }
  .data-table td::before,
  .data-table tbody th::before {
    content: attr(data-label);
    display: block;
    color: var(--accent-ink);
    font-size: var(--step--2);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
}

/* --------------------------------------------------------------- motion -- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .marquee__mask { mask-image: none; -webkit-mask-image: none; overflow-x: auto; }
  .marquee__viewport { animation: none; }
  .hero__orb { animation: none; }
  .mobile-menu__list li { opacity: 1; transform: none; }
}

@media (prefers-contrast: more) {
  :root { --border: var(--muted); --muted: var(--ink-2); }
  .btn--ghost { border-width: 2px; }
}

/* ---------------------------------------------------------------- print -- */

@media print {
  .site-header, .site-footer, .grain, .hero__backdrop, .mobile-menu,
  .skip-link, .legal__toc, .map__frame, .marquee, .intro { display: none !important; }
  html.intro-active, html.intro-active body { overflow: visible; }
  html.intro-active .brand { opacity: 1; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .legal__body { display: block; padding-block: 0; }
  .legal__content { max-width: none; }
  a::after { content: ' (' attr(href) ')'; font-size: 0.85em; color: #555; word-break: break-all; }
  a[href^='#']::after, a[href^='mailto']::after { content: ''; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
