:root {
  --bg: #0b0d12;
  --surface: #12151d;
  --surface-2: #181c26;
  --border: #252a37;
  --text: #eef0f5;
  --muted: #a0a8ba;
  --accent-a: #7c5cff;
  --accent-b: #22c7de;
  --grad: linear-gradient(90deg, var(--accent-a), var(--accent-b));
  --radius: 14px;
  --font: "Ubuntu Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, rgba(34, 199, 222, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: #b9a9ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.05em 0.35em;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }
p { margin: 0; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: #9d8cff; margin-bottom: 12px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 13, 18, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--grad); }
.site-header nav { display: flex; gap: 22px; }
.site-header nav a { color: var(--muted); font-size: 0.95rem; }
.site-header nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { min-height: calc(100vh - 61px); display: flex; align-items: center; padding: 56px 0 48px; }
.hero > .wrap { width: min(1180px, 100% - 32px); }
.hero-grid { display: grid; grid-template-columns: 1.16fr 0.84fr; gap: 48px; align-items: center; }
.hero-copy h1 { font-size: clamp(2rem, 3.3vw, 2.75rem); font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; }
.hero-copy .lede { margin-top: 22px; max-width: 54ch; }
.hero-copy .cta { margin-top: 30px; align-items: center; }
.outcomes { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; max-width: 58ch; color: var(--muted); font-size: 0.98rem; }
.outcomes li { position: relative; padding-left: 22px; }
.outcomes li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 8px; height: 8px; border-radius: 2px; background: var(--grad); }
.outcomes strong { color: var(--text); font-weight: 600; }

/* Hero button bubbles: shown on hover (where hover exists) or keyboard focus. */
.tipped { position: relative; display: inline-block; --tip-x: -50%; }
.tipped .tip {
  position: absolute; left: 50%; top: calc(100% + 10px); translate: var(--tip-x) 4px; z-index: 5;
  width: max-content; max-width: min(300px, calc(100vw - 32px));
  background: var(--surface-2); border: 1px solid #343b4f; border-radius: 10px;
  padding: 10px 13px; font-size: 0.86rem; font-weight: 400; line-height: 1.45; color: var(--muted);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0; visibility: hidden; transition: opacity 0.15s ease, translate 0.15s ease, visibility 0.15s;
}
.tipped .tip::before {
  content: ""; position: absolute; left: 50%; top: -6px; width: 10px; height: 10px; translate: -50% 0; rotate: 45deg;
  background: var(--surface-2); border-left: 1px solid #343b4f; border-top: 1px solid #343b4f;
}
/* Anchored to the button's left edge instead of its centre, so it can't run off the left of the screen. */
.tipped.tip-start { --tip-x: 0; }
.tipped.tip-start .tip { left: 0; }
.tipped.tip-start .tip::before { left: 32px; }
.tipped .tip strong { color: var(--text); font-weight: 600; }
@media (hover: hover) { .tipped:hover .tip { opacity: 1; visibility: visible; translate: var(--tip-x) 0; } }
.tipped:has(:focus-visible) .tip, .live.pinned .tip { opacity: 1; visibility: visible; translate: var(--tip-x) 0; }

/* View demo: a status dot set by main.js's check of the live platform; offline,
   a click pins its bubble open instead of navigating. */
.live .btn { display: inline-flex; align-items: center; gap: 9px; }
.live .dot { width: 9px; height: 9px; border-radius: 50%; background: #5d6680; flex: none; }
.live[data-live="online"] .dot { background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.18); }
.live[data-live="checking"] .dot { animation: live-pulse 1s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: 0.3; } }
.live[data-live="offline"] .btn { color: var(--muted); border-style: dashed; border-color: #3a4152; background: transparent; }
.live [data-when] { display: none; }
.live[data-live="unknown"] [data-when="unknown"],
.live[data-live="checking"] [data-when="checking"],
.live[data-live="online"] [data-when="online"],
.live[data-live="offline"] [data-when="offline"] { display: inline; }
/* Phones have no hover and the buttons share rows. The two in-page buttons just
   scroll there, so their bubbles go; View demo's becomes a note in the flow under
   the buttons, shown on tap. Hidden, neither takes any space. */
@media (max-width: 600px) {
  .tipped:not(.live) .tip { display: none; }
  .live { display: contents; }
  .live .tip { position: static; translate: none; flex-basis: 100%; width: auto; max-width: none; display: none; box-shadow: none; }
  .live .tip::before { display: none; }
  .live:has(:focus-visible) .tip, .live.pinned .tip { display: block; translate: none; }
}
.byline { margin-top: 26px; color: var(--muted); font-size: 0.93rem; }
.byline a { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: #4a5168; text-underline-offset: 3px; }
.byline a:hover { text-decoration-color: currentColor; }
.contact-row { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 6px 0; font-size: 0.93rem; }
.contact-row li:not(:last-child)::after { content: "·"; margin: 0 10px; color: #4a5168; }
.contact-row a { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: #4a5168; text-underline-offset: 3px; }
.contact-row a:hover { text-decoration-color: currentColor; }
.tech-row { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px 0; color: var(--muted); font-size: 0.88rem; }
.tech-row li { white-space: nowrap; }
.tech-row li:not(:last-child)::after { content: "·"; margin: 0 10px; color: #4a5168; }
.site-header nav a { white-space: nowrap; }
.visual { background: rgba(15, 18, 25, 0.72); border: 1px solid var(--border); border-radius: 18px; padding: 22px; }
.visual svg { display: block; width: 100%; height: auto; }
.v-node { fill: #161a24; stroke: #343b4f; stroke-width: 1.4; }
.v-node-hi { fill: #1b1834; stroke: #7c5cff; stroke-width: 1.6; }
.v-t { fill: #eef0f5; font: 600 16px var(--font); }
.v-s { fill: #a0a8ba; font: 400 12.5px var(--font); }
.v-edge { fill: none; stroke: #4a5168; stroke-width: 1.6; }
.v-edge-hi { fill: none; stroke: url(#v-grad); stroke-width: 2.4; }
.v-label { fill: #8f97ad; font: 500 11.5px var(--font); letter-spacing: 0.04em; paint-order: stroke; stroke: #0f1219; stroke-width: 5px; stroke-linejoin: round; }
.v-pulse { fill: #22c7de; filter: drop-shadow(0 0 6px rgba(34, 199, 222, 0.9)); }
.lede { color: var(--muted); font-size: 1.12rem; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600;
}
.btn:hover { text-decoration: none; border-color: #3a4152; }
.btn.primary { background: var(--grad); border: 0; color: #0b0d12; }
.hero-visual { margin: 0; }
@media (max-width: 980px) {
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 560px; width: 100%; margin-inline: auto; }
}
@media (max-width: 760px) { .hero { padding: 40px 0; } }

/* Sections */
.section { padding: 72px 0; border-top: 1px solid var(--border); }
.section-head { max-width: 68ch; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.01em; }
.section-head p:not(.eyebrow) { color: var(--muted); margin-top: 12px; }

/* Video */
.paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.path { display: flex; flex-direction: column; }
.path-title { font-size: 1.15rem; margin: 0 0 14px; scroll-margin-top: 88px; }
.path-title .muted { font-weight: 500; font-size: 0.95rem; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; }
.video iframe, .video-facade, .video-facade img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-facade img { object-fit: cover; }
.play {
  position: absolute; left: 50%; top: 79%; width: 84px; height: 84px; translate: -50% -50%;
  border-radius: 50%; background: rgba(11, 13, 18, 0.72); border: 1px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease;
}
.play::after {
  content: ""; position: absolute; left: 34px; top: 26px;
  border-style: solid; border-width: 16px 0 16px 26px; border-color: transparent transparent transparent #fff;
}
.video-facade:hover .play { transform: scale(1.06); }

.path-sum { margin: 18px 0 0; display: grid; gap: 8px; font-size: 0.93rem; }
.path-sum div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 12px; }
.path-sum dt { color: var(--text); font-weight: 600; }
.path-sum dd { margin: 0; color: var(--muted); }
.more { display: inline-block; margin-top: 14px; font-size: 0.92rem; font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.94rem; }

/* Repos */
.repos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.repo { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; color: var(--text); }
.repo:hover { text-decoration: none; border-color: #3a4152; background: var(--surface-2); }
.repo h3 { font-family: var(--mono); font-size: 0.95rem; margin-bottom: 6px; color: #c9bfff; }
.repo p { color: var(--muted); font-size: 0.9rem; }
.built { list-style: none; padding: 0; margin: 0 0 36px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.built li { color: var(--muted); font-size: 0.93rem; padding-left: 14px; border-left: 2px solid var(--accent-a); }
.built strong { color: var(--text); }
.repo-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.repo-group { display: grid; gap: 10px; }
.repo-group > h3 { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.repo-group .tag-inline { letter-spacing: 0; text-transform: none; color: #c9bfff; border-color: #3b3270; }
.repo-group .repo { padding: 14px 16px; }
.repo h4 { font-family: var(--mono); font-size: 0.92rem; margin-bottom: 4px; color: #c9bfff; }
.repo-group .repo p { font-size: 0.87rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.about-copy .section-head p + p { margin-top: 10px; }
.values { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 62ch; }
.values li { color: var(--muted); font-size: 0.95rem; padding-left: 14px; border-left: 2px solid var(--accent-a); }
.values strong { color: var(--text); }
.contact-card { padding: 28px; display: grid; gap: 14px; justify-items: start; }
.contact-card h3 { font-size: 1.3rem; margin: 0; }
.contact-links { list-style: none; padding: 14px 0 0; margin: 4px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; width: 100%; font-size: 0.94rem; }
.contact-links li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.contact-links a { font-weight: 600; }
.contact-links span { color: var(--muted); }
@media (max-width: 920px) { .about-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; } }
@media (max-width: 600px) {
  .site-header nav a[href="#about"] { display: none; }
  .contact-card { padding: 22px; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; color: var(--muted); font-size: 0.92rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Responsive */
@media (max-width: 920px) {
  .repos { grid-template-columns: repeat(2, 1fr); }
  .paths, .repo-groups { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .built { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .site-header nav { gap: 10px; }
  .site-header nav a { font-size: 0.8rem; }
  .brand { font-size: 0.95rem; }
  .repos, .built { grid-template-columns: 1fr; }
  .sublinks { gap: 2px; }
  .sublinks a, .more { display: inline-block; padding: 5px 0; }
  .section { padding: 56px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .play { transition: none; }
  .live[data-live="checking"] .dot { animation: none; }
  .tipped .tip { transition: none; }
}

/* Architecture */
.diagram { margin: 0; background: #0b0d12; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.diagram-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.diagram img { display: block; width: 100%; min-width: 760px; height: auto; }
.diagram figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }
@media (max-width: 600px) { .diagram { padding: 10px; } }

/* Front page: three pillars in a row, arrows between them */
.pillars { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px; }
.pillar { position: relative; display: flex; flex-direction: column; }
.pillar:not(:last-child)::after {
  content: "→"; position: absolute; right: -33px; top: 50%; translate: 0 -50%;
  color: #4fa6e6; font-size: 1.3rem; font-weight: 600;
}
.pillar-step { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #8f86d9; margin-bottom: 8px; }
.pillar h3 { font-size: 1.15rem; }
.card.pillar > p:not(.pillar-step) { flex: 1; }
.sublinks { list-style: none; padding: 14px 0 0; margin: 16px 0 0; border-top: 1px solid var(--border); display: grid; gap: 6px; font-size: 0.92rem; font-weight: 600; }
.after-note { margin-top: 28px; color: var(--muted); font-size: 0.95rem; }
.after-note a { font-weight: 600; }
@media (max-width: 920px) {
  .pillars { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .pillar:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -32px; translate: -50% 0; }
}

/* Front page "slides": on roomy desktop screens each section fills the screen and,
   when a scroll stops near a section's top, gently settles there. Proximity, not
   mandatory: it never forces a jump, and it's off on phones and for reduced motion. */
@media (min-width: 981px) and (min-height: 720px) and (prefers-reduced-motion: no-preference) {
  html:has(.slide) { scroll-snap-type: y proximity; scroll-padding-top: 61px; }
  .slide { scroll-snap-align: start; }
  .section.slide .section-head { margin-bottom: 28px; }
  .section.slide .built { margin-bottom: 28px; }
  .section.slide .path-sum { margin-top: 14px; gap: 5px; }
  .section.slide .more { margin-top: 10px; }
  .section.slide { min-height: calc(100vh - 61px); padding: 48px 0; display: flex; flex-direction: column; justify-content: center; }
}
@media (min-width: 761px) { .diagram figcaption .scroll-hint { display: none; } }

/* Concept pages (architecture/<area>/) */
.concept { padding: 36px 0 72px; }
.crumbs { display: flex; gap: 10px; font-size: 0.9rem; color: var(--muted); }
.concept-head { margin: 28px 0 32px; max-width: 68ch; }
.concept-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.02em; }
.concept-head .lede { margin-top: 14px; }
.concept-head .watch { margin-top: 14px; font-weight: 600; }
.concept-head .watch a { color: #b9a9ff; }
.facts { list-style: none; padding: 0; margin: 0 0 48px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.facts li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.facts strong { display: block; font-size: 1.7rem; line-height: 1.1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.facts span { color: var(--muted); font-size: 0.88rem; }
.doc-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 8px; font-size: 0.92rem; }
.toc p { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.toc a { color: var(--muted); border-left: 2px solid var(--border); padding-left: 12px; }
.toc a:hover { color: var(--text); border-color: var(--accent-a); text-decoration: none; }
.doc section { scroll-margin-top: 80px; }
.doc section + section { margin-top: 56px; }
.doc h2 { font-size: 1.55rem; margin-bottom: 18px; }
.flow { list-style: none; padding: 0; margin: 0; counter-reset: flow; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.flow li { position: relative; padding-left: 44px; counter-increment: flow; max-width: 74ch; }
.flow li::before {
  content: counter(flow); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; background: var(--grad); color: #0b0d12;
}
.flow h3 { font-size: 1.08rem; margin-bottom: 6px; }
.flow p { color: var(--muted); }
.doc pre { margin: 12px 0 0; background: #0b0d12; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
.doc pre code { background: none; border: 0; padding: 0; font-size: 0.86rem; color: #c9d1e3; }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.choice { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.choice h3 { font-size: 1.04rem; margin-bottom: 8px; }
.choice p { color: var(--muted); font-size: 0.94rem; }
.choice .tradeoff { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.choice .tradeoff strong { color: #e5c07b; font-weight: 600; }
.choice:last-child:nth-child(odd) { grid-column: 1 / -1; }
.not-yet, .points { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 8px; max-width: 74ch; }
.not-yet strong, .points strong { color: var(--text); }
.points { margin: 24px 0; }
.repos-compact { grid-template-columns: repeat(3, 1fr); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--border); }
.pager a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; color: var(--text); font-weight: 600; }
.pager a:hover { text-decoration: none; border-color: #3a4152; }
.pager span { display: block; font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.pager .next { text-align: right; }
.o-group { fill: #10131b; stroke: #2c3244; stroke-width: 1.4; }
.o-dashed { fill: none; stroke-dasharray: 6 6; }
.o-hi { stroke: #4fa6e6; }
.o-dashed-edge { stroke-dasharray: 5 5; }
.diagram svg { display: block; width: 100%; min-width: 760px; height: auto; }
.v-t.mono { font-family: var(--mono); font-size: 14.5px; }
.doc-p { color: var(--muted); max-width: 74ch; margin-bottom: 16px; }
.env-policy { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.choice .action { margin-top: 12px; color: var(--text); font-size: 0.9rem; }
.tag-inline { display: inline-block; margin-left: 6px; font-size: 0.72rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; vertical-align: 1px; }
.v-s.mono-s { font-family: var(--mono); font-size: 11.5px; }
.plain { margin: 10px 0 0; padding-left: 18px; color: var(--muted); display: grid; gap: 6px; }
.plain strong { color: var(--text); font-weight: 600; }
@media (min-width: 921px) {
  .areas > .card:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
  .areas > .card:last-child:nth-child(3n+2) { grid-column: span 2; }
}
.read-more { display: inline-block; margin-top: 12px; color: #b9a9ff; font-size: 0.9rem; font-weight: 600; }
a.card { display: block; color: var(--text); }
a.card:hover { text-decoration: none; border-color: #3a4152; background: var(--surface-2); }
@media (max-width: 920px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .choices, .repos-compact, .env-policy { grid-template-columns: 1fr; }
}
