/* Keyscribe v4: deep-tech "mission console" look */
@font-face { font-family: "Manrope"; src: url("/fonts/manrope-var.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-var.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --void: #07061A;
  --deep: #0E0C2A;
  --panel: #13113A;
  --panel-2: #1A1750;
  --line: rgba(165, 180, 252, .16);
  --line-strong: rgba(165, 180, 252, .34);
  --brand: #4F46E5;
  --tint: #A5B4FC;
  --node: #5EEAD4;
  --warn: #C4B5FD;
  --ink: #F3F4FB;
  --ink-muted: #A3A8C3;
  --ink-faint: #6E7299;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --wrap: 1200px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--void); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
mark { background: none; color: inherit; }
:focus-visible { outline: 2px solid var(--node); outline-offset: 3px; }
em, .it { font-style: normal; font-weight: 800; color: var(--tint); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; }

.label { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; }
.label b { color: var(--node); font-weight: 500; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(7, 6, 26, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.brand-link img { height: 30px; width: auto; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { text-decoration: none; font-family: var(--mono); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.nav a:hover { color: var(--ink); }
@media (max-width: 820px) { .nav .nav-link { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 22px; font-family: var(--mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; text-decoration: none; white-space: nowrap; border: 1px solid transparent; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); transition: background .2s ease, color .2s ease; }
.btn-primary { background: var(--node); color: var(--void); }
.btn-primary:hover { background: #fff; }
.btn-ghost { background: rgba(165, 180, 252, .08); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: rgba(165, 180, 252, .16); }
.nav .btn { min-height: 40px; padding: 0 16px; color: var(--void); }
@media (max-width: 480px) { .nav .btn { padding: 0 12px; font-size: 11.5px; } .brand-link img { height: 26px; } }

/* Corner brackets for HUD frames */
.hud { position: relative; }
.hud::before, .hud::after { content: ""; position: absolute; width: 18px; height: 18px; border: 1px solid var(--node); pointer-events: none; }
.hud::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.hud::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: 72px 0 40px; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 64px 64px; mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 75%); opacity: .55; pointer-events: none; }
.hero::after { content: ""; position: absolute; left: 50%; top: 38%; width: 900px; height: 520px; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(79, 70, 229, .32), transparent); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.hero h1 { margin: 12px 0 0; font-weight: 800; font-size: clamp(64px, 11vw, 150px); line-height: .9; letter-spacing: -.01em; color: var(--ink); }
.hero .sub { margin: 14px 0 0; font-size: clamp(20px, 2.4vw, 28px); font-weight: 600; letter-spacing: -.01em; }
.hero-side { max-width: 400px; }
.hero-side p { margin: 0 0 22px; color: var(--ink-muted); font-size: 16.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Console */
.console { margin-top: 48px; background: linear-gradient(180deg, rgba(19, 17, 58, .92), rgba(14, 12, 42, .92)); border: 1px solid var(--line-strong); }
.console-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: 8px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--node); box-shadow: 0 0 0 0 rgba(94, 234, 212, .6); }
.console-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 210px; }
.pane { padding: 22px 22px 24px; border-right: 1px solid var(--line); min-width: 0; }
.pane:last-child { border-right: 0; }
.pane .label { display: block; margin-bottom: 14px; }
.transcript > .label { margin-bottom: 26px; }

/* Transcript pane with scan line */
.transcript { position: relative; overflow: hidden; }
.line { margin: 0 0 22px; font-size: 15px; line-height: 1.65; color: var(--ink-muted); }
.line .who { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; color: var(--ink-faint); margin-right: 8px; text-transform: uppercase; }
.line mark { position: relative; color: var(--ink); padding: 0 3px; margin: 0 -1px; outline: 1px solid transparent; }
.line mark.hit { background: rgba(94, 234, 212, .12); outline-color: rgba(94, 234, 212, .55); }
.line mark.gap { background: rgba(196, 181, 253, .12); outline: 1px dashed rgba(196, 181, 253, .7); }
.line mark::after { content: attr(data-tag); position: absolute; left: -1px; bottom: calc(100% + 3px); font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; line-height: 1; padding: 3px 5px; white-space: nowrap; background: var(--node); color: var(--void); }
.line mark.gap::after { background: var(--warn); }
.scan { position: absolute; left: 0; right: 0; top: 0; height: 64px; background: linear-gradient(180deg, transparent, rgba(94, 234, 212, .10) 70%, rgba(94, 234, 212, .7) 98%, transparent); pointer-events: none; opacity: 0; }

/* Spec pane */
.spec { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 14px; font-size: 14px; }
.spec dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); padding-top: 2px; }
.spec dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.spec dd.open { color: var(--warn); font-weight: 500; }
.followup { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line); background: rgba(196, 181, 253, .06); font-size: 13.5px; color: var(--ink-muted); }
.followup strong { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--warn); font-weight: 500; margin-bottom: 4px; }

/* Telemetry pane */
.telemetry { display: grid; gap: 16px; align-content: start; }
.meter .val { display: block; font-family: var(--mono); font-size: 30px; font-weight: 500; line-height: 1.1; color: var(--ink); }
.meter .val small { font-size: 14px; color: var(--ink-faint); }
.meter .val.ok { color: var(--node); }
.meter .val.warn { color: var(--warn); }
.bar { height: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 85%; background: var(--node); transform-origin: left; }

/* Hero motion */
@media (prefers-reduced-motion: no-preference) {
  .scan { animation: scan 4.8s cubic-bezier(.45, 0, .55, 1) 0.6s infinite; }
  .line mark { animation: lock .5s ease-out both; }
  .line mark::after { animation: tagin .4s ease-out both; }
  .m1, .m1::after { animation-delay: .9s; } .m2, .m2::after { animation-delay: 1.3s; }
  .m3, .m3::after { animation-delay: 1.7s; } .m4, .m4::after { animation-delay: 2.1s; }
  .m5, .m5::after { animation-delay: 2.5s; } .m6, .m6::after { animation-delay: 2.9s; }
  .spec > * { animation: fadein .5s ease-out both; }
  .spec > :nth-child(-n+2) { animation-delay: 1.1s; } .spec > :nth-child(n+3):nth-child(-n+4) { animation-delay: 1.5s; }
  .spec > :nth-child(n+5):nth-child(-n+6) { animation-delay: 1.9s; } .spec > :nth-child(n+7):nth-child(-n+8) { animation-delay: 2.3s; }
  .spec > :nth-child(n+9):nth-child(-n+10) { animation-delay: 2.7s; } .spec > :nth-child(n+11) { animation-delay: 3.1s; }
  .followup { animation: fadein .6s ease-out 3.5s both; }
  .bar span { animation: fill 2.6s cubic-bezier(.2, .7, .2, 1) .8s both; }
  .live i { animation: ping 2s ease-out infinite; }
  .blink { animation: blink 1.1s steps(1) infinite; }
}
@keyframes scan { 0% { transform: translateY(-64px); opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(380px); opacity: 0; } }
@keyframes lock { 0% { outline-color: transparent; background: transparent; color: inherit; } 40% { outline-color: #fff; } }
@keyframes tagin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(94, 234, 212, .6); } 80%, 100% { box-shadow: 0 0 0 9px rgba(94, 234, 212, 0); } }
@keyframes blink { 50% { opacity: 0; } }

.hero-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 16px; }

@media (max-width: 1020px) {
  .console-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .telemetry { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .console-body { grid-template-columns: minmax(0, 1fr); }
  .pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .telemetry { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .meter .val { font-size: 22px; }
  .hero { padding-top: 48px; }
}

/* ===== Sections ===== */
.section { padding: 112px 0; border-bottom: 1px solid var(--line); position: relative; }
.statement { font-size: clamp(28px, 3.8vw, 48px); line-height: 1.18; font-weight: 600; letter-spacing: -.02em; max-width: 1000px; margin: 18px 0 0; }
.statement em { font-size: 1em; }
h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.15; letter-spacing: -.02em; font-weight: 600; margin: 14px 0 18px; }
.intro { color: var(--ink-muted); max-width: 40em; margin: 0; font-size: 18px; }

/* Capability cards */
.caps { margin-top: 64px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cap { background: var(--void); padding: 28px 26px 30px; text-decoration: none; display: flex; flex-direction: column; gap: 12px; min-height: 250px; transition: background .25s ease; position: relative; }
.cap:hover { background: var(--deep); }
.cap-top { display: flex; justify-content: space-between; align-items: center; }
.status { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border: 1px solid currentColor; }
.status.now { color: var(--node); }
.status.next { color: var(--warn); }
.cap svg { width: 44px; height: 44px; margin: 8px 0 4px; }
.cap svg .s { fill: none; stroke: var(--tint); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cap svg .n { fill: var(--node); }
.cap h3 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.cap p { margin: 0; color: var(--ink-muted); font-size: 15px; }
.cap .go { margin-top: auto; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); transition: color .2s ease; }
.cap:hover .go { color: var(--node); }
@media (max-width: 900px) { .caps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .caps { grid-template-columns: minmax(0, 1fr); } .cap { min-height: 0; } }

/* Loop diagram */
.loop-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.loop { width: 100%; max-width: 520px; margin: 0 auto; }
.loop .ring { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 7; }
.loop .ring2 { fill: none; stroke: var(--line); stroke-width: 1; }
.loop .stop rect { fill: var(--panel); stroke: var(--line-strong); }
.loop .stop text { fill: var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.loop .stop text.k { fill: var(--node); font-size: 10px; }
.loop .core rect { fill: var(--brand); }
.loop .core line { stroke: #fff; stroke-width: 6; stroke-linecap: round; }
.loop .core circle { fill: var(--node); }
.loop .orbit { fill: var(--node); }
.loop .tick { stroke: var(--line-strong); }
.steps { list-style: none; margin: 32px 0 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: 15.5px; }
.steps li::before { content: "0" counter(s); font-family: var(--mono); font-size: 12.5px; color: var(--node); padding-top: 3px; }
.steps strong { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .loop .spin { animation: spin 40s linear infinite; transform-origin: 260px 260px; }
  .loop .core { animation: breathe 4s ease-in-out infinite; transform-origin: 32px 32px; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.04); } }
@media (max-width: 900px) { .loop-wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

/* Config as code */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 64px; align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); gap: 36px; } }
.prose p { color: var(--ink-muted); margin: 0 0 16px; }
.prose p strong { color: var(--ink); }
.codepanel { background: var(--deep); border: 1px solid var(--line-strong); }
.codepanel .console-bar { padding: 10px 16px; }
pre.code { margin: 0; padding: 22px 24px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.75; color: #E7E9FB; }
pre.code .c { color: var(--ink-faint); }
pre.code .k { color: var(--tint); }
pre.code .s { color: var(--node); }
pre.code .g { color: var(--warn); }
.caption { margin-top: 10px; font-size: 13px; color: var(--ink-faint); font-family: var(--mono); letter-spacing: .04em; }

/* Security readouts */
.readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 56px; }
.readout { background: var(--void); padding: 26px 24px; }
.readout .big { display: block; font-family: var(--mono); font-size: 34px; font-weight: 500; color: var(--node); line-height: 1.1; margin: 10px 0 10px; }
.readout p { margin: 0; color: var(--ink-muted); font-size: 14.5px; }
.readout p strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
@media (max-width: 900px) { .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .readouts { grid-template-columns: minmax(0, 1fr); } }

/* CTA */
.cta { padding: 120px 0; position: relative; overflow: hidden; text-align: center; }
.cta::before { content: ""; position: absolute; left: 50%; top: 50%; width: 1100px; height: 600px; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(79, 70, 229, .35), transparent); }
.cta .wrap { position: relative; }
.cta h2 { font-size: clamp(36px, 5.4vw, 72px); line-height: 1.05; margin: 16px auto 22px; max-width: 900px; }
.cta p { color: var(--ink-muted); max-width: 36em; margin: 0 auto 32px; font-size: 18px; }
.cta .actions { justify-content: center; }
.cta .mail { display: block; margin-top: 22px; font-family: var(--mono); font-size: 13px; color: var(--ink-faint); }
.cta .mail a { color: var(--ink-muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 13.5px; color: var(--ink-faint); }
.foot-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 22px; }
.foot-links a { text-decoration: none; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.foot-links a:hover { color: var(--ink); }
.legal { margin: 0; max-width: 62em; }

/* Plain pages */
.doc { padding: 72px 0 96px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-weight: 800; font-size: 56px; line-height: 1; margin: 0 0 16px; }
.doc h2 { font-size: 22px; margin-top: 40px; }
.doc p, .doc li { color: var(--ink-muted); }
.telemetry > .label { grid-column: 1 / -1; margin-bottom: 0; }
@media (max-width: 720px) {
  .line .who { display: block; margin: 0 0 16px; }
  .line { margin-bottom: 18px; }
  .hero-side .actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* Hero name in the brand typeface, matching the logo wordmark */
.hero h1 { font-family: var(--sans); font-style: normal; font-weight: 800; font-size: clamp(56px, 10vw, 136px); line-height: .92; letter-spacing: -.045em; margin-top: 16px; }
.doc h1 { font-family: var(--sans); font-style: normal; font-weight: 800; font-size: 44px; letter-spacing: -.03em; }
