/* =========================================================================
   Mes — site.css
   Visual language: «Moonlight» — achromatic ink + silver, one muted
   moonlight-blue accent. Token values are inherited verbatim from the iOS
   design system (DSColor) so the marketing surface and the app read as one
   object. The layout language is deliberately editorial/technical: a visible
   hairline frame, monospace index labels, and a single restrained accent.
   No gradients-as-decoration, no glow-everywhere, no template hero.
   ========================================================================= */

/* ---- Tokens : dark is the base, exactly like the app ------------------- */
:root,
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0e0f13;
  --bg-deep: #08090c;
  --bg-light: #1a1c23;
  --surface: #16181e;
  --surface-1: #1e2027;
  --surface-2: #262932;
  --menu: #22252e;
  --text: #f2f3f5;
  --text-2: #9ba0ab;
  --text-3: #6b7079;
  --separator: #23262e;
  --hairline: #2a2d36;
  --accent: #6e8bb7;
  --accent-fill: #58749e;
  --accent-text: #9fb4d4;
  --accent-subtle: #1c2431;
  --success: #5fb79a;
  --warning: #e0b15a;
  --danger: #e5757f;

  --silver-0: #ffffff;
  --silver-1: #c9d3e0;
  --silver-2: #a9b2c4;

  --glow: 42%;              /* strength of the top moonlight wash          */
  --grain: 0.035;           /* film-grain opacity                          */
  --rail: rgba(255,255,255,0.055);   /* the structural frame lines         */
  --tick: rgba(255,255,255,0.20);
}

[data-theme='light'] {
  color-scheme: light;
  --bg: #f0f2f6;
  --bg-deep: #e4e7ee;
  --bg-light: #fbfcfe;
  --surface: #ffffff;
  --surface-1: #ffffff;
  --surface-2: #e9ecf2;
  --menu: #ffffff;
  --text: #14161b;
  --text-2: #5a606c;
  --text-3: #767c88;
  --separator: #e4e7ee;
  --hairline: #dce0e8;
  --accent: #4e6e96;
  --accent-fill: #4e6e96;
  --accent-text: #3c5c86;
  --accent-subtle: #e5ebf3;
  --success: #1f9e77;
  --warning: #b7811e;
  --danger: #c93b4a;

  --silver-1: #3c4658;
  --silver-2: #59627a;

  --glow: 16%;
  --grain: 0.02;
  --rail: rgba(20,22,27,0.09);
  --tick: rgba(20,22,27,0.28);
}

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.62;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
::selection { background: var(--accent-fill); color: #fff; }

/* ---- Atmosphere : moonlight wash + film grain ------------------------- */
.atmos { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg); }
.atmos::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% -20%, color-mix(in oklab, var(--accent-fill) var(--glow), transparent) 0%, transparent 55%),
    radial-gradient(90% 60% at 82% 4%, color-mix(in oklab, var(--accent) 14%, transparent) 0%, transparent 46%);
}
.atmos::after {  /* grain */
  content: ''; position: absolute; inset: 0; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =========================================================================
   Structural frame — the site sits inside a ruled technical sheet
   ========================================================================= */
.frame {
  max-width: 1200px;
  margin: 0 auto;
  border-left: 1px solid var(--rail);
  border-right: 1px solid var(--rail);
  position: relative;
}
.pad { padding-inline: clamp(1.25rem, 4vw, 4.5rem); }

/* section rule with an interrupting monospace index label */
.rule {
  position: relative;
  border-top: 1px solid var(--hairline);
}
.section { padding-block: clamp(4.5rem, 9vw, 8rem); position: relative; }

/* the little index/label that rides the top rule of a section */
.marker {
  position: absolute; top: -0.72em; left: clamp(1.25rem, 4vw, 4.5rem);
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .28rem .7rem;
  background: var(--bg);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: .68rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-3);
}
.marker b { color: var(--accent-text); font-weight: 500; }
.marker::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-fill); }

/* corner ticks on the frame — engineering-drawing detail */
.tick { position: absolute; width: 9px; height: 9px; pointer-events: none; z-index: 2; }
.tick::before, .tick::after { content: ''; position: absolute; background: var(--tick); }
.tick::before { width: 9px; height: 1px; top: 0; }
.tick::after  { width: 1px; height: 9px; left: 0; }
.tick.tl { top: -1px; left: -1px; }
.tick.tr { top: -1px; right: -1px; }
.tick.tr::before { right: 0; left: auto; } .tick.tr::after { right: 0; left: auto; }

/* ---- Shared type helpers ---------------------------------------------- */
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--accent-text);
}
.display {
  font-family: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 500; line-height: 1.02; letter-spacing: -0.02em;
  font-size: clamp(2.55rem, 6.4vw, 5.1rem);
  color: var(--text);
  text-wrap: balance;
}
h2.h {
  font-family: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 500; letter-spacing: -0.015em; line-height: 1.08;
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  text-wrap: balance;
}
h3.sub {
  font-family: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 500; font-size: 1.22rem; letter-spacing: -0.01em; line-height: 1.25;
}
.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.32rem); line-height: 1.5;
  color: var(--text-2); max-width: 40ch; text-wrap: pretty;
}
.measure { max-width: 62ch; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.accent { color: var(--accent-text); }

/* inline link inside prose */
.link {
  color: var(--accent-text);
  text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent-text) 45%, transparent);
  text-underline-offset: 3px; transition: text-decoration-color .18s ease;
}
.link:hover { text-decoration-color: var(--accent-text); }

/* =========================================================================
   Header
   ========================================================================= */
.site-head {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: saturate(1.3) blur(14px); -webkit-backdrop-filter: saturate(1.3) blur(14px);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent; transition: border-color .25s ease, background .25s ease;
}
.site-head.scrolled { border-bottom-color: var(--hairline); }
.nav { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 1.4rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand .word {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 600;
  font-size: 1.12rem; letter-spacing: .16em; padding-left: .12em;
}
.nav-spacer { flex: 1; }
.nav-links { display: flex; gap: .3rem; align-items: center; }
.nav-links a {
  padding: .5rem .75rem; border-radius: 8px; font-size: .93rem; color: var(--text-2);
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--text); background: color-mix(in oklab, var(--text) 6%, transparent); }

/* small square controls: theme + language */
.ctrl {
  height: 34px; min-width: 34px; padding: 0 .55rem; border: 1px solid var(--hairline);
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  color: var(--text-2); font-family: 'IBM Plex Mono', monospace; font-size: .74rem; letter-spacing: .1em;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ctrl:hover { color: var(--text); border-color: var(--text-3); }
.ctrl svg { width: 16px; height: 16px; }
.lang-switch { display: inline-flex; border: 1px solid var(--hairline); border-radius: 9px; overflow: hidden; }
.lang-switch a {
  padding: .34rem .58rem; font-family: 'IBM Plex Mono', monospace; font-size: .72rem; letter-spacing: .08em;
  color: var(--text-3);
}
.lang-switch a[aria-current='true'] { color: var(--text); background: color-mix(in oklab, var(--text) 8%, transparent); }
.lang-switch a + a { border-left: 1px solid var(--hairline); }

.menu-btn { display: none; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .6rem; justify-content: center;
  padding: .85rem 1.3rem; border-radius: 11px; font-weight: 500; font-size: .98rem;
  letter-spacing: .005em; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #101319;
  background: linear-gradient(180deg, #ffffff 0%, var(--silver-2) 130%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 10px 30px -12px rgba(0,0,0,0.7);
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 600;
}
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 14px 34px -12px rgba(0,0,0,0.75); }
.btn-ghost {
  border: 1px solid var(--hairline); color: var(--text);
  font-family: 'IBM Plex Mono', monospace; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
}
.btn-ghost:hover { border-color: var(--text-3); background: color-mix(in oklab, var(--text) 5%, transparent); }
.btn .arr { transition: transform .18s ease; }
.btn:hover .arr { transform: translateX(3px); }

/* =========================================================================
   Hero
   ========================================================================= */
.hero { padding-top: clamp(3.5rem, 8vw, 6.5rem); padding-bottom: clamp(3rem, 6vw, 5rem); position: relative; }
.hero .eyebrow { display: block; margin-bottom: 1.7rem; }
.hero h1 { margin: 0 0 1.6rem; }
.hero .lead { max-width: 56ch; font-size: clamp(1.12rem, 1.7vw, 1.4rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2.4rem; align-items: center; }
.hero-note { margin-top: 1.15rem; color: var(--text-3); font-family: 'IBM Plex Mono', monospace; font-size: .78rem; letter-spacing: .04em; }
.hero-note b { color: var(--accent-text); font-weight: 500; }

/* the "assurances" strip beneath the hero */
.assure { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--hairline); }
.assure > div { padding: 1.5rem clamp(1rem, 2vw, 1.6rem) 1.6rem; border-right: 1px solid var(--hairline); }
.assure > div:first-child { padding-left: 0; }
.assure > div:last-child { border-right: 0; }
.assure dt { font-family: 'IBM Plex Mono', monospace; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-text); margin-bottom: .5rem; }
.assure dd { font-size: .95rem; color: var(--text-2); line-height: 1.45; }
.assure strong { color: var(--text); font-weight: 500; }

/* =========================================================================
   Server point-of-view : the signature comparison module
   ========================================================================= */
.pov-head { max-width: 60ch; margin-bottom: 2.6rem; }
.pov-head h2 { margin-bottom: 1rem; }
.pov { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden; }
.pov-col { padding: 1.6rem clamp(1.1rem, 2.2vw, 1.9rem) 1.9rem; }
.pov-col:first-child { border-right: 1px solid var(--hairline); background: color-mix(in oklab, var(--danger) 4%, transparent); }
.pov-col:last-child { background: color-mix(in oklab, var(--accent-fill) 7%, transparent); }
.pov-col h4 { font-family: 'IBM Plex Mono', monospace; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 1.3rem; color: var(--text-2); display: flex; align-items: center; gap: .5rem; }
.pov-col:first-child h4 b { color: var(--danger); font-weight: 500; }
.pov-col:last-child h4 b { color: var(--accent-text); font-weight: 500; }
.pov li { list-style: none; display: flex; gap: .7rem; padding: .62rem 0; border-top: 1px solid color-mix(in oklab, var(--hairline) 70%, transparent); font-size: .95rem; }
.pov li:first-of-type { border-top: 0; }
.pov .ico { flex: none; width: 17px; height: 17px; margin-top: .18rem; }
.pov-col:first-child .txt { color: var(--text); }
.pov-col:last-child .row { display: flex; flex-direction: column; }
.pov-col:last-child .txt { color: var(--text-3); font-size: .9rem; text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--text-2) 88%, transparent); text-decoration-thickness: 2px; }
.pov-col:last-child .tag { font-family: 'IBM Plex Mono', monospace; font-size: .8rem; letter-spacing: .01em; color: var(--accent-text); font-weight: 500; margin-top: .22rem; }

/* ciphertext demo */
.cipher { margin-top: 1.8rem; border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden; }
.cipher-bar { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--hairline); font-family: 'IBM Plex Mono', monospace; font-size: .72rem; letter-spacing: .1em; color: var(--text-3); text-transform: uppercase; }
.cipher-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 22%, transparent); }
.cipher-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; }
.cipher-cell { padding: 1.25rem 1.3rem; }
.cipher-cell + .cipher-cell { border-left: 1px solid var(--hairline); }
.cipher-cell .k { font-family: 'IBM Plex Mono', monospace; font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-bottom: .7rem; }
.cipher-plain { font-size: 1rem; color: var(--text); }
.cipher-plain .cursor { display: inline-block; width: 2px; height: 1.05em; background: var(--accent); vertical-align: -0.16em; margin-left: 1px; animation: blink 1.05s steps(1) infinite; }
.cipher-arrow { display: grid; place-items: center; padding: 0 .4rem; color: var(--text-3); }
.cipher-code { font-family: 'IBM Plex Mono', monospace; font-size: .82rem; line-height: 1.55; color: var(--accent-text); word-break: break-all; }
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================================
   How it works — numbered steps down a spine
   ========================================================================= */
.steps { display: grid; gap: 0; margin-top: 1rem; }
.step { display: grid; grid-template-columns: 4.5rem 1fr; gap: clamp(1rem,3vw,2.4rem); padding: 2rem 0; border-top: 1px solid var(--hairline); }
.step:first-child { border-top: 0; }
.step .n { font-family: 'Space Grotesk', monospace; font-size: 1.6rem; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.step h3 { margin-bottom: .5rem; }
.step p { color: var(--text-2); max-width: 60ch; }
.step .kv { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.chip { font-family: 'IBM Plex Mono', monospace; font-size: .7rem; letter-spacing: .06em; color: var(--accent-text); border: 1px solid var(--hairline); border-radius: 7px; padding: .26rem .55rem; }
.kv-label { font-family: 'IBM Plex Mono', monospace; font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-right: .1rem; }

/* =========================================================================
   Capabilities grid
   ========================================================================= */
.grid-cap { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--hairline); border-left: 1px solid var(--hairline); }
.cap { padding: 1.9rem clamp(1.2rem,2vw,1.7rem) 2rem; border-right: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); position: relative; transition: background .2s ease; }
.cap:hover { background: color-mix(in oklab, var(--text) 3.5%, transparent); }
.cap .ix { font-family: 'IBM Plex Mono', monospace; font-size: .68rem; letter-spacing: .12em; color: var(--text-3); }
.cap .ic { width: 22px; height: 22px; margin: 1rem 0 1rem; color: var(--accent-text); }
.cap h3 { font-size: 1.12rem; margin-bottom: .5rem; }
.cap p { font-size: .93rem; color: var(--text-2); line-height: 1.5; }

/* =========================================================================
   Audience
   ========================================================================= */
.aud { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem,5vw,4.5rem); align-items: start; }
.aud-list { display: grid; gap: 0; }
.aud-row { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; padding: 1.15rem 0; border-top: 1px solid var(--hairline); }
.aud-row:first-child { border-top: 0; }
.aud-row .r-ix { font-family: 'IBM Plex Mono', monospace; font-size: .72rem; color: var(--accent-text); padding-top: .25rem; }
.aud-row h4 { font-size: 1.02rem; font-weight: 600; margin-bottom: .25rem; }
.aud-row p { font-size: .92rem; color: var(--text-2); }

/* =========================================================================
   Trust / "don't trust, verify"
   ========================================================================= */
.trust-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(2rem,4vw,3.5rem); }
.trust-item { padding: 1.4rem 0; border-top: 1px solid var(--hairline); display: grid; grid-template-columns: auto 1fr; gap: 1rem; }
.trust-item .c { width: 18px; height: 18px; color: var(--accent-text); margin-top: .2rem; }
.trust-item h4 { font-size: 1rem; font-weight: 600; margin-bottom: .3rem; }
.trust-item p { font-size: .92rem; color: var(--text-2); }
.honesty { margin-top: 2.6rem; border: 1px solid var(--hairline); border-left: 2px solid var(--accent-fill); border-radius: 12px; padding: 1.5rem 1.7rem; background: var(--surface); }
.honesty p { color: var(--text-2); max-width: 74ch; }
.honesty strong { color: var(--text); font-weight: 600; }

/* =========================================================================
   Manifesto pull-line
   ========================================================================= */
.manifesto { padding-block: clamp(4rem, 8vw, 7rem); }
.manifesto blockquote {
  font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 500;
  font-size: clamp(1.7rem, 4vw, 3rem); line-height: 1.14; letter-spacing: -0.02em;
  max-width: 20ch; text-wrap: balance;
}
.manifesto blockquote .em { color: var(--accent-text); }
.manifesto cite { display: block; margin-top: 1.6rem; font-style: normal; font-family: 'IBM Plex Mono', monospace; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }

/* =========================================================================
   CTA / early access
   ========================================================================= */
.cta { text-align: left; }
.cta-inner { border: 1px solid var(--hairline); border-radius: 18px; padding: clamp(2rem,5vw,3.6rem); background:
   radial-gradient(120% 140% at 0% 0%, color-mix(in oklab, var(--accent-fill) 12%, transparent) 0%, transparent 55%), var(--surface); }
.cta h2 { max-width: 20ch; margin-bottom: 1rem; }
.cta p { color: var(--text-2); max-width: 52ch; margin-bottom: 2rem; }
.cta-form { display: flex; gap: .7rem; flex-wrap: wrap; max-width: 520px; }
.cta-form input {
  flex: 1; min-width: 220px; padding: .85rem 1rem; border-radius: 11px; border: 1px solid var(--hairline);
  background: var(--bg); color: var(--text); font: inherit; font-size: .98rem;
}
.cta-form input::placeholder { color: var(--text-3); }
.cta-form input:focus { outline: none; border-color: var(--accent-fill); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent-fill) 26%, transparent); }
.cta-small { margin-top: 1.1rem; font-family: 'IBM Plex Mono', monospace; font-size: .74rem; color: var(--text-3); letter-spacing: .04em; }

/* =========================================================================
   Footer
   ========================================================================= */
.site-foot { border-top: 1px solid var(--hairline); padding-block: clamp(3rem,6vw,4.5rem) 2.5rem; }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.foot-brand .brand { margin-bottom: 1rem; }
.foot-brand p { color: var(--text-2); font-size: .92rem; max-width: 34ch; }
.foot-col h5 { font-family: 'IBM Plex Mono', monospace; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); margin-bottom: 1rem; }
.foot-col a, .foot-col span { display: block; color: var(--text-2); font-size: .93rem; padding: .28rem 0; transition: color .15s ease; }
.foot-col a:hover { color: var(--text); }
.foot-legal { margin-top: 2.8rem; padding-top: 1.6rem; border-top: 1px solid var(--hairline); display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: baseline; justify-content: space-between; }
.foot-legal .entity { font-size: .84rem; color: var(--text-3); line-height: 1.6; max-width: 62ch; }
.foot-legal .entity b { color: var(--text-2); font-weight: 500; }
.foot-legal .made { font-family: 'IBM Plex Mono', monospace; font-size: .72rem; letter-spacing: .1em; color: var(--text-3); display: inline-flex; align-items: center; gap: .5rem; }
.foot-legal .made .fl { width: 16px; height: 11px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px var(--hairline); }

/* =========================================================================
   Legal / document pages
   ========================================================================= */
.doc { padding-block: clamp(2.5rem, 5vw, 4rem) clamp(4rem,8vw,6rem); }
.doc-head { border-bottom: 1px solid var(--hairline); padding-bottom: 2rem; margin-bottom: 2.5rem; }
.doc-head .eyebrow { display: block; margin-bottom: 1.1rem; }
.doc-head h1 { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 500; font-size: clamp(2rem,4.5vw,3rem); letter-spacing: -0.02em; line-height: 1.06; margin-bottom: 1.1rem; }
.doc-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; font-family: 'IBM Plex Mono', monospace; font-size: .74rem; color: var(--text-3); letter-spacing: .04em; }
.doc-meta b { color: var(--accent-text); font-weight: 500; }
.doc-wrap { display: grid; grid-template-columns: 220px 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.toc { position: sticky; top: 88px; font-size: .88rem; }
.toc h6 { font-family: 'IBM Plex Mono', monospace; font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); margin-bottom: .9rem; }
.toc a { display: block; color: var(--text-2); padding: .32rem 0 .32rem .9rem; border-left: 1px solid var(--hairline); transition: color .15s ease, border-color .15s ease; }
.toc a:hover { color: var(--text); border-color: var(--text-3); }
.prose { max-width: 72ch; }
.prose .note { font-style: italic; color: var(--text-3); font-size: .92rem; border: 1px solid var(--hairline); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 2.5rem; background: var(--surface); }
.prose h2 { font-family: 'Space Grotesk', system-ui, sans-serif; font-weight: 500; font-size: 1.4rem; letter-spacing: -0.01em; margin: 2.6rem 0 .9rem; scroll-margin-top: 88px; display: flex; gap: .7rem; align-items: baseline; }
.prose h2 .s { font-family: 'IBM Plex Mono', monospace; font-size: .8rem; color: var(--accent-text); font-weight: 400; }
.prose h3 { font-size: 1.08rem; font-weight: 600; margin: 1.8rem 0 .6rem; }
.prose p, .prose li { color: var(--text-2); }
.prose p { margin: .8rem 0; }
.prose ul, .prose ol { margin: .7rem 0 .7rem 1.2rem; }
.prose li { margin: .4rem 0; padding-left: .3rem; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--accent-text) 40%, transparent); }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 2.5rem 0; }
.prose .kvs { border: 1px solid var(--hairline); border-radius: 10px; padding: .3rem 1.1rem; margin: 1.2rem 0; }
.prose .kvs div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--hairline); font-size: .92rem; }
.prose .kvs div:first-child { border-top: 0; }
.prose .kvs .kk { color: var(--text-3); font-family: 'IBM Plex Mono', monospace; font-size: .78rem; letter-spacing: .04em; }
.prose .kvs .vv { color: var(--text); text-align: right; }

/* =========================================================================
   Utility, motion, reveal
   ========================================================================= */
.stack > * + * { margin-top: 1rem; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
[data-delay='1'] { transition-delay: .06s; }
[data-delay='2'] { transition-delay: .12s; }
[data-delay='3'] { transition-delay: .18s; }
[data-delay='4'] { transition-delay: .24s; }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
.skip {
  position: absolute; left: -999px; top: .5rem; z-index: 100; background: var(--menu); color: var(--text);
  padding: .6rem 1rem; border-radius: 8px; border: 1px solid var(--hairline);
}
.skip:focus { left: .5rem; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .cipher-plain .cursor { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .doc-wrap { grid-template-columns: 1fr; }
  .toc { position: static; margin-bottom: 2rem; border: 1px solid var(--hairline); border-radius: 12px; padding: 1.1rem 1.2rem; }
  .aud { grid-template-columns: 1fr; }
  .grid-cap { grid-template-columns: repeat(2, 1fr); }
  .assure { grid-template-columns: repeat(2, 1fr); }
  .assure > div:nth-child(2) { border-right: 0; }
  .assure > div:nth-child(odd) { padding-left: 0; }
  .foot-top { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav-links, .head-lang, .head-cta { display: none; }
  .menu-btn { display: inline-flex; }
  .pov { grid-template-columns: 1fr; }
  .pov-col:first-child { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .cipher-body { grid-template-columns: 1fr; }
  .cipher-cell + .cipher-cell { border-left: 0; border-top: 1px solid var(--hairline); }
  .cipher-arrow { transform: rotate(90deg); padding: .5rem 0; }
  .trust-grid { grid-template-columns: 1fr; }
  .grid-cap { grid-template-columns: 1fr; }
  .assure { grid-template-columns: 1fr; }
  .assure > div { border-right: 0; padding-left: 0; }
  .step { grid-template-columns: 1fr; gap: .5rem; }
  .step .n { font-size: 1.2rem; }
  .hero-cta .btn { flex: 1; }
}

/* mobile slide-down menu */
.mobile-menu { display: none; }
.mobile-menu.open { display: block; border-top: 1px solid var(--hairline); background: var(--bg); }
.mobile-menu a { display: block; padding: .95rem clamp(1.25rem,4vw,4.5rem); border-bottom: 1px solid var(--separator); color: var(--text); }
.mobile-menu .row { display: flex; gap: .8rem; padding: 1rem clamp(1.25rem,4vw,4.5rem); align-items: center; }
