/* Factor homepage.
   Tokens come from the mark: the plate's two blues, the glyph's white, and the
   45° chamfer that ends each bar of the F — reused as the corner of every
   button and card. Signal yellow is the agent's hand: its cursor, its click,
   a steering message. Nothing else gets it. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Next";
  src: url("../fonts/atkinson.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("../fonts/martian-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  --frost: #edf5fa;
  --frost-2: #e2eef6;
  --paper: #f9fcfe;
  --ink: #0f2e44;
  --ink-2: #3a586d;
  --prussian: #0a2540;
  --prussian-2: #10325a;
  --night: #071a2e;
  --sky: #0ea5e9;
  --deep: #0369a1;
  --deep-2: #075985;
  --alloy: #bcd3e0;
  --signal: #f2c75c;
  --on-dark: #e6f1f8;
  --on-dark-2: #a4bfd2;

  --display: "Archivo", "Hiragino Sans", "Noto Sans CJK JP", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --body: "Atkinson Next", "Hiragino Sans", "Noto Sans CJK JP", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Set by main.js from the real viewport so the sheet, the rulers and the
     readout agree to the pixel; these are the no-JS approximations. */
  --gut: 0px;
  --rx: 0px;
  --cell: calc((100vw - var(--gut)) / 6);
  --pad: 18px;
  --nav-h: 60px;
  --chamfer: 12px;
  --cut: polygon(0 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%);
  --line: rgba(14, 165, 233, 0.075);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}
@media (min-width: 640px) {
  :root { --cell: calc((100vw - var(--gut)) / 12); --pad: clamp(24px, 4vw, 48px); }
}
@media (min-width: 1024px) {
  :root { --gut: 28px; --rx: 22px; --pad: clamp(48px, var(--cell), 150px); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--rx) + var(--nav-h) + 12px); }
html.i18n-wait body { visibility: hidden; }
body {
  position: relative;
  margin: 0;
  background: var(--frost);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: 0.86em; font-stretch: 87.5%; padding: 0.08em 0.35em; background: rgba(3, 105, 161, 0.09); }
.dark code { background: rgba(14, 165, 233, 0.16); }
::selection { background: var(--signal); color: var(--ink); }

:focus-visible { outline: 2px solid var(--deep); outline-offset: 3px; }
.dark :focus-visible { outline-color: var(--signal); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--frost); text-decoration: none; }
.skip:focus { top: 12px; }

.mono { font-family: var(--mono); font-stretch: 87.5%; letter-spacing: 0; }
.wrap { margin-left: calc(var(--gut) + var(--pad)); margin-right: var(--pad); }

/* ---- type ---------------------------------------------------------------- */

.display {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 110%;
  line-height: 0.96;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.h2 { font-size: clamp(2.05rem, 4.5vw + 0.4rem, 5.1rem); max-width: 15ch; }
.h3 { font-size: clamp(1.6rem, 2.3vw + 0.5rem, 2.6rem); font-stretch: 100%; }
.lead { font-size: clamp(1.08rem, 0.55vw + 0.95rem, 1.36rem); line-height: 1.55; color: var(--ink-2); max-width: 54ch; text-wrap: pretty; }
.dark .lead { color: var(--on-dark-2); }
.eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: clamp(16px, 2.2vw, 28px);
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--deep);
}
.dark .eyebrow { color: var(--sky); }
.cellref:not(:empty) { padding: 3px 7px; background: var(--ink); color: var(--frost); letter-spacing: 0.02em; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%); }
.dark .cellref:not(:empty) { background: var(--signal); color: var(--ink); }
.fine { font-size: 0.9rem; color: var(--ink-2); max-width: 52ch; }
.dark .fine { color: var(--on-dark-2); }

/* CJK: no wide stretch to fall back on, and lines may break between any two
   characters, so give the glyphs room and let them break where they must. */
:lang(ja) .display, :lang(zh-Hans) .display { letter-spacing: 0; line-height: 1.12; font-stretch: 100%; }
:lang(ja), :lang(zh-Hans) { line-break: strict; }
:lang(ja) .eyebrow, :lang(zh-Hans) .eyebrow { text-transform: none; letter-spacing: 0.02em; }

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

.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px 0 20px;
  font: 700 1rem/1 var(--body); letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap;
  clip-path: var(--cut);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; }
.btn-primary { background: var(--deep); color: #fff; }
.btn-primary:hover { background: var(--deep-2); }
.dark .btn-primary { background: var(--sky); color: var(--night); }
.dark .btn-primary:hover { background: #38bdf8; }
.btn-ghost { background: var(--ink); color: var(--ink); }
.btn-ghost::before {
  content: ""; position: absolute; inset: 1.5px; z-index: -1;
  background: var(--frost);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 11.4px), calc(100% - 11.4px) 100%, 0 100%);
  transition: background-color 0.2s var(--ease);
}
.btn-ghost:hover::before { background: var(--frost-2); }
.btn-ghost-dark { background: var(--on-dark-2); color: var(--on-dark); }
.btn-ghost-dark::before { background: var(--prussian); }
.btn-ghost-dark:hover::before { background: var(--prussian-2); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 0.9rem; --chamfer: 8px; }
.cta-note { margin-top: 16px; font-size: 0.74rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.cta-note code { font-size: 1em; }
.cta-note a { color: var(--deep); text-underline-offset: 3px; }

/* ---- the sheet: rulers, readout, pointer cell ------------------------------ */

.sheet {
  position: absolute; inset: 0; z-index: 40; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: var(--gut) 0;
}
.sheet-cell {
  position: absolute; left: 0; top: 0;
  width: var(--cell); height: var(--cell);
  border: 1.5px solid rgba(14, 165, 233, 0.6);
  background: rgba(14, 165, 233, 0.05);
  opacity: 0;
  transition: opacity 0.25s, background-color 0.3s, border-color 0.3s;
}
.sheet-cell.on { opacity: 1; }
.sheet-cell.hit { background: rgba(242, 199, 92, 0.35); border-color: var(--signal); transition: none; }
.ruler, .readout { display: none; }
@media (min-width: 1024px) {
  .ruler {
    display: block; position: fixed; z-index: 60;
    background: rgba(237, 245, 250, 0.94);
    font: 500 10px/1 var(--mono); font-stretch: 87.5%; color: #6b8aa0;
    pointer-events: none;
  }
  .ruler-x { top: 0; left: var(--gut); right: 0; height: var(--rx); border-bottom: 1px solid var(--alloy); }
  .ruler-y { top: 0; left: 0; bottom: 0; width: var(--gut); border-right: 1px solid var(--alloy); overflow: hidden; }
  .ruler-x::before { content: ""; position: fixed; left: 0; top: 0; width: var(--gut); height: var(--rx); background: var(--frost); border-right: 1px solid var(--alloy); border-bottom: 1px solid var(--alloy); z-index: 1; }
  .ruler span { position: absolute; display: grid; place-items: center; transition: color 0.15s, background-color 0.15s; }
  .ruler-x span { top: 0; height: 100%; width: var(--cell); border-left: 1px solid rgba(188, 211, 224, 0.6); }
  .ruler-y span { left: 0; width: 100%; height: var(--cell); top: 0; border-top: 1px solid rgba(188, 211, 224, 0.6); }
  .ruler span.on { color: var(--frost); background: var(--deep); }
  .readout {
    position: fixed; z-index: 60; left: calc(var(--gut) + 12px); bottom: 12px;
    padding: 6px 12px 6px 10px; background: var(--ink); color: var(--on-dark-2);
    font-size: 11px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
    pointer-events: none; opacity: 0; transition: opacity 0.3s;
  }
  .readout b { color: var(--signal); font-weight: 600; margin-left: 4px; }
  .has-pointer .readout { opacity: 1; display: block; }
}

/* ---- nav ----------------------------------------------------------------- */

.nav {
  position: fixed; z-index: 55; top: var(--rx); left: var(--gut); right: 0;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--pad);
  transition: background-color 0.3s, box-shadow 0.3s;
}
.nav.solid { background: rgba(237, 245, 250, 0.9); box-shadow: 0 1px 0 var(--alloy); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.15rem/1 var(--display); font-stretch: 112%; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; }
.nav-links { display: none; gap: 28px; font-size: 0.95rem; }
.nav-links a { text-decoration: none; color: var(--ink-2); padding: 6px 0; background: linear-gradient(var(--deep), var(--deep)) 0 100% / 0 2px no-repeat; transition: background-size 0.25s var(--ease), color 0.2s; }
.nav-links a:hover { color: var(--ink); background-size: 100% 2px; }
.nav-end { display: flex; align-items: center; gap: 10px; }
.lang select {
  appearance: none; -webkit-appearance: none;
  height: 34px; padding: 0 26px 0 10px;
  font: 500 0.7rem/1 var(--mono); font-stretch: 87.5%; color: var(--ink);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%230f2e44' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 9px center;
  border: 1px solid transparent; border-radius: 0; cursor: pointer;
}
.lang select:hover { border-color: var(--alloy); }
@media (min-width: 820px) { .nav-links { display: flex; } }

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

.hero {
  position: relative; overflow: hidden;
  min-height: 100svh;
  padding: calc(var(--rx) + var(--nav-h) + clamp(28px, 7vh, 80px)) 0 clamp(72px, 10vh, 120px);
  display: flex; flex-direction: column; justify-content: center;
}
.hero-grid { position: relative; }
.hero-letters {
  position: absolute; right: -4vw; top: 2vh; z-index: 0;
  display: flex; gap: 0.02em;
  font: 900 clamp(14rem, 34vw, 34rem)/0.8 var(--display); font-stretch: 125%;
  color: transparent; -webkit-text-stroke: 1.5px rgba(3, 105, 161, 0.09);
  pointer-events: none; user-select: none;
}
.hero-copy { position: relative; z-index: 2; }
.hero-title { position: relative; z-index: 2; font-size: clamp(2.6rem, 11.5vw, 4rem); font-stretch: var(--w, 112%); line-height: 0.94; letter-spacing: -0.025em; margin-bottom: clamp(22px, 3.2vw, 40px); }
@media (min-width: 640px) { .hero-title { font-size: clamp(2.4rem, 6.4vw, 7.4rem); font-stretch: var(--w, 125%); white-space: nowrap; } }
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hero-title .line > span { display: inline-block; }
.hero-lead { max-width: 46ch; margin-bottom: 30px; }
.hero-rest { position: relative; z-index: 2; }

.stage { position: relative; z-index: 1; width: min(100%, 480px); aspect-ratio: 1 / 0.95; margin: 44px auto 0; }
@media (min-width: 900px) {
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); column-gap: 4vw; }
  .hero-copy { display: contents; }
  .hero .eyebrow, .hero-title { grid-column: 1 / -1; }
  .hero-rest { grid-column: 1; grid-row: 3; align-self: start; }
  .stage { grid-column: 2; grid-row: 3; width: 100%; max-width: 640px; aspect-ratio: 5 / 4; margin: -1% 0 0 auto; }
}
.stage > * { position: absolute; }
.stage-plane { inset: 18% 4% 0 6%; perspective: 1100px; }
.plane {
  position: relative; width: 100%; aspect-ratio: 1;
  transform: rotateX(60deg) rotateZ(-38deg) translateY(-6%);
  transform-style: preserve-3d;
}
.plane-grid {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(3, 105, 161, 0.32) 1.5px, transparent 1.5px) 0 0 / calc(100% / 6) 100%,
    linear-gradient(to bottom, rgba(3, 105, 161, 0.32) 1.5px, transparent 1.5px) 0 0 / 100% calc(100% / 6),
    rgba(14, 165, 233, 0.07);
  outline: 1.5px solid rgba(3, 105, 161, 0.32);
}
.plane-l, .plane-n { position: absolute; font: 600 clamp(10px, 1.1vw, 15px)/1 var(--mono); color: var(--deep); transform: translate(-50%, -50%); }
.plane-l { left: calc((var(--c) + 0.5) * 100% / 6); top: -6%; }
.plane-n { top: calc((var(--r) + 0.5) * 100% / 6); left: -6%; }
.plane-hit { left: calc(100% / 3); top: 50%; width: calc(100% / 6); height: calc(100% / 6); background: var(--signal); opacity: 0.85; animation: hit 2.4s ease-in-out infinite; }
@keyframes hit { 50% { opacity: 0.35; } }

.stage-mark { left: 37%; top: 15%; width: 27%; aspect-ratio: 1; filter: drop-shadow(0 26px 30px rgba(3, 105, 161, 0.35)); }
.stage-mark svg { position: relative; width: 100%; height: 100%; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--sky); opacity: 0; animation: ring 3.6s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
.ring:nth-child(2) { animation-delay: 1.2s; }
.ring:nth-child(3) { animation-delay: 2.4s; }
@keyframes ring { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(1.9); opacity: 0; } }

.frag { filter: drop-shadow(0 18px 28px rgba(10, 37, 64, 0.17)); }
.frag-body { clip-path: var(--cut); --chamfer: 14px; padding: 14px 16px 16px; font-size: clamp(12px, 1.05vw, 14.5px); line-height: 1.45; }
.frag-bar { display: flex; align-items: center; gap: 6px; margin: -2px 0 10px; }
.frag-bar i { width: 8px; height: 8px; border-radius: 50%; background: rgba(230, 241, 248, 0.25); }
.frag-bar span { margin-left: 6px; font-size: 0.8em; opacity: 0.6; }
.frag-term { left: 0; top: 0; width: 47%; }
.frag-term .frag-body { background: var(--ink); color: var(--on-dark); }
.t-user { font-size: 0.86em; margin-bottom: 6px; }
.t-user b { color: var(--signal); }
.t-tool { font-size: 0.8em; color: var(--on-dark-2); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.t-tool span:last-child { color: var(--sky); }
.spin { width: 10px; height: 10px; border: 1.5px solid var(--sky); border-right-color: transparent; border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.frag-call { right: -3%; top: 47%; width: 43%; }
.frag-call .frag-body { background: var(--deep); color: #fff; }
.call-top { display: flex; align-items: center; gap: 8px; font-size: 0.74em; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.85; margin-bottom: 6px; }
.call-top svg { width: 13px; height: 13px; }
.call-quote { font-size: 1.02em; margin-bottom: 10px; }
.wave { display: flex; align-items: center; gap: 3px; height: 22px; }
.wave i { flex: 1; height: 100%; background: rgba(255, 255, 255, 0.85); transform-origin: center; animation: wave 1.1s ease-in-out infinite; }
.wave i:nth-child(3n) { animation-delay: -0.3s; }
.wave i:nth-child(3n + 1) { animation-delay: -0.62s; }
.wave i:nth-child(4n) { animation-duration: 0.8s; }
@keyframes wave { 0%, 100% { transform: scaleY(0.18); } 50% { transform: scaleY(1); } }
.frag-tg { left: 4%; bottom: -2%; width: 42%; }
.frag-tg .frag-body { background: var(--paper); color: var(--ink); }
.tg-top { display: flex; align-items: center; gap: 7px; font-size: 0.74em; color: var(--deep); margin-bottom: 4px; }
.tg-top svg { width: 13px; height: 13px; }
.tg-top span { margin-left: auto; color: var(--ink-2); }
.frag-mic { right: 2%; top: 3%; }
.frag-mic .frag-body { --chamfer: 8px; display: flex; align-items: center; gap: 8px; padding: 9px 14px 9px 11px; background: var(--paper); color: var(--ink); font-size: clamp(10px, 0.85vw, 12px); }
.frag-mic svg { width: 14px; height: 14px; color: var(--deep); }

.scroll-cue { position: absolute; left: calc(var(--gut) + var(--pad)); bottom: 22px; display: none; align-items: center; gap: 10px; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.scroll-cue i { width: 1.5px; height: 28px; background: linear-gradient(var(--deep) 50%, transparent 50%) 0 0 / 100% 200%; animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { to { background-position: 0 -100%; } }
@media (min-width: 900px) and (min-height: 700px) { .scroll-cue { display: flex; } }

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

section { position: relative; overflow-x: clip; }
.dark { background: var(--prussian); color: var(--on-dark); }

/* reach */
.reach { padding: clamp(96px, 14vh, 160px) 0; }
.reach-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px 6vw; }
@media (min-width: 900px) {
  .reach-head { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; }
  .reach-head .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
}
.reach-field { position: relative; margin: clamp(40px, 6vh, 72px) var(--pad) 0 calc(var(--gut) + var(--pad)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 600px) { .reach-field { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.reach-lines, .reach-core { display: none; }
.door {
  position: relative; padding: 22px 22px 26px;
  background: var(--paper); clip-path: var(--cut); --chamfer: 16px;
  box-shadow: inset 0 0 0 1px var(--alloy);
}
.door-ico { width: 40px; height: 40px; padding: 9px; margin-bottom: 16px; background: var(--ink); color: var(--frost); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%); }
.door h3 { font: 800 1.3rem/1.1 var(--display); font-stretch: 112%; margin-bottom: 8px; }
.door p { color: var(--ink-2); font-size: 0.98rem; }

@media (min-width: 900px) {
  .reach { padding: 0; }
  .reach-pin { min-height: 100svh; display: flex; flex-direction: column; padding: calc(var(--rx) + var(--nav-h) + 4vh) 0 4vh; }
  .reach-field { flex: 1; display: block; min-height: 400px; margin-top: 4vh; }
  .reach-lines { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .packet { pointer-events: none; }
  .reach-lines path { fill: none; stroke: var(--sky); stroke-width: 1.6; }
  .reach-core { display: block; position: absolute; inset: 0; margin: auto; width: clamp(96px, 10vw, 150px); height: clamp(96px, 10vw, 150px); filter: drop-shadow(0 20px 26px rgba(3, 105, 161, 0.35)); }
  .reach-core svg { width: 100%; height: 100%; }
  .door { position: absolute; width: min(30%, 340px); }
  .door-a { left: 0; top: 0; }
  .door-b { right: 0; top: 0; }
  .door-c { left: 0; bottom: 0; }
  .door-d { right: 0; bottom: 0; }
}

/* hands */
.hands { overflow: hidden; }
.hands-letters {
  position: absolute; right: -2vw; top: 4vh;
  font: 900 clamp(12rem, 30vw, 30rem)/0.8 var(--display); font-stretch: 125%;
  color: transparent; -webkit-text-stroke: 1.5px rgba(14, 165, 233, 0.16);
  pointer-events: none; user-select: none;
}
.hands-pin { min-height: 100svh; display: flex; align-items: center; padding: calc(var(--rx) + var(--nav-h) + 2vh) 0 4vh; }
.hands-grid { position: relative; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 900px) { .hands-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 5vw; align-items: center; } }
.hands .h2 { max-width: 15ch; font-size: clamp(2rem, 3.6vw + 0.3rem, 4.2rem); }
.hands .lead { margin: 20px 0 28px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 8px; padding: 12px 0; border-top: 1px solid rgba(164, 191, 210, 0.2); opacity: 0.72; transition: opacity 0.35s, box-shadow 0.35s; }
.step::before { content: attr(data-n); grid-row: 1 / 3; font: 600 0.8rem/1.6 var(--mono); color: var(--sky); }
.step code { justify-self: start; margin-bottom: 4px; background: none; padding: 0; color: var(--signal); font-size: 0.82rem; }
.step span { color: var(--on-dark-2); font-size: 0.96rem; }
.step.is-on { opacity: 1; box-shadow: inset 0 2px 0 var(--signal); }
.screen-wrap { position: relative; }
.screen {
  position: relative; container-type: inline-size;
  aspect-ratio: 16 / 10; overflow: hidden;
  background: #0d2742;
  clip-path: var(--cut); --chamfer: 18px;
  box-shadow: inset 0 0 0 1px rgba(164, 191, 210, 0.25);
}
.screen-canvas { position: absolute; inset: 0; transform-origin: 0 0; }
.app { position: absolute; inset: 0; }
.app > * { position: absolute; }
.app-bar { left: 0; right: 0; top: 0; height: 7%; display: flex; align-items: center; gap: 0.6cqw; padding: 0 1.4cqw; background: #12355a; }
.app-bar i { width: 0.9cqw; height: 0.9cqw; border-radius: 50%; background: rgba(230, 241, 248, 0.22); }
.app-bar span { margin-left: 1cqw; font-size: 1.1cqw; color: var(--on-dark-2); }
.app-side { left: 0; top: 7%; bottom: 0; width: 19%; padding: 2cqw 1.6cqw; display: grid; align-content: start; gap: 1.6cqw; background: #0b2440; }
.app-side b { display: block; height: 1.1cqw; background: rgba(164, 191, 210, 0.2); }
.app-side b:nth-child(2n) { width: 70%; }
.app-side b:nth-child(3) { background: rgba(14, 165, 233, 0.5); }
.app-main { left: 21%; right: 2%; top: 10%; height: 56%; }
.app-view { position: absolute; inset: 0 0 18% 0; background: linear-gradient(135deg, #1b4a78, #0e2c4d 60%), #123; }
.app-view::after { content: ""; position: absolute; left: 36%; top: 26%; width: 22%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #7dd3fc, #0ea5e9 45%, #0369a1); opacity: 0.8; }
.app-track { position: absolute; left: 0; right: 0; bottom: 0; height: 14%; display: flex; gap: 0.6cqw; }
.app-track i { flex: 1; background: rgba(14, 165, 233, 0.28); }
.app-track i:nth-child(2) { flex: 2.4; background: rgba(125, 211, 252, 0.4); }
.app-foot { left: 21%; right: 2%; top: 69%; height: 7%; display: flex; align-items: center; background: #0f3054; padding: 0 1.2cqw; }
.app-foot span:first-child { font-size: 1cqw; color: var(--on-dark-2); }
.app-btn, .app-export { position: absolute; top: 70.8%; height: 3.4%; display: grid; place-items: center; font-size: 0.85cqw; font-family: var(--mono); color: var(--on-dark); background: #1d4f80; }
.app-export { left: 39.2%; width: 6%; background: var(--deep); color: #fff; transition: background-color 0.2s; }
.app-export.done { background: var(--signal); color: var(--ink); }
.app-btn.b1 { left: 33.3%; width: 4.6%; }
.app-btn.b2 { left: 46%; width: 3.6%; }
.vgrid {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(242, 199, 92, 0.55) 1px, transparent 1px) 0 0 / 12.5% 100%,
    linear-gradient(to bottom, rgba(242, 199, 92, 0.55) 1px, transparent 1px) 0 0 / 100% 20%;
}
.vgrid-labels { position: absolute; inset: 0; font-size: 1.6cqw; }
.vgrid-labels span { position: absolute; padding: 0.25cqw 0.5cqw; background: var(--signal); color: var(--ink); line-height: 1; font-weight: 600; }
.vcell { position: absolute; left: 37.5%; top: 60%; width: 12.5%; height: 20%; box-shadow: inset 0 0 0 0.35cqw var(--signal); background: rgba(242, 199, 92, 0.14); }
.subgrid {
  position: absolute; left: 37.5%; top: 60%; width: 12.5%; height: 20%;
  background:
    linear-gradient(to right, rgba(14, 165, 233, 0.9) 0.08cqw, transparent 0.08cqw) 0 0 / 25% 100%,
    linear-gradient(to bottom, rgba(14, 165, 233, 0.9) 0.08cqw, transparent 0.08cqw) 0 0 / 100% 25%;
  opacity: 0;
}
.subgrid span { position: absolute; font: 600 0.46cqw/1 var(--mono); padding: 0.07cqw 0.14cqw; background: var(--sky); color: var(--night); }
.subgrid .tgt { position: absolute; left: 25%; top: 50%; width: 25%; height: 25%; box-shadow: inset 0 0 0 0.12cqw var(--signal); background: rgba(242, 199, 92, 0.2); padding: 0; }
.cursor { position: absolute; left: 72%; top: 24%; width: 3.2cqw; z-index: 3; filter: drop-shadow(0 0.4cqw 0.6cqw rgba(0, 0, 0, 0.4)); }
.cursor svg { width: 100%; fill: var(--signal); stroke: var(--ink); stroke-width: 1.4; }
.click { position: absolute; left: -2.2cqw; top: -2.2cqw; width: 4.4cqw; height: 4.4cqw; border-radius: 50%; border: 0.35cqw solid var(--signal); opacity: 0; }
.screen-say { position: absolute; left: 2.4cqw; bottom: 2.4cqw; z-index: 4; padding: 0.9cqw 1.4cqw; background: var(--paper); color: var(--ink); font-size: max(10px, 1.45cqw); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%); }
.say { display: block; }
.screen-tool { margin-top: 14px; font-size: 0.78rem; color: var(--on-dark-2); }
.screen-tool span { color: var(--signal); }
.hands-after { padding: 0 0 clamp(80px, 12vh, 140px); }
.hands-after p { max-width: 62ch; color: var(--on-dark-2); font-size: 1.05rem; border-top: 1px solid rgba(164, 191, 210, 0.2); padding-top: 24px; }
.hands-after b { color: var(--on-dark); }
@media (min-width: 900px) and (max-height: 820px) {
  .hands .h2 { font-size: clamp(2rem, 3vw, 3rem); }
  .hands .lead { font-size: 1rem; margin: 14px 0 16px; }
  .step { padding: 8px 0; }
  .step span { font-size: 0.9rem; }
}
@media (max-width: 899px) {
  .hands-pin { align-items: flex-start; }
  .hands .lead { font-size: 1rem; margin: 14px 0 0; }
  .hands .h2 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .steps { margin-top: 18px; }
  .step { display: none; }
  .step.is-on { display: grid; }
}

/* work */
.work { padding: clamp(96px, 16vh, 200px) 0 clamp(80px, 12vh, 160px); }
.work-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; }
@media (min-width: 960px) { .work-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6vw; align-items: start; } .work-copy { position: sticky; top: calc(var(--rx) + var(--nav-h) + 6vh); } }
.work .lead { margin: 22px 0 30px; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 54ch; }
.facts li { position: relative; padding-left: 26px; color: var(--ink-2); }
.facts li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 12px; height: 12px; background: var(--deep); clip-path: polygon(0 0, 100% 0, 100% 55%, 55% 100%, 0 100%); }
.facts b { color: var(--ink); font-weight: 700; }
.thread { display: grid; gap: 14px; font-size: 1rem; padding-top: 8px; }
.msg { max-width: 86%; padding: 14px 18px; clip-path: var(--cut); --chamfer: 12px; line-height: 1.45; }
.msg-you { justify-self: end; background: var(--ink); color: var(--on-dark); }
.msg-bot { justify-self: start; background: var(--paper); box-shadow: inset 0 0 0 1px var(--alloy); }
.msg .tag { display: block; font-size: 0.7rem; color: var(--deep); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.msg-steer { background: var(--signal); color: var(--ink); }
.msg-steer .tag { color: var(--ink); opacity: 0.7; }
.msg-note { justify-self: start; background: none; padding: 4px 0; font-size: 0.8rem; color: var(--ink-2); font-style: normal; }
.msg-note::before { content: "● "; color: var(--sky); }
.lane { display: flex; gap: 8px; overflow: hidden; padding: 10px 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.chip { flex: none; padding: 7px 11px; font-size: 0.72rem; background: var(--frost-2); color: var(--deep); box-shadow: inset 0 0 0 1px var(--alloy); }
.chip-steer { background: var(--signal); color: var(--ink); box-shadow: none; }
.chip-done { background: var(--deep); color: #fff; box-shadow: none; }
.notify { justify-self: end; width: min(100%, 380px); margin-top: 18px; padding: 16px 18px; background: var(--deep); color: #fff; clip-path: var(--cut); --chamfer: 14px; }
.notify-top { display: flex; align-items: center; gap: 8px; font-size: 0.72rem; opacity: 0.85; margin-bottom: 4px; }
.notify-top svg { width: 13px; height: 13px; }
.notify-top span { margin-left: auto; }

/* memory */
.memory { padding: clamp(80px, 12vh, 140px) 0 clamp(80px, 12vh, 150px); background: linear-gradient(var(--frost), var(--frost-2)); }
.memory-pin { min-height: 100svh; display: flex; flex-direction: column; padding-top: calc(var(--rx) + var(--nav-h)); }
.memory-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px 6vw; }
@media (min-width: 900px) { .memory-head { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: end; } .memory-head .eyebrow { grid-column: 1 / -1; margin-bottom: 0; } }
.mem-field { position: relative; flex: 1; min-height: 340px; margin: 4vh var(--pad) 0 calc(var(--gut) + var(--pad)); }
.mem-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mem-lines path { fill: none; stroke: var(--deep); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.m {
  position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%);
  translate: -50% -50%;
  padding: 8px 12px; white-space: nowrap;
  font: 500 clamp(0.66rem, 0.95vw, 0.82rem)/1.2 var(--mono); font-stretch: 87.5%;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
}
.m-keep { background: var(--ink); color: var(--frost); }
.m-rule { background: var(--signal); color: var(--ink); white-space: normal; max-width: 24ch; }
.m-drop { background: var(--paper); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--alloy); }
@media (max-width: 640px) {
  .m { left: calc(var(--mx) * 1%); top: calc(var(--my) * 1%); font-size: 0.66rem; padding: 7px 10px; }
  .m-rule { max-width: 21ch; }
  .m-drop:nth-of-type(9), .m-drop:nth-of-type(11), .m-drop:nth-of-type(12), .m-drop:nth-of-type(14) { display: none; }
  .mem-field { margin-left: 16px; margin-right: 16px; min-height: 380px; }
}
.skill { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: clamp(64px, 10vh, 120px); }
@media (min-width: 900px) { .skill { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6vw; align-items: center; } }
.skill-copy p { margin-top: 18px; color: var(--ink-2); max-width: 52ch; }
.skill-card { margin: 0; padding: 22px 24px 26px; background: var(--ink); color: var(--on-dark); font-size: clamp(0.72rem, 0.9vw, 0.86rem); line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; clip-path: var(--cut); --chamfer: 18px; }
.sk-path { display: block; margin-bottom: 12px; color: var(--sky); }
.sk-l { display: block; min-height: 1.75em; }

/* room */
.room { overflow: hidden; background: radial-gradient(120% 90% at 80% 20%, var(--prussian-2), var(--prussian) 55%, var(--night)); }
.room-pin { min-height: 100svh; display: flex; align-items: center; padding: calc(var(--rx) + var(--nav-h) + 2vh) 0 6vh; }
.room-grid { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
@media (min-width: 900px) { .room-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 6vw; align-items: center; } }
.room .lead { margin: 20px 0 18px; }
.room-stage { position: relative; display: grid; gap: 14px; }
.room-status { position: relative; justify-self: start; display: inline-grid; align-items: center; grid-template-columns: auto 1fr; gap: 10px; padding: 8px 14px 8px 12px; background: rgba(230, 241, 248, 0.08); box-shadow: inset 0 0 0 1px rgba(164, 191, 210, 0.3); font-size: 0.78rem; }
.room-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2); }
.room-status .st { grid-column: 2; grid-row: 1; }
.st-shared { opacity: 0; color: var(--signal); }
.voice { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px 16px; background: rgba(230, 241, 248, 0.05); box-shadow: inset 0 0 0 1px rgba(164, 191, 210, 0.16); }
.who { font-size: 0.74rem; color: var(--on-dark-2); }
.bars { display: flex; align-items: center; gap: 2px; height: 46px; }
.bars i { flex: 1; height: 100%; background: var(--sky); transform-origin: center; transform: scaleY(var(--h, 0.2)); }
.voice-guest .bars i { background: var(--signal); }
.voice.speaking .bars i { animation: talk 0.9s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes talk { from { transform: scaleY(var(--h, 0.2)); } to { transform: scaleY(calc(var(--h, 0.2) * 0.35)); } }
.room-say { justify-self: end; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--paper); color: var(--ink); font-weight: 700; clip-path: var(--cut); }
.room-say svg { width: 18px; height: 18px; color: var(--deep); }
.spaces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.space { position: relative; padding: 16px; min-height: 92px; display: grid; align-content: space-between; gap: 10px; font-size: 0.9rem; clip-path: var(--cut); }
.space small { font-size: 0.68rem; color: inherit; opacity: 0.75; }
.space-main { background: var(--sky); color: var(--night); }
.space-shared { background: rgba(230, 241, 248, 0.1); color: var(--on-dark); box-shadow: inset 0 0 0 1px rgba(164, 191, 210, 0.3); }
.room.is-shared .space-shared { background: var(--signal); color: var(--ink); }
@media (max-width: 899px) { .room-pin { align-items: flex-start; } .room .lead { font-size: 1rem; margin-bottom: 12px; } .room .fine { font-size: 0.82rem; } .voice { grid-template-columns: 64px minmax(0, 1fr); padding: 10px 14px; } .bars { height: 30px; } .space { min-height: 76px; } }
@media (max-width: 899px) and (max-height: 760px) { .hands .lead, .room .fine { display: none; } }

/* honest */
.honest { padding: clamp(110px, 16vh, 200px) 0 clamp(90px, 12vh, 150px); }
.honest .h2 { max-width: 14ch; margin-bottom: clamp(40px, 7vh, 80px); }
.ledger { display: grid; }
.row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 6vw; padding: 26px 0; border-top: 1.5px solid var(--ink); align-items: start; }
@media (min-width: 760px) { .row { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); padding: 34px 0; } }
.fig { font-size: clamp(3.6rem, 9vw, 9.5rem); font-stretch: 125%; line-height: 0.85; color: var(--deep); white-space: nowrap; }
.row h3 { font: 800 clamp(1.3rem, 1.7vw, 1.75rem)/1.1 var(--display); font-stretch: 108%; margin-bottom: 8px; }
.row p:not(.fig) { color: var(--ink-2); max-width: 54ch; }
.row-rails .fig { color: var(--ink); }
.row-rails .fig::after { content: ""; display: inline-block; width: 0.2em; height: 0.2em; margin-left: 0.12em; background: var(--signal); vertical-align: baseline; }
.proof { margin-top: 28px; padding: 14px 16px; background: var(--ink); color: var(--on-dark); font-size: 0.78rem; clip-path: var(--cut); }
.proof:empty { display: none; }
.proof b { color: var(--signal); font-weight: 600; }

/* install */
.install { padding: clamp(100px, 15vh, 180px) 0 0; overflow: hidden; }
.install-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
@media (min-width: 960px) { .install-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 5vw; align-items: start; } }
.install .lead { margin: 20px 0 32px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(164, 191, 210, 0.25); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; padding: 12px 16px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--on-dark-2); font: 600 0.95rem/1 var(--body); cursor: pointer; min-height: 44px; }
.tabs button:hover { color: var(--on-dark); }
.tabs button[aria-selected="true"] { color: var(--on-dark); border-bottom-color: var(--sky); }
.code { position: relative; }
.code pre { margin: 0; padding: 18px 56px 18px 18px; background: var(--night); color: var(--on-dark); font-size: clamp(0.7rem, 0.82vw, 0.82rem); line-height: 1.85; white-space: pre; overflow-x: auto; scrollbar-width: thin; clip-path: var(--cut); box-shadow: inset 0 0 0 1px rgba(164, 191, 210, 0.16); }
.code pre code { background: none; padding: 0; font-size: 1em; }
@media (max-width: 640px) { .code pre { white-space: pre-wrap; word-break: break-all; } }
.copy { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; display: grid; place-items: center; background: rgba(230, 241, 248, 0.08); border: 0; color: var(--on-dark); cursor: pointer; }
.copy:hover { background: rgba(230, 241, 248, 0.16); }
.copy svg { width: 17px; height: 17px; }
.copy.ok { color: var(--signal); }
.alt { margin-top: 14px; font-size: 0.78rem; color: var(--on-dark-2); }
.alt a { color: var(--sky); text-underline-offset: 3px; }
.pane .alt:not(.mono) { font: 400 0.98rem/1.55 var(--body); max-width: 52ch; }
.wizard { background: var(--night); padding: 18px 20px 22px; clip-path: var(--cut); --chamfer: 18px; box-shadow: inset 0 0 0 1px rgba(164, 191, 210, 0.16); }
.wz { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 10px; font-size: clamp(0.7rem, 0.82vw, 0.82rem); }
.wz li { display: grid; grid-template-columns: 18px 88px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.wz b { color: var(--on-dark); font-weight: 600; }
.wz li > span:last-child { color: var(--on-dark-2); }
.ok { width: 12px; height: 12px; align-self: center; background: var(--sky); clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.wz-done { font-size: clamp(0.74rem, 0.9vw, 0.86rem); color: var(--on-dark); padding-top: 12px; border-top: 1px solid rgba(164, 191, 210, 0.16); }
.wz-done b { color: var(--signal); }
.caret { display: inline-block; width: 0.55em; height: 1.1em; margin-left: 4px; vertical-align: -0.2em; background: var(--signal); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.final { position: relative; display: grid; justify-items: center; text-align: center; gap: 22px; padding: clamp(110px, 18vh, 220px) 0 clamp(100px, 16vh, 180px); }
.final-mark { width: clamp(72px, 8vw, 110px); height: auto; filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.35)); }
.final-line { font-size: clamp(2.6rem, 8vw, 8.6rem); font-stretch: 125%; letter-spacing: -0.03em; line-height: 0.9; }
.final .cta { justify-content: center; margin-top: 12px; }

/* footer */
.foot { background: var(--night); color: var(--on-dark-2); padding: 36px 0 calc(36px + env(safe-area-inset-bottom)); position: relative; z-index: 41; }
.foot-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 32px; }
.foot .brand { color: var(--on-dark); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 0.92rem; }
.foot-links a { text-decoration: none; padding: 8px 0; }
.foot-links a:hover { color: var(--on-dark); text-decoration: underline; text-underline-offset: 4px; }
.foot-legal { margin-left: auto; font-size: 0.7rem; }
@media (max-width: 700px) { .foot-legal { margin-left: 0; width: 100%; } }

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

/* Hidden only until main.js takes over; the head script lifts this after
   three seconds whatever happens, so a failed script never hides the page. */
.pending .hero-title .line > span, .pending .hero-rest, .pending .hero .eyebrow, .pending .stage { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .ring, .scroll-cue { display: none; }
  .step { display: grid !important; opacity: 1; }
  .wave i { transform: scaleY(0.6); }
}
