/* ==========================================================================
   Merova — merova.app
   One stylesheet for every page. No build step.
   Sections switch between dark (.s-dark) and light (.s-light); each sets
   its own colour variables, so components just use var(--fg), var(--line)...
   ========================================================================== */

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-var.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --ink: #0C0C0D;
  --ink-2: #141416;
  --bone: #EEECE7;
  --paper: #F2F0EB;
  --paper-2: #E9E7E1;
  --muted-on-light: #5F5D58;
  --muted-on-dark: #8B8984;
  --sage: #C1E1C1;            /* Merova Fit only */

  --font: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --frame: 1240px;            /* outer frame with guide lines */
  --pad: clamp(20px, 4.5vw, 64px);
  --header-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font);
  font-weight: 340;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--bone); color: var(--ink); }
.s-light ::selection { background: var(--ink); color: var(--bone); }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--bone); color: var(--ink); padding: 10px 16px;
  font-weight: 500; text-decoration: none; transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Section themes ---------- */
.s-dark {
  --bg: var(--ink);
  --fg: var(--bone);
  --muted: var(--muted-on-dark);
  --line: rgba(238, 236, 231, .11);
  --line-strong: rgba(238, 236, 231, .24);
  --raised: var(--ink-2);
  background: var(--bg);
  color: var(--fg);
}
.s-light {
  --bg: var(--paper);
  --fg: var(--ink);
  --muted: var(--muted-on-light);
  --line: rgba(12, 12, 13, .12);
  --line-strong: rgba(12, 12, 13, .26);
  --raised: var(--paper-2);
  background: var(--bg);
  color: var(--fg);
}

/* ---------- Frame: the architectural guide lines ---------- */
.frame {
  position: relative;
  width: min(var(--frame), 100% - 48px);
  margin-inline: auto;
  border-inline: 1px dashed var(--line);
}
/* small "+" marks where a section starts, at both guide lines */
.frame--marks::before,
.frame--marks::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 9px;
  height: 9px;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) center / 1px 100% no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 1px no-repeat;
  z-index: 2;
}
.frame--marks::before { left: -5px; }
.frame--marks::after { right: -5px; }

.pad { padding-inline: var(--pad); }
.section { padding-block: clamp(72px, 10vw, 136px); }
.section--tight { padding-block: clamp(56px, 7vw, 96px); }
.rule { border-top: 1px solid var(--line); }

@media (max-width: 639px) {
  .frame { width: 100%; border-inline: 0; }
  .frame--marks::before, .frame--marks::after { display: none; }
  .pad { padding-inline: 20px; }
}

/* ---------- Type ---------- */
.display {
  font-weight: 600;
  font-size: clamp(2.75rem, 1.1rem + 6.4vw, 6.4rem);
  line-height: .95;
  letter-spacing: -0.048em;
  text-wrap: balance;
}
.h2 {
  font-weight: 500;
  font-size: clamp(2rem, 1.25rem + 2.9vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.038em;
  text-wrap: balance;
}
.h3 {
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.lede {
  font-size: clamp(1.125rem, 1rem + .45vw, 1.375rem);
  line-height: 1.5;
  color: var(--muted);
  max-width: 34em;
  text-wrap: pretty;
}
.muted { color: var(--muted); }
.label {
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: .005em;
  color: var(--muted);
}
.label--fg { color: var(--fg); }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn--primary { background: var(--fg); color: var(--bg); }
.btn--primary:hover { background: color-mix(in srgb, var(--fg) 86%, var(--bg)); }
.btn--ghost { border-color: var(--line-strong); color: var(--fg); background: transparent; }
.btn--ghost:hover { border-color: var(--fg); }
.btn--fit { background: var(--sage); color: var(--ink); }
.btn--fit:hover { background: #d3ead3; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: .875rem; }

/* text link with an underline that sits a little low */
.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color .2s var(--ease);
}
.link:hover { text-decoration-color: currentColor; }

/* placeholder marker: easy to spot, easy to search for "[" */
.ph {
  font-family: var(--mono);
  font-size: .85em;
  padding: .05em .4em;
  border: 1px dashed currentColor;
  border-radius: 2px;
  white-space: normal;
  opacity: .85;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 12, 13, .84);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; text-decoration: none; padding: 6px 0; }
.brand img { height: 22px; width: auto; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav__links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  font-size: .9rem;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 0;
  transition: color .2s var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--fg); }
.nav__links a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--fg); }
.dot { width: 7px; height: 7px; background: var(--sage); display: inline-block; flex: none; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  margin-right: -10px;
  border: 0; background: transparent; cursor: pointer;
  position: relative;
}
.nav-toggle span {
  position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--fg);
  transition: transform .25s var(--ease), top .25s var(--ease);
}
.nav-toggle span:first-child { top: 17px; }
.nav-toggle span:last-child { top: 25px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

@media (max-width: 799px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 24px;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s .2s;
  }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
  .nav__links { flex-direction: column; gap: 0; }
  .nav__links a {
    display: block; padding: 16px 0; font-size: 1.25rem; color: var(--fg);
    border-bottom: 1px solid var(--line);
  }
  .nav__links a[aria-current="page"] { box-shadow: none; }
  .nav .btn { margin-top: 20px; }
}

/* ==========================================================================
   Home — hero
   ========================================================================== */
.hero .frame { min-height: calc(100svh - var(--header-h)); display: flex; }
.hero__grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  padding-block: clamp(56px, 8vw, 112px);
}
.hero__copy { display: grid; gap: 28px; }
.hero__copy .actions { margin-top: 8px; }
.hero__figure { display: grid; gap: 14px; justify-items: stretch; }
.hero__figure figcaption { text-align: right; }
.hero .display { max-width: 9.5em; }

@media (max-width: 959px) {
  .hero .frame { min-height: 0; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__figure { max-width: 460px; width: 100%; justify-self: center; }
  .hero__figure figcaption { text-align: center; }
}

/* the Fold construction drawing */
.fold { width: 100%; height: auto; overflow: visible; }
.fold .guide { stroke: var(--line-strong); stroke-width: .25; stroke-dasharray: .9 1.1; fill: none; }
.fold .diag { stroke: var(--line-strong); stroke-width: .3; fill: none; }
.fold .arc { stroke: var(--muted); stroke-width: .3; fill: none; }
.fold .node { fill: var(--bg); stroke: var(--muted); stroke-width: .3; }
.fold .node--fold { fill: var(--fg); stroke: none; }
.fold .plane { fill: var(--fg); }
.fold .tick { stroke: var(--muted); stroke-width: .3; }
.fold text { font-family: var(--mono); font-size: 2.6px; fill: var(--muted); letter-spacing: .02px; }

@media (prefers-reduced-motion: no-preference) {
  .fold .guide { animation: fadeIn .9s var(--ease) both; }
  .fold .guide:nth-of-type(2n) { animation-delay: .08s; }
  .fold .guide:nth-of-type(3n) { animation-delay: .16s; }
  .fold .diag { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s var(--ease) .35s forwards; }
  .fold .plane--l { animation: planeL 1s var(--ease) 1.05s both; }
  .fold .plane--r { animation: planeR 1s var(--ease) 1.25s both; }
  .fold .late { animation: fadeIn .7s var(--ease) 1.9s both; }
  .hero__copy > * { animation: rise .8s var(--ease) both; }
  .hero__copy > :nth-child(2) { animation-delay: .08s; }
  .hero__copy > :nth-child(3) { animation-delay: .16s; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes planeL { from { transform: translateX(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes planeR { from { transform: translateX(14px); opacity: 0; } to { transform: none; opacity: .42; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ==========================================================================
   Home — intro cells
   ========================================================================== */
.intro__head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  padding-block: clamp(56px, 7vw, 96px) clamp(40px, 6vw, 72px);
}
.intro__head .h2 { max-width: 10em; }
.intro__head .lede { font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); }
.intro__end { height: clamp(56px, 8vw, 112px); }
.intro__head p { max-width: 36em; }
.cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.cell {
  padding: 32px var(--pad) 8px;
  display: grid;
  align-content: start;
  gap: 12px;
}
.cell + .cell { border-left: 1px solid var(--line); }
.cell p { color: var(--muted); font-size: .98rem; max-width: 30em; }

@media (max-width: 899px) {
  .intro__head { grid-template-columns: 1fr; align-items: start; }
  .cells { grid-template-columns: 1fr; }
  .cell { padding: 28px var(--pad); }
  .cell + .cell { border-left: 0; border-top: 1px solid var(--line); }
}

/* ==========================================================================
   Home — apps
   ========================================================================== */
.apps__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px 40px;
  padding-bottom: clamp(32px, 5vw, 56px);
}
.apps__head p { max-width: 26em; }
.apps {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
}

/* Merova Fit: the solid plane */
.app-fit {
  --bg: var(--ink);
  --fg: var(--bone);
  --muted: var(--muted-on-dark);
  --line: rgba(238, 236, 231, .11);
  --line-strong: rgba(238, 236, 231, .24);
  background: var(--bg);
  color: var(--fg);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 38%);
}
.app-fit__main {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: clamp(24px, 3.5vw, 44px);
}
.app-fit__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.app-fit__top img { height: 26px; width: auto; }
.status { display: inline-flex; align-items: center; gap: 8px; }
.app-fit .h3 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); letter-spacing: -0.03em; line-height: 1.15; margin-top: 12px; }
.app-fit__main > p { color: var(--muted); max-width: 32em; }
.features {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  font-size: .92rem;
}
.features li { display: flex; gap: 10px; align-items: baseline; }
.features li::before {
  content: ""; width: 6px; height: 6px; flex: none; background: var(--sage);
  transform: translateY(-2px);
}
.facts { display: grid; border-top: 1px solid var(--line); margin-top: 4px; }
.facts > div {
  display: grid; grid-template-columns: 7.5em 1fr; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.facts dt { font-family: var(--mono); font-size: .78rem; color: var(--muted); padding-top: .2em; }
.facts dd { margin: 0; }
.app-fit__art {
  border-left: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 32px 24px;
  background:
    linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat;
}
.phone { width: 100%; max-width: 220px; height: auto; }
.phone .ln { fill: none; stroke: var(--line-strong); stroke-width: 1.2; }
.phone .body { fill: var(--bg); stroke: rgba(238,236,231,.42); stroke-width: 1.2; }
.phone .bar { fill: rgba(238,236,231,.18); }
.phone .bar--strong { fill: rgba(238,236,231,.5); }
.phone .sage { fill: var(--sage); }
.phone .sage-stroke { fill: none; stroke: var(--sage); stroke-width: 6; stroke-linecap: butt; }
.phone .track { fill: none; stroke: rgba(238,236,231,.12); stroke-width: 6; }
.phone .tick { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.phone .box { fill: none; stroke: rgba(238,236,231,.32); stroke-width: 1; }
.phone .box--on { fill: rgba(238,236,231,.42); stroke: none; }
.phone text { font-family: var(--mono); font-size: 7px; fill: var(--muted-on-dark); }

/* Next app: the translucent plane */
.app-next {
  border: 1px dashed var(--line-strong);
  padding: clamp(24px, 3.5vw, 44px);
  display: grid;
  align-content: space-between;
  gap: 40px;
  color: var(--fg);
}
.app-next__mark { width: 64px; height: auto; }
.app-next__mark polygon { fill: none; stroke: var(--fg); stroke-width: 1.4; stroke-dasharray: 3 3; }
.app-next__mark .r { opacity: .42; }
.app-next .h3 { font-size: 1.5rem; letter-spacing: -0.03em; margin-bottom: 10px; }
.app-next p { color: var(--muted); font-size: .98rem; }
.app-next .stack { display: grid; gap: 14px; }

@media (max-width: 1023px) {
  .apps { grid-template-columns: 1fr; }
  .app-next { gap: 28px; }
}
@media (max-width: 679px) {
  .app-fit { grid-template-columns: 1fr; }
  .app-fit__art { border-left: 0; border-top: 1px solid var(--line); padding: 28px 24px; }
  .phone { max-width: 180px; }
  .features { grid-template-columns: 1fr; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
}

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px 64px;
}
.cta .h2 { max-width: 13em; }
.cta p { margin-top: 18px; }
@media (max-width: 799px) { .cta { grid-template-columns: 1fr; align-items: start; } }

/* ==========================================================================
   Page hero (inner pages)
   ========================================================================== */
.page-hero__inner {
  padding-block: clamp(64px, 9vw, 128px) clamp(48px, 6vw, 80px);
  display: grid;
  gap: 24px;
}
.page-hero .display { font-size: clamp(2.5rem, 1.2rem + 5vw, 5.25rem); max-width: 12em; }

/* ==========================================================================
   About
   ========================================================================== */
.split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(20px, 5vw, 80px);
  padding-block: clamp(48px, 6vw, 80px);
}
.split + .split { border-top: 1px solid var(--line); }
.split__label { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.split__label .h3 { margin-top: 8px; }
.prose { max-width: 38em; }
.prose > * + * { margin-top: 1.1em; }
.prose p { text-wrap: pretty; }
.prose .big { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.625rem); line-height: 1.45; letter-spacing: -0.015em; font-weight: 360; }
.list-lines { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.list-lines li { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.list-lines strong { font-weight: 500; }
.list-lines span { color: var(--muted); }
@media (max-width: 799px) {
  .split { grid-template-columns: 1fr; }
  .split__label { position: static; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  padding-block: clamp(56px, 7vw, 96px);
}
.mailboxes { display: grid; align-content: start; border-top: 1px solid var(--line); }
.mailbox { padding: 24px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.mailbox a.addr {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.625rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  text-decoration: none;
  word-break: break-word;
}
.mailbox a.addr:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.mailbox p { color: var(--muted); font-size: .95rem; }
.business { margin-top: 32px; display: grid; gap: 10px; font-size: .92rem; }
.business dl { display: grid; gap: 8px; margin: 0; }
.business dl > div { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; }
.business dt { font-family: var(--mono); font-size: .78rem; color: var(--muted); padding-top: .2em; }
.business dd { margin: 0; }

.form { display: grid; gap: 20px; align-content: start; }
.form h2 { margin-bottom: 4px; }
.field { display: grid; gap: 8px; }
.field label { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: 1rem;
  font-weight: 380;
  transition: border-color .2s var(--ease);
}
.field textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 17px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 44px;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--fg); outline-offset: 0; border-color: var(--fg); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form .note { font-size: .85rem; color: var(--muted); }
.form-status { font-size: .95rem; min-height: 1.5em; }
.form-status[data-state="ok"] { font-weight: 500; }
.form-status[data-state="error"] { color: #8f2a1f; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 859px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 539px) { .field-row { grid-template-columns: 1fr; } .business dl > div { grid-template-columns: 1fr; gap: 0; } }

/* ==========================================================================
   Legal pages
   ========================================================================== */
.legal {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: clamp(24px, 5vw, 80px);
  padding-block: clamp(48px, 6vw, 88px);
}
.legal-nav { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.legal-nav p { margin-bottom: 12px; }
.legal-nav ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.legal-nav a {
  display: block; padding: 12px 0 12px 14px; border-bottom: 1px solid var(--line);
  font-size: .92rem; text-decoration: none; color: var(--muted);
  border-left: 2px solid transparent;
  transition: color .2s var(--ease);
}
.legal-nav a:hover { color: var(--fg); }
.legal-nav a[aria-current="page"] { color: var(--fg); border-left-color: var(--fg); font-weight: 450; }

.doc { max-width: 44em; min-width: 0; counter-reset: sec; }
.doc > .summary {
  padding: 22px 24px; background: var(--raised); margin-bottom: 40px;
  font-size: .98rem;
}
.doc > .summary p + p, .doc > .summary p + ul { margin-top: .7em; }
.doc > .summary ul { padding-left: 1.1em; }
.doc h2 {
  counter-increment: sec;
  font-size: 1.375rem; font-weight: 500; letter-spacing: -0.025em; line-height: 1.25;
  margin-top: 2.4em; padding-top: 1.2em; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 2.4em 1fr; align-items: baseline;
}
.doc h2::before {
  content: counter(sec, decimal-leading-zero);
  font-family: var(--mono); font-size: .8rem; font-weight: 400; color: var(--muted); letter-spacing: 0;
}
.doc h3 { font-size: 1.05rem; font-weight: 500; margin-top: 1.6em; letter-spacing: -0.01em; }
.doc p, .doc ul, .doc ol, .doc table { margin-top: .9em; }
.doc ul, .doc ol { padding-left: 1.2em; }
.doc li + li { margin-top: .4em; }
.doc li::marker { color: var(--muted); }
.doc a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.doc strong { font-weight: 550; }
.doc table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); }
.doc th { font-family: var(--mono); font-size: .76rem; font-weight: 400; color: var(--muted); border-bottom-color: var(--line-strong); }
.doc .table-wrap { overflow-x: auto; margin-top: .9em; }
.doc .table-wrap table { margin-top: 0; min-width: 520px; }
.doc .steps { list-style: none; padding: 0; counter-reset: step; }
.doc .steps li { counter-increment: step; display: grid; grid-template-columns: 2.4em 1fr; padding: 14px 0; border-bottom: 1px solid var(--line); margin: 0; }
.doc .steps li::before { content: counter(step); font-family: var(--mono); font-size: .85rem; color: var(--muted); padding-top: .15em; }
@media (max-width: 859px) {
  .legal { grid-template-columns: minmax(0, 1fr); }
  .legal-nav { position: static; }
  .doc h2 { grid-template-columns: 1fr; gap: 4px; }
}

/* ==========================================================================
   404
   ========================================================================== */
.notfound .frame { min-height: calc(100svh - var(--header-h) - 1px); display: flex; align-items: center; }
.notfound__inner { display: grid; gap: 24px; padding-block: 96px; }
.notfound svg { width: 88px; height: auto; margin-bottom: 12px; }
.notfound polygon { fill: var(--fg); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { border-top: 1px solid var(--line); }
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2fr));
  gap: 40px 32px;
  padding-block: clamp(56px, 7vw, 88px) 48px;
}
.footer__brand { display: grid; gap: 16px; align-content: start; }
.footer__brand img { height: 24px; width: auto; }
.footer__brand p { color: var(--muted); font-size: .95rem; }
.footer__col h2 { font-family: var(--mono); font-size: .78rem; font-weight: 400; color: var(--muted); margin-bottom: 14px; }
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer__col a { font-size: .92rem; text-decoration: none; color: var(--fg); opacity: .86; transition: opacity .2s var(--ease); }
.footer__col a:hover { opacity: 1; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.footer__col small { display: block; font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-top: 2px; }
.footer__base {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-block: 20px 28px; border-top: 1px solid var(--line);
}
@media (max-width: 899px) { .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer__brand { grid-column: 1 / -1; } }
@media (max-width: 359px) { .footer__grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Print (legal pages print cleanly)
   ========================================================================== */
@media print {
  .site-header, .site-footer, .legal-nav, .skip-link { display: none !important; }
  body, .s-dark, .s-light { background: #fff !important; color: #000 !important; }
  .frame { border: 0; width: 100%; }
  .legal { grid-template-columns: 1fr; padding: 0; }
  .page-hero__inner { padding: 0 0 16px; }
}
