/* HEMRA project site. Brand tokens from docs/design-system.md; semantic
   tokens switch with the system theme. No web fonts: Inter if installed,
   then the system UI face. */

:root {
  --navy: #0b1220;
  --charcoal: #1f2937;
  --cyan: #06d6d6;
  --blue: #246bfd;
  --purple: #885cf6;
  --slate: #94a3b8;
  --white: #f7f9fc;

  --bg: var(--white);
  --panel: #ffffff;
  --panel-2: #eef2f8;
  --line: #dbe2ec;
  --text: var(--navy);
  --muted: #5b6b82;
  --accent: #058f8f;
  --link: var(--blue);
  --warn: #9a5b00;
  --ok: #0f7a4a;
  --code-bg: var(--navy);
  --code-text: #e2e8f0;

  --radius: 12px;
  --max: 1120px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--navy);
    --panel: #111a2c;
    --panel-2: var(--charcoal);
    --line: #24314a;
    --text: var(--white);
    --muted: var(--slate);
    --accent: var(--cyan);
    --link: #5b93ff;
    --warn: #f5b84a;
    --ok: #3ccf8e;
    --code-bg: #070c16;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

code, pre { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code { background: var(--panel-2); padding: 0.1em 0.35em; border-radius: 5px; }

pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.55;
  margin: 0;
}
pre .c { color: var(--slate); }

img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Top bar: navy in both themes, as in the dashboard. */
.top {
  background: var(--navy);
  color: var(--white);
  border-bottom: 1px solid #1c2740;
  position: sticky;
  top: 0;
  z-index: 10;
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 750; letter-spacing: 0.14em; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.top nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.top nav a { color: #c6d0de; padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.top nav a:hover { color: var(--white); background: #16213a; text-decoration: none; }
.top nav a[aria-current="page"] { color: var(--white); box-shadow: inset 0 -2px 0 var(--cyan); border-radius: 8px 8px 0 0; }
@media (max-width: 560px) {
  .top .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 8px; }
  .top nav { margin-left: 0; }
  .top nav a { padding: 4px 8px; }
}

/* Hero: navy band in both themes. */
.hero { background: var(--navy); color: var(--white); padding: 72px 0 80px; position: relative; overflow: hidden; }
.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -60% 40%;
  height: 420px;
  background: radial-gradient(closest-side, rgba(36, 107, 253, 0.28), transparent);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.eyebrow { color: var(--cyan); font-size: 13px; font-weight: 650; letter-spacing: 0.18em; text-transform: uppercase; margin: 0 0 14px; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.1; margin: 0 0 18px; max-width: 18ch; letter-spacing: -0.01em; }
.hero p.lede { font-size: clamp(17px, 2vw, 20px); color: #c6d0de; max-width: 60ch; margin: 0 0 30px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero pre { margin-top: 36px; max-width: 760px; background: #070c16; border: 1px solid #1c2740; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.ghost { border-color: #2b3a58; color: var(--white); }
.btn.secondary { border-color: var(--line); color: var(--text); background: var(--panel); }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

section { padding: 72px 0; }
section + section { border-top: 1px solid var(--line); }
h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 18px; margin: 0 0 6px; }
.sub { color: var(--muted); max-width: 70ch; margin: 0 0 36px; font-size: 17px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card p + p, .card ul { margin-top: 10px; }
.card ul { padding-left: 18px; color: var(--muted); font-size: 15px; margin-bottom: 0; }
.card .tag { display: inline-block; font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.card .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 14px; background: var(--panel-2); color: var(--accent); }
.card .ico svg { width: 20px; height: 20px; }

.noun { border-top: 3px solid var(--cyan); }
.noun:nth-child(2) { border-top-color: var(--blue); }
.noun:nth-child(3) { border-top-color: var(--purple); }
.noun:nth-child(4) { border-top-color: var(--slate); }
.noun code { font-size: 13px; }

/* Agent chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); white-space: nowrap; }
.chip.soon { border-style: dashed; background: transparent; color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel-2); font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* Screenshots */
.shots { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); }
figure { margin: 0; }
figure img { border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; }

.split { display: grid; gap: 40px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }

.note { border-left: 3px solid var(--cyan); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; color: var(--muted); font-size: 15px; }
.note.warn { border-left-color: var(--warn); }
.note strong { color: var(--text); }

ol.steps { padding-left: 22px; margin: 0; }
ol.steps li { margin-bottom: 10px; }

/* Architecture diagram */
.diagram { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 760px; height: auto; font-family: var(--font); }
.diagram .box { fill: var(--panel-2); stroke: var(--line); }
.diagram .box.core { stroke: var(--blue); }
.diagram .box.ext { fill: none; stroke: var(--slate); stroke-dasharray: 5 4; }
.diagram .box.ui { stroke: var(--cyan); }
.diagram .group { fill: none; stroke: var(--line); }
.diagram .t { fill: var(--text); font-size: 14px; font-weight: 650; }
.diagram .s { fill: var(--muted); font-size: 12px; }
.diagram .g { fill: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: 0.12em; }
.diagram .edge { stroke: var(--slate); stroke-width: 1.5; fill: none; }
.diagram .edge.flow { stroke: var(--blue); }
.diagram .arrow { fill: var(--slate); }
.diagram .arrow.flow { fill: var(--blue); }

/* Download states */
.release[hidden] { display: none; }
.dl-card { display: grid; gap: 18px; }
.dl-meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pill { display: inline-block; font-size: 12px; font-weight: 650; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; }
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }

footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
footer .brand { color: var(--text); font-size: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; }
.hero .dl-meta { color: #c6d0de; margin: 16px 0 0; }
.hero code { background: #16213a; color: var(--white); }
.diagram .label-bg { fill: var(--panel); }
footer .made { flex-basis: 100%; order: 3; }
footer .made [role="img"] { color: var(--cyan); }

/* ------------------------------------------------------------------ */
/* Look and motion. Everything here is CSS (plus SMIL dots in the      */
/* architecture diagram), so the CSP stays script-free for it, and all */
/* of it switches off under prefers-reduced-motion at the end.         */
/* ------------------------------------------------------------------ */

:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --glow: 0 0 0 1px rgba(6, 214, 214, 0.35), 0 18px 40px -18px rgba(36, 107, 253, 0.45);
}

/* Cross-page transitions (Chrome, Edge, Safari 18.2+); other browsers
   just navigate. The top bar stays put while the page underneath moves. */
@view-transition { navigation: auto; }
.top { view-transition-name: top; }
::view-transition-old(root) { animation: 220ms var(--ease) both page-out; }
::view-transition-new(root) { animation: 420ms var(--ease) both page-in; }
@keyframes page-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }

/* Top bar: translucent navy with blur, animated underline. */
.top { background: rgba(11, 18, 32, 0.82); backdrop-filter: saturate(150%) blur(14px); -webkit-backdrop-filter: saturate(150%) blur(14px); }
.top nav a { position: relative; transition: color 0.2s, background-color 0.2s; }
.top nav a::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.top nav a:hover::after, .top nav a[aria-current="page"]::after { transform: scaleX(1); }
.top nav a[aria-current="page"] { box-shadow: none; }
.brand img { transition: transform 0.6s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }

/* Hero: drifting aurora over a faint grid. */
.hero { padding: 88px 0 64px; isolation: isolate; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}
.hero::after {
  inset: -30% -10% auto -10%;
  height: 120%;
  z-index: -1;
  background:
    radial-gradient(38% 42% at 72% 38%, rgba(36, 107, 253, 0.32), transparent 70%),
    radial-gradient(30% 36% at 20% 20%, rgba(6, 214, 214, 0.18), transparent 70%),
    radial-gradient(26% 30% at 60% 80%, rgba(136, 92, 246, 0.2), transparent 70%);
  filter: blur(10px);
  animation: aurora 18s ease-in-out infinite alternate;
}
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-4%, 3%, 0) scale(1.08); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.02); }
}

.hero-grid { display: grid; gap: 48px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.1fr 0.9fr; } }
.hero h1 { max-width: 16ch; }
.grad {
  background: linear-gradient(100deg, var(--cyan), #5b93ff 55%, var(--purple));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s ease-in-out infinite alternate;
}
@keyframes shimmer { to { background-position: 100% 0; } }

/* Hero entrance, staggered, once. */
.hero-copy > *, .trace, .hero-cmd, .app-icon { animation: rise 0.9s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: 0.08s; }
.hero-copy > :nth-child(3) { animation-delay: 0.16s; }
.hero-copy > :nth-child(4) { animation-delay: 0.24s; }
.hero-copy > :nth-child(5) { animation-delay: 0.32s; }
.trace, .app-icon { animation-delay: 0.3s; }
.hero-cmd { animation-delay: 0.45s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* The example trace card: events arrive one by one, then the verifier
   scores it. Loops every 12 s. */
.trace {
  background: rgba(17, 26, 44, 0.78);
  border: 1px solid #24314a;
  border-radius: 16px;
  box-shadow: 0 30px 80px -30px rgba(36, 107, 253, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  overflow: hidden;
  font-size: 13px;
  color: #c6d0de;
}
.trace-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #1c2740; background: rgba(7, 12, 22, 0.6); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #24314a; }
.trace-title { font-family: var(--mono); font-size: 12px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trace-state { margin-left: auto; position: relative; display: inline-grid; font-size: 12px; font-weight: 650; }
.trace-state .st { grid-area: 1 / 1; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; text-align: center; }
.trace-state .run { color: var(--cyan); animation: state-run 12s infinite; }
.trace-state .done { color: #8fb3ff; animation: state-done 12s infinite; }
@keyframes state-run { 0%, 66% { opacity: 1; } 70%, 100% { opacity: 0; } }
@keyframes state-done { 0%, 66% { opacity: 0; } 70%, 96% { opacity: 1; } 100% { opacity: 0; } }
.trace-state .run::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.trace-rows { list-style: none; margin: 0; padding: 8px 0; counter-reset: ev; }
.trace-rows li {
  counter-increment: ev;
  display: grid;
  grid-template-columns: 30px 12px minmax(0, 150px) 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px 16px;
  opacity: 0;
  animation: ev-in 12s var(--ease) infinite;
}
.trace-rows li::before { content: "#" counter(ev); color: #5b6b82; font-family: var(--mono); font-size: 12px; text-align: right; }
.trace-rows code { background: none; padding: 0; color: #e2e8f0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trace-rows span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trace-rows li:nth-child(2) { animation-delay: 0.6s; }
.trace-rows li:nth-child(3) { animation-delay: 1.2s; }
.trace-rows li:nth-child(4) { animation-delay: 1.8s; }
.trace-rows li:nth-child(5) { animation-delay: 2.4s; }
.trace-rows li:nth-child(6) { animation-delay: 3s; }
.trace-rows li:nth-child(7) { animation-delay: 3.6s; }
.trace-rows li:nth-child(8) { animation-delay: 4.2s; }
@keyframes ev-in {
  0% { opacity: 0; transform: translateX(-10px); background: transparent; }
  3% { opacity: 1; transform: none; background: rgba(6, 214, 214, 0.1); }
  10% { background: transparent; }
  58%, 92% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}
.k { width: 8px; height: 8px; border-radius: 2px; display: block; }
.k.log { background: var(--slate); }
.k.model { background: var(--blue); }
.k.tool { background: var(--cyan); }
.k.mcp { background: #3ccf8e; }
.k.art { background: var(--purple); }
.trace-score {
  margin: 4px 12px 12px;
  padding: 10px 12px;
  border: 1px solid #24314a;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  opacity: 0;
  animation: score-in 12s var(--ease) infinite;
}
@keyframes score-in { 0%, 44% { opacity: 0; transform: translateY(6px); } 48%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.ok-pill { color: #3ccf8e; border: 1px solid currentColor; border-radius: 999px; padding: 1px 10px; font-weight: 650; font-size: 12px; box-shadow: 0 0 18px -4px rgba(60, 207, 142, 0.6); }

.hero-cmd { margin-top: 48px; }

/* Agent marquee under the hero. */
.marquee {
  background: var(--navy);
  border-top: 1px solid #1c2740;
  border-bottom: 1px solid #1c2740;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee ul { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; }
.marquee li { padding: 16px 28px; color: #c6d0de; font-weight: 600; white-space: nowrap; position: relative; }
.marquee li::after { content: ""; position: absolute; right: -3px; top: 50%; width: 6px; height: 6px; border-radius: 2px; background: var(--cyan); opacity: 0.6; transform: translateY(-50%) rotate(45deg); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Numbers strip. */
.stats { border-bottom: 1px solid var(--line); }
.stats dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; }
.stats dl > div { padding: 28px 8px; text-align: center; }
.stats dl > div + div { border-left: 1px solid var(--line); }
@media (max-width: 640px) { .stats dl > div + div { border-left: 0; } }
.stats dt { font-size: 40px; font-weight: 750; line-height: 1; background: linear-gradient(120deg, var(--cyan), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats dd { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

/* Section headings get a small accent bar. */
section h2::before {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  border-radius: 3px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}

/* Cards: lift and glow on hover, gradient edge. */
.card {
  position: relative;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--glow); border-color: transparent; }
.card .ico { transition: transform 0.5s var(--ease), background-color 0.3s; }
.card:hover .ico { transform: rotate(-6deg) scale(1.1); background: rgba(6, 214, 214, 0.14); }
.chip { transition: border-color 0.2s, transform 0.2s; }
.card:hover .chip:not(.soon) { border-color: var(--accent); }

/* Buttons: sheen on hover, press. */
.btn { position: relative; overflow: hidden; transition: transform 0.2s var(--ease), box-shadow 0.3s, filter 0.2s; }
.btn:active { transform: scale(0.98); }
.btn.primary { box-shadow: 0 10px 30px -10px rgba(36, 107, 253, 0.8); }
.btn.primary:hover { box-shadow: 0 14px 36px -10px rgba(36, 107, 253, 0.95); transform: translateY(-1px); }
.btn.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.btn.primary:hover::after { transform: translateX(120%); }
.btn.ghost:hover { border-color: var(--cyan); background: rgba(6, 214, 214, 0.06); }

/* Screenshots: framed, zoom on hover. */
figure img { transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease); }
.shots figure { overflow: visible; }
.shots figure img:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 30px 60px -30px rgba(36, 107, 253, 0.6); }

/* Table rows highlight. */
tbody tr { transition: background-color 0.2s; }
tbody tr:hover { background: var(--panel-2); }

/* Reveal on scroll where scroll-driven animations exist; elsewhere the
   content is simply there. */
@supports (animation-timeline: view()) {
  main section :is(h2, .sub, .card, figure, .table-wrap, .note, pre, ol.steps),
  .stats dl > div {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
  }
}
@keyframes reveal { from { opacity: 0; transform: translateY(28px) scale(0.985); } }

/* Architecture diagram: the event flow runs, dots travel the main paths. */
.diagram .edge.flow { animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -20; } }
.diagram .pulse { fill: var(--cyan); filter: drop-shadow(0 0 4px var(--cyan)); }
.diagram .box { transition: stroke 0.3s, filter 0.3s; }
.diagram .box.core:hover, .diagram .box.ui:hover { filter: drop-shadow(0 0 8px rgba(36, 107, 253, 0.5)); }

/* Download page: the app tile floats. */
.app-icon { display: grid; place-items: center; }
.app-tile {
  width: 220px;
  height: 220px;
  border-radius: 48px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #16213a, #0b1220 70%);
  border: 1px solid #24314a;
  box-shadow: 0 40px 80px -30px rgba(36, 107, 253, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 10px rgba(6, 214, 214, 0.04);
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-12px) rotate(-1.5deg); } }
@media (max-width: 979px) { .app-icon { display: none; } }

/* Code windows and highlighting (SDK page). */
.code-window {
  background: rgba(7, 12, 22, 0.85);
  border: 1px solid #24314a;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(36, 107, 253, 0.55);
  animation: rise 0.9s var(--ease) 0.3s both;
}
.code-window pre { background: transparent; border: 0; border-radius: 0; margin: 0; font-size: 13px; }
pre .kw { color: #c792ea; }
pre .str { color: #7fdbca; }
pre .fn { color: #82aaff; }
pre .num { color: #f78c6c; }
pre.frames { font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
.beliefs { counter-reset: b; list-style: none; padding: 0; }
.beliefs li { counter-increment: b; position: relative; padding: 14px 0 14px 52px; border-bottom: 1px solid var(--line); color: var(--muted); }
.beliefs li::before { content: counter(b, decimal-leading-zero); position: absolute; left: 0; top: 13px; font-weight: 750; font-size: 18px; color: var(--accent); }
.beliefs strong, .not-list strong { color: var(--text); }
.not-list { list-style: none; padding: 0; margin: 0 0 24px; }
.not-list li { padding: 12px 0 12px 30px; position: relative; color: var(--muted); border-bottom: 1px solid var(--line); }
.not-list li::before { content: ""; position: absolute; left: 4px; top: 21px; width: 10px; height: 10px; border-radius: 3px; background: linear-gradient(135deg, var(--cyan), var(--blue)); transform: rotate(45deg); }
.split h3 { margin-bottom: 8px; }

.hero-grid > *, .split > * { min-width: 0; }
.code-window pre { overflow-x: auto; }

/* ---------------------------------------------------------------- */
/* Docs (ADR-0050): sidebar, article, and an "on this page" column on   */
/* wide screens. The article is rendered from Markdown by build.mjs.    */
/* ---------------------------------------------------------------- */
.docs { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); padding-top: 32px; padding-bottom: 64px; }
@media (min-width: 900px) { .docs { grid-template-columns: 210px minmax(0, 1fr); } }
@media (min-width: 1200px) { .docs { grid-template-columns: 210px minmax(0, 1fr) 190px; } }
.docs-nav ul, .docs-toc ul { list-style: none; margin: 0 0 18px; padding: 0; }
.docs-nav li a, .docs-toc li a { display: block; padding: 4px 10px; border-radius: 8px; color: var(--muted); font-size: 15px; }
.docs-nav li a:hover, .docs-toc li a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.docs-nav li a[aria-current="page"] { color: var(--text); background: var(--panel-2); box-shadow: inset 3px 0 0 var(--cyan); }
.docs-group { font-size: 12px; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px 10px; }
@media (max-width: 899px) {
  .docs-nav { display: flex; flex-wrap: wrap; gap: 0 18px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .docs-nav ul { display: flex; flex-wrap: wrap; gap: 2px; }
  .docs-group { flex-basis: 100%; margin-top: 6px; }
}
.docs-toc { display: none; }
@media (min-width: 1200px) { .docs-toc { display: block; position: sticky; top: 84px; align-self: start; } }
.docs-body { min-width: 0; max-width: 78ch; }
.docs-body h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.01em; }
.docs-body h2 { font-size: 26px; margin: 40px 0 12px; padding-top: 8px; }
.docs-body h3 { font-size: 19px; margin: 28px 0 8px; }
.docs-body h2, .docs-body h3 { scroll-margin-top: 80px; }
.docs-body p, .docs-body li { color: var(--text); }
.docs-body ul, .docs-body ol { padding-left: 22px; }
.docs-body li { margin-bottom: 6px; }
.docs-body pre { margin: 16px 0; }
.docs-body .table-wrap { margin: 16px 0; }
.docs-body blockquote { margin: 16px 0; border-left: 3px solid var(--cyan); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; padding: 4px 18px; color: var(--muted); }
.docs-body hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.docs-edit { margin-top: 48px; font-size: 14px; }
.docs-pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 12px; }
.docs-pager a { font-weight: 600; }
.docs-pager .prev::before { content: "\2190  "; }
.docs-pager .next::after { content: "  \2192"; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .trace-rows li, .trace-score, .trace-state .done { opacity: 1; }
  .trace-state .run { opacity: 0; }
  .diagram .pulses { display: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

