/* Quantum Link Research — "deep space" design system for the landing page and the Mars simulator.
   Techniques inspired by react-bits, Magic UI, Animate UI and motion-primitives (aurora gradients, spotlight cards,
   bento grids, number tickers, blur-in reveals), re-implemented in plain CSS and JavaScript; see CREDITS.md. */
:root {
  --bg: #05070d; --bg2: #0a0f1c; --ink: #e8eef8; --muted: #93a1b8; --faint: #5b6780;
  --line: rgba(148, 170, 210, .14); --glass: rgba(17, 24, 42, .62);
  --blue: #5ea8ff; --cyan: #5ef2e0; --green: #45e0a0; --warm: #ff8a4c; --mars: #ff6b4a; --violet: #a78bfa;
  --radius: 18px; --maxw: 1200px;
  --grad: linear-gradient(92deg, #5ea8ff 0%, #5ef2e0 35%, #a78bfa 70%, #ff8a4c 100%);
  color-scheme: dark;
}
* { box-sizing: border-box }
html { scroll-behavior: smooth; scroll-padding-top: 72px }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; overflow-x: hidden }
a { color: var(--cyan); text-decoration: none } a:hover { text-decoration: underline }
code, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em }
.aurora { position: fixed; inset: -20vmax; z-index: -2; pointer-events: none; filter: blur(80px) saturate(140%); opacity: .45;
  background: radial-gradient(40vmax 30vmax at 20% 10%, rgba(94,168,255,.35), transparent 60%),
              radial-gradient(35vmax 25vmax at 80% 20%, rgba(167,139,250,.28), transparent 60%),
              radial-gradient(40vmax 30vmax at 60% 90%, rgba(255,107,74,.18), transparent 60%);
  animation: drift 28s ease-in-out infinite alternate }
@keyframes drift { to { transform: translate3d(4vmax, -3vmax, 0) rotate(8deg) } }
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 4vw; background: rgba(5,7,13,.55); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line) }
.brand { font-weight: 700; letter-spacing: .3px; color: var(--ink); display: flex; gap: .55rem; align-items: center; white-space: nowrap }
.brand:hover { text-decoration: none }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 14px var(--cyan) }
.top nav { display: flex; align-items: center; flex-wrap: nowrap } .top nav a { margin-left: .85rem; font-size: .86rem; color: var(--muted); white-space: nowrap } .top nav a:hover { color: var(--ink); text-decoration: none }
.top nav a.gh { padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink) }
.hero { position: relative; min-height: 100vh; display: grid; place-items: center; overflow: hidden }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block }
.hero-inner { position: relative; z-index: 2; max-width: 920px; padding: 6rem 6vw 11rem; text-align: center; pointer-events: none }
.hero-inner > * { pointer-events: auto }
.eyebrow { display: inline-flex; gap: .5rem; align-items: center; padding: .3rem .9rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--glass); font-size: .78rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase }
.eyebrow b { color: var(--green) }
h1.title { font-size: clamp(2.1rem, 4.4vw, 3.7rem); text-shadow: 0 2px 30px rgba(5,7,13,.9); line-height: 1.05; margin: 1.1rem 0 1rem; letter-spacing: -.02em; font-weight: 800 }
.gradient-text { background: var(--grad); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 8s linear infinite }
.title .gradient-text { text-shadow: none; filter: drop-shadow(0 2px 18px rgba(5,7,13,.8)) }
@keyframes shine { to { background-position: 200% center } }
.lede { color: #b5c1d6; text-shadow: 0 1px 12px rgba(5,7,13,.95); font-size: 1.12rem; max-width: 60ch; margin: 0 auto }
.cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin: 1.8rem 0 0 }
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem 1.25rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1px solid var(--line); background: var(--glass); color: var(--ink); backdrop-filter: blur(8px); transition: transform .15s, box-shadow .2s }
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 30px rgba(94,168,255,.25) }
.btn.primary { background: linear-gradient(92deg, #3b82f6, #22d3ee); border-color: transparent; color: #04111f }
.live { position: absolute; z-index: 2; left: 50%; bottom: 2rem; transform: translateX(-50%); display: flex; gap: 1.2rem; flex-wrap: nowrap; white-space: nowrap; justify-content: center;
  padding: .7rem 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); backdrop-filter: blur(10px); font-size: .85rem; color: var(--muted) }
.live b { color: var(--ink); font-variant-numeric: tabular-nums } .live .warm { color: var(--warm) } .live .ok { color: var(--green) }
section.band { max-width: var(--maxw); margin: 0 auto; padding: 6rem 5vw 3rem }
.kicker { color: var(--cyan); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700 }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.15; margin: .4rem 0 .8rem; letter-spacing: -.01em }
.sub { color: var(--muted); max-width: 70ch; margin: 0 0 2rem }
.tickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem }
.tick { padding: 1.2rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass) }
.tick .n { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em }
.tick .u { font-size: .95rem; color: var(--muted); margin-left: .25rem; font-weight: 600 }
.tick .l { color: var(--muted); font-size: .85rem; margin-top: .25rem }
.tick.warm .n { color: var(--warm) } .tick.green .n { color: var(--green) } .tick.blue .n { color: var(--blue) } .tick.violet .n { color: var(--violet) }
.card { position: relative; display: block; overflow: hidden; padding: 1.4rem 1.4rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass);
  color: var(--ink); transition: transform .2s, border-color .2s; --x: 50%; --y: 50% }
.card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(420px circle at var(--x) var(--y), rgba(94,242,224,.13), transparent 45%) }
.card:hover::before { opacity: 1 } .card:hover { border-color: rgba(94,242,224,.35); text-decoration: none; transform: translateY(-2px) }
.card h3 { margin: .2rem 0 .5rem; font-size: 1.15rem } .card p { color: var(--muted); margin: 0; font-size: .95rem }
.card .tag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; padding: .2rem .55rem; border-radius: 999px; background: rgba(94,168,255,.15); color: var(--blue) }
.card .tag.warm { background: rgba(255,138,76,.15); color: var(--warm) } .card .tag.green { background: rgba(69,224,160,.15); color: var(--green) } .card .tag.violet { background: rgba(167,139,250,.15); color: var(--violet) }
.card .pass { margin-top: .8rem; font-size: .82rem; color: var(--green); font-weight: 600 }
.card .count { float: right; color: var(--faint); font-size: .8rem; font-variant-numeric: tabular-nums }
.bento { display: grid; gap: 1rem; grid-template-columns: repeat(6, 1fr) }
.bento .c2 { grid-column: span 2 } .bento .c3 { grid-column: span 3 } .bento .c4 { grid-column: span 4 } .bento .c6 { grid-column: span 6 }
@media (max-width: 900px) { .bento > * { grid-column: span 6 !important } }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)) }
.eq { display: flex; flex-direction: column; gap: .5rem }
.eq .tag { align-self: flex-start }
.eq .formula { font-size: 1.08rem; overflow-x: auto; padding: .4rem 0 }
.eq .value { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .85rem; color: var(--cyan) }
.eq .src { font-size: .78rem; color: var(--faint) }
.matrix { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass) }
.matrix table { border-collapse: collapse; width: 100%; font-size: .86rem; min-width: 760px; table-layout: auto }
.matrix th, .matrix td { padding: .6rem .45rem; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap }
.matrix th { white-space: normal; line-height: 1.3 }
.matrix th:first-child, .matrix td:first-child { text-align: left }
.matrix th { color: var(--muted); font-weight: 600; font-size: .8rem }
.matrix td.yes { color: var(--green); text-shadow: 0 0 12px rgba(69,224,160,.6); font-weight: 800 }
.matrix td.no { color: var(--faint) }
.matrix tr:hover td { background: rgba(94,168,255,.05) }
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.2rem; align-items: center }
@media (max-width: 900px) { .split { grid-template-columns: 1fr } }
.stage { width: 100%; aspect-ratio: 1 / 1; max-height: 480px; border-radius: var(--radius); border: 1px solid var(--line); background: radial-gradient(circle at 50% 40%, #0d1628, #05070d); display: block }
.stage.wide { aspect-ratio: 16 / 9; max-height: none }
.gates { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 }
.gates button, .ctrl button, .ctrl select { font: 600 .92rem/1 "JetBrains Mono", ui-monospace, monospace; padding: .6rem .9rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--ink); cursor: pointer }
.gates button:hover, .ctrl button:hover { border-color: var(--cyan); box-shadow: 0 0 16px rgba(94,242,224,.25) }
.readout { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .88rem; color: var(--muted); line-height: 1.9 }
.readout b { color: var(--ink) } .readout .ok { color: var(--green) } .readout .bad { color: var(--mars) }
.bar { height: 8px; border-radius: 99px; background: var(--bg2); overflow: hidden; border: 1px solid var(--line); margin: .2rem 0 .6rem }
.bar > span { display: block; height: 100%; background: var(--grad); width: 50%; transition: width .5s }
.ctrl { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0 }
.ctrl label { color: var(--muted); font-size: .88rem } .ctrl input[type=range] { width: min(420px, 90vw); accent-color: #22d3ee }
.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)) }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff }
.gallery img { display: block; width: 100%; height: auto }
.gallery figcaption { background: var(--bg2); color: var(--muted); font-size: .85rem; padding: .55rem .8rem }
.reveal { opacity: 0; transform: translateY(24px); filter: blur(6px) }
.no-js .reveal { opacity: 1; transform: none; filter: none }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; filter: none } .aurora, .gradient-text { animation: none } }
footer { max-width: var(--maxw); margin: 4rem auto 0; padding: 2rem 5vw 3rem; color: var(--faint); font-size: .85rem; border-top: 1px solid var(--line) }
@media (max-width: 1380px) { .top nav a.opt { display: none } }
@media (max-width: 860px) { html.js .top nav a:not(.gh) { display: none } html.js .nav-toggle { display: inline-flex } html:not(.js) .top { flex-wrap: wrap } html:not(.js) .top nav { flex-wrap: wrap } .live { font-size: .72rem; gap: .7rem; flex-wrap: wrap; white-space: normal; width: 92vw; justify-content: center } }

/* animated beams (after Magic UI AnimatedBeam) */
svg.beams { width: 100%; height: auto; display: block }
svg.beams .beam { stroke-dasharray: 60 400; animation: beam 2.4s linear infinite }
@keyframes beam { from { stroke-dashoffset: 460 } to { stroke-dashoffset: 0 } }
svg.beams .node rect { fill: rgba(17,24,42,.85); stroke: rgba(148,170,210,.3); transition: stroke .2s }
svg.beams a:hover .node rect { stroke: #5ef2e0 }
svg.beams .n1 { fill: #e8eef8; font: 600 14px Inter, system-ui, sans-serif; text-anchor: middle }
svg.beams .n2 { fill: #93a1b8; font: 12px "JetBrains Mono", monospace; text-anchor: middle }
/* marquee (after Magic UI Marquee) */
.marquee { overflow: hidden; margin-top: 1.4rem; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent) }
.mq-track { display: flex; gap: .8rem; width: max-content; animation: mq 60s linear infinite }
.marquee:hover .mq-track { animation-play-state: paused }
.mq-item { padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); color: var(--muted); font-size: .85rem; white-space: nowrap }
@keyframes mq { to { transform: translateX(-50%) } }
.readout .bad, .bad { color: var(--mars) } .readout .ok { color: var(--green) }
@media (prefers-reduced-motion: reduce) { .mq-track, svg.beams .beam { animation: none } }
/* Navigation, landmarks, and status (audit U02, U03) */
.skip { position: absolute; left: .5rem; top: -4rem; z-index: 60; padding: .55rem .9rem; border-radius: 8px; background: var(--ink); color: #05070d; font-weight: 600 }
.skip:focus { top: .5rem; text-decoration: none }
.nav-toggle { display: none; align-items: center; gap: .4rem; margin-left: auto; margin-right: .6rem; min-height: 44px; padding: .35rem .95rem;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer }
.nav-toggle:focus-visible, .top nav a:focus-visible, .skip:focus-visible, [tabindex="-1"]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px }
@media (max-width: 1380px) { html.js .top:has(nav a.opt) .nav-toggle { display: inline-flex } html.js .top nav:has(a.opt) a:not(.gh) { display: none } }
html.js .top nav.open { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; max-height: calc(100vh - 4rem); overflow-y: auto;
  padding: .4rem 4vw 1rem; background: rgba(5,7,13,.97); border-bottom: 1px solid var(--line) }
html.js .top nav.open a, html.js .top nav.open a.opt { display: block !important; margin: 0; padding: .75rem .2rem; min-height: 44px; font-size: 1rem; color: var(--ink); border-bottom: 1px solid var(--line); border-radius: 0 }
.stale { color: var(--warm, #ffb86b) }
#ci-status { pointer-events: auto }
@media (max-width: 480px) { .top { padding: .55rem 12px } .brand { font-size: .88rem; gap: .4rem } .nav-toggle { margin-right: 0; padding: .3rem .7rem } html.js .top nav:not(.open) a.gh { display: none } }
@media (max-width: 640px) { .hero-inner { max-width: 100%; min-width: 0; padding-left: 16px; padding-right: 16px } .eyebrow { display: inline; white-space: normal; line-height: 1.9 } .title { overflow-wrap: anywhere } }
main code, main a, .lab-head a, .panel a { overflow-wrap: anywhere } .compose { flex-wrap: wrap }
.compose input { min-width: 8rem }
.dash > * { min-width: 0 } .dash .st { flex-wrap: wrap }

/* ---------------------------------------------------------------- shared page components (0.57.0)
   One vocabulary for every page: .page and .page-intro frame it, .ui-grid lays out .ui-panel cards with a slow
   border beam, .ui-kpis hold numbers, .ui-btn / .ui-select / .ui-slider are the controls, .physics is the callout
   that states what physics allows, and .site-foot closes every page the same way. */
.page { max-width: 1320px; margin: 0 auto; padding: 5.6rem 3vw 2rem }
.page-intro { max-width: 980px; margin: 0 0 1.4rem }
.page-intro h1 { font-size: clamp(1.9rem, 3.8vw, 3.1rem); line-height: 1.06; margin: .5rem 0 .7rem; letter-spacing: -.02em; font-weight: 800 }
.page-intro .sub { margin: 0 }
.ui-grid { display: grid; gap: 1rem; grid-template-columns: repeat(12, minmax(0, 1fr)); margin-bottom: 1rem }
.ui-grid > * { min-width: 0 }
.span-4 { grid-column: span 4 } .span-5 { grid-column: span 5 } .span-6 { grid-column: span 6 } .span-7 { grid-column: span 7 } .span-8 { grid-column: span 8 } .span-12 { grid-column: span 12 }
@media (max-width: 1000px) { .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12 } }
.ui-panel { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--glass); padding: .95rem 1.05rem }
.ui-panel::before { content: ""; position: absolute; inset: -1px; border-radius: 16px; padding: 1px; pointer-events: none; opacity: .55;
  background: conic-gradient(from var(--beam, 0deg), transparent 0 70%, rgba(94,242,224,.9) 80%, rgba(167,139,250,.9) 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: beam 9s linear infinite }
@property --beam { syntax: "<angle>"; initial-value: 0deg; inherits: false }
@keyframes beam { to { --beam: 360deg } }
.ui-panel > h4 { margin: 0 0 .6rem; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: flex; gap: .5rem; align-items: center }
.ui-panel > h4::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 10px var(--cyan) }
.ui-panel canvas { width: 100%; display: block; border-radius: 12px }
.ui-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem }
.ui-k { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .7rem; background: rgba(10,15,28,.55) }
.ui-k .l { font-size: .72rem; color: var(--muted); letter-spacing: .04em } .ui-k .v { font: 700 1.3rem/1.2 "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums }
.ui-k .s { font-size: .72rem; color: var(--faint) }
.ui-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .35rem 0 }
.ui-btn, .ui-select { font: 600 .82rem/1 "JetBrains Mono", ui-monospace, monospace; padding: .55rem .8rem; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--ink); cursor: pointer; max-width: 100% }
.ui-btn:hover { border-color: rgba(94,242,224,.5) } .ui-btn.on, .ui-btn[aria-pressed="true"] { border-color: var(--cyan); box-shadow: 0 0 14px rgba(94,242,224,.3) }
.ui-btn:focus-visible, .ui-select:focus-visible, .ui-slider input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px }
.ui-slider { display: grid; grid-template-columns: 1fr auto; gap: .1rem .6rem; font-size: .84rem; color: var(--muted); margin: .45rem 0 }
.ui-slider b { color: var(--ink); font: 600 .84rem "JetBrains Mono", monospace } .ui-slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--cyan) }
.ui-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin: .45rem 0 0 }
.ui-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: .35rem }
.ui-note { color: var(--muted); font-size: .86rem; margin: .5rem 0 0 }
.ui-term { font: .82rem/1.75 "JetBrains Mono", ui-monospace, monospace; color: #c9d6ea; background: #03060c; border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; overflow-x: auto }
.ui-term .c { color: var(--faint) } .ui-term .v { color: var(--cyan) } .ui-term .ref { color: var(--violet) }
.physics { position: relative; margin: 0 0 1.2rem; padding: .9rem 1.1rem .9rem 1.3rem; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(90deg, rgba(94,242,224,.08), rgba(167,139,250,.04) 60%, transparent) }
.physics::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--grad) }
.physics b { color: var(--ink) } .physics p { margin: .2rem 0; color: #c2cde0 }
.site-foot { max-width: var(--maxw, 1200px); margin: 2.5rem auto 0; padding: 1.4rem 5vw 2.4rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center; color: var(--faint); font-size: .82rem }
.site-foot .brand-s { color: var(--ink); font-weight: 700; display: inline-flex; gap: .45rem; align-items: center } .site-foot .brand-s::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--grad) }
.site-foot a { color: var(--muted) } .site-foot .grow { flex: 1 1 18rem }
.top nav a[aria-current="page"] { color: var(--ink); text-shadow: 0 0 12px rgba(94,242,224,.55) }
@media (prefers-reduced-motion: reduce) { .ui-panel::before, .gradient-text { animation: none } }
.lab-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 .9rem }
.lab-tabs a { padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(10,15,28,.55); color: var(--muted); font-size: .8rem; min-height: 32px; display: inline-flex; align-items: center }
.lab-tabs a:hover { color: var(--ink); border-color: rgba(94,242,224,.45); text-decoration: none }
.lab-tabs a[aria-current="page"] { color: #05070d; background: var(--grad); border-color: transparent; font-weight: 700 }
@media (min-width: 900px) { .eyebrow { white-space: nowrap } }
