:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { min-width: 320px; margin: 0; overflow-x: hidden; line-height: 1.5; }
main { overflow-x: clip; }
a { color: inherit; text-decoration: none; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
h1, h2, h3, p { margin-top: 0; }
code, pre { font-family: var(--mono); }

.section-wrap { max-width: 1180px; margin-left: auto; margin-right: auto; padding-left: 30px; padding-right: 30px; }
.skip-link { position: absolute; top: -60px; left: 16px; z-index: 20; padding: 10px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.skip-link:focus { top: 12px; }

/* header: floating capsule */
.site-header { position: sticky; top: 14px; z-index: 10; display: flex; align-items: center; justify-content: space-between; width: min(1120px, calc(100% - 32px)); height: 56px; margin: 14px auto 0; padding: 0 8px 0 22px; border: 1px solid var(--line); border-radius: 999px; background: var(--header-bg); box-shadow: 0 12px 40px -14px rgba(20, 30, 60, .28), inset 0 1px 0 rgba(255, 255, 255, .3); backdrop-filter: blur(18px) saturate(1.5); overflow: hidden; }
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; }
.site-header .brand img { width: 100px; height: auto; }
.site-header nav { display: flex; align-items: center; gap: 2px; color: var(--muted); font-size: 13.5px; font-weight: 500; letter-spacing: -.005em; }
.site-header nav > a { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; transition: color .18s ease, background .18s ease; }
.site-header nav > a:hover { background: var(--hover); color: var(--text); }
.nd { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; }
.nd-a { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.nd-t { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.site-header nav > .nav-github { gap: 4px; margin: 0 8px 0 6px; padding: 8px 16px; background: var(--text); color: var(--bg); }
.site-header nav > .nav-github:hover { background: var(--accent); color: var(--accent-ink); }
.nav-github span { opacity: .7; }
.site-header .theme-toggle { width: 38px; height: 38px; border-color: transparent; background: var(--hover); }
.site-header::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--violet)); transform: scaleX(0); transform-origin: left; }
@supports (animation-timeline: scroll()) { .site-header::after { animation: progress linear both; animation-timeline: scroll(root); } }
@keyframes progress { to { transform: scaleX(1); } }

/* shared */
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; color: var(--dim); font: 500 11px var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 3px var(--accent); opacity: .7; } }
.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 10px; padding: 0 24px; border: 1px solid transparent; border-radius: 999px; font-size: 14px; font-weight: 600; transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 28px -6px var(--accent); }
.button-primary:hover { background: var(--accent-hover); }
.button-quiet { border-color: var(--line); background: var(--surface); color: var(--text); }
.button-quiet:hover { border-color: var(--violet); }
.text-link { display: inline-block; color: var(--accent-text); font-size: 14px; font-weight: 600; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
h2 { font-size: clamp(32px, 4.2vw, 50px); font-weight: 650; letter-spacing: -.05em; line-height: 1.08; }
h2 span { color: var(--accent-text); }

/* hero */
.hero { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 56px; max-width: 1180px; margin: 0 auto; padding: 96px 30px 80px; }
.hero-glow { position: absolute; inset: -72px -30vw auto -30vw; z-index: -1; height: 720px; background: radial-gradient(520px 320px at 78% 42%, var(--glow-b), transparent 70%), radial-gradient(480px 300px at 22% 30%, var(--glow-a), transparent 70%); }
.hero-glow::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 52px 52px; -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 10%, transparent 66%); mask-image: radial-gradient(ellipse at 60% 40%, #000 10%, transparent 66%); }
.hero h1 { margin: 0 0 22px; font-size: clamp(46px, 6vw, 76px); font-weight: 650; letter-spacing: -.065em; line-height: 1.02; }
.hero h1 span { background: linear-gradient(100deg, var(--grad-a) 20%, var(--grad-b) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lede { max-width: 440px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { display: flex; align-items: center; gap: 9px; margin: 26px 0 0; color: var(--dim); font-size: 13px; }
.hero-note i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--amber); }
.hero-note a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* terminal (dark in both themes) */
.terminal { border: 1px solid rgba(143, 132, 255, .3); border-radius: var(--radius); background: linear-gradient(160deg, #0d1424, var(--code-bg)); box-shadow: var(--shadow), 0 0 80px -20px var(--glow-b); overflow: hidden; }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid rgba(130, 150, 182, .2); background: rgba(255, 255, 255, .02); }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a3548; }
.terminal-bar i:nth-child(1) { background: #ff6b6b99; } .terminal-bar i:nth-child(2) { background: #e3b34199; } .terminal-bar i:nth-child(3) { background: #35c6a399; }
.terminal-bar span { margin-left: 10px; color: #71829b; font: 11px var(--mono); }
.terminal-body { margin: 0; padding: 24px 22px 28px; overflow-x: auto; color: var(--code-text); font-size: 12.5px; line-height: 1.95; white-space: pre; }
.terminal-body em { color: #9aa9bf; font-style: normal; }
.t-prompt { color: #9a90ff; font-weight: 500; }
.t-ok { color: #35c6a3; }
.t-audit { color: #e3b341; }
.t-cursor { display: inline-block; width: 8px; height: 15px; margin-left: 4px; vertical-align: -2px; background: #35c6a3; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.t-line { opacity: 0; animation: lineIn .5s ease forwards; }
.t1 { animation-delay: .3s; } .t2 { animation-delay: 1s; } .t3 { animation-delay: 1.6s; } .t4 { animation-delay: 2.2s; } .t5 { animation-delay: 2.8s; } .t6 { animation-delay: 3.4s; }
@keyframes lineIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* hierarchy strip */
.strip { padding-top: 8px; padding-bottom: 20px; }
.hier { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.hier li { position: relative; padding: 22px 24px; }
.hier li + li { border-left: 1px solid var(--line); }
.hier li + li::before { content: "→"; position: absolute; top: 50%; left: -9px; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--surface); color: var(--accent-text); font-size: 11px; line-height: 18px; text-align: center; box-shadow: 0 0 0 1px var(--line); }
.hier span { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.hier small { display: block; margin-top: 4px; color: var(--dim); font: 11px var(--mono); }
.strip-note { margin: 18px 0 0; color: var(--muted); font-size: 14px; }

/* modules */
.module { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 72px; padding-top: 110px; padding-bottom: 30px; }
.module-tag { display: inline-block; margin-bottom: 18px; padding: 6px 12px; border: 1px solid; border-radius: 999px; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.tag-anubis { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--accent-text); }
.tag-thoth { border-color: color-mix(in srgb, var(--violet) 45%, transparent); background: var(--violet-soft); color: var(--violet); }
.module-copy > p { max-width: 480px; margin: 20px 0 8px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.module-flip h2 span { color: var(--violet); }
.ticks { display: grid; gap: 14px; margin: 28px 0 0; padding: 0; list-style: none; }
.ticks li { position: relative; padding-left: 28px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.ticks li::before { content: ""; position: absolute; top: 6px; left: 2px; width: 12px; height: 7px; border-left: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text); transform: rotate(-45deg); }
.ticks-violet li::before { border-color: var(--violet); }
.ticks b { display: block; color: var(--text); font-weight: 600; }
.pill { margin-left: 8px; padding: 2px 8px; border: 1px solid color-mix(in srgb, var(--amber) 50%, transparent); border-radius: 99px; color: var(--amber); font: 500 10px var(--mono); font-style: normal; letter-spacing: .05em; text-transform: uppercase; vertical-align: 1px; }

.keychain, .signals { position: relative; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.keychain::before, .signals::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(280px 170px at 90% 0, var(--accent-soft), transparent 70%); }
.signals::before { background: radial-gradient(280px 170px at 10% 0, var(--violet-soft), transparent 70%); }
.keychain > *, .signals > * { position: relative; z-index: 1; }
.panel-label { margin: 0 0 22px; color: var(--dim); font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.panel-foot { margin: 18px 0 0; color: var(--dim); font-size: 12px; }
.kc-node { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.kc-node span { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.kc-node small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.kc-root { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.kc-leaf { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); }
.kc-leaf span { color: var(--accent-text); }
.kc-link { width: 2px; height: 20px; margin: 0 0 0 28px; background: linear-gradient(var(--line), var(--accent)); }

.sig-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sig-name { overflow: hidden; color: var(--text); font: 12px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.sig-type { padding: 3px 9px; border: 1px solid color-mix(in srgb, var(--violet) 40%, transparent); border-radius: 99px; color: var(--violet); font: 500 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.sig-paths { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.sig-paths span { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); font: 12px var(--mono); }
.sig-paths small { margin-left: 6px; color: var(--dim); font-size: 10px; }

/* integrations */
.deliver { padding-top: 120px; }
.section-head { margin-bottom: 36px; }
.deliver-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease; }
.tile:hover { transform: translateY(-4px); border-color: var(--accent); }
.tile-k { margin-bottom: 14px; color: var(--accent-text); font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.tile p { margin-bottom: 22px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.tile-go { margin-top: auto; font-size: 13px; font-weight: 600; }
.tile-wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.1fr; column-gap: 40px; align-items: start; }
.tile-wide .tile-k, .tile-wide p, .tile-wide .tile-go { grid-column: 1; }
.tile-wide .mini-yaml { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
.mini-yaml { overflow-x: auto; padding: 18px 20px; border-radius: 14px; background: var(--code-bg); color: var(--code-text); font-size: 12px; line-height: 1.85; }

/* status */
.status { margin-top: 120px; padding: 44px; border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(130deg, var(--violet-soft), var(--surface) 60%); box-shadow: var(--shadow); }
.status h2 { max-width: 560px; }
.status h2 span { color: var(--violet); }
.status-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0 26px; }
.status-cols > div { padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.status-cols h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-ok { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.dot-open { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.status-cols ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 2; }

/* run */
.run { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 56px; padding-top: 120px; padding-bottom: 120px; }
.run .button { margin-top: 26px; }
.run-code { margin: 0; padding: 28px; overflow-x: auto; border-radius: 18px; background: var(--code-bg); color: var(--code-text); font-size: 13px; line-height: 2.1; box-shadow: var(--shadow); }
.run-code .c { color: #71829b; }


/* polish */
.hero .eyebrow { display: inline-flex; margin-bottom: 22px; padding: 7px 14px 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: 0 6px 20px -10px rgba(20, 30, 60, .25); }
.terminal { border: 1px solid transparent; background: linear-gradient(160deg, #0d1424, var(--code-bg)) padding-box, linear-gradient(135deg, var(--accent), var(--violet) 60%, transparent) border-box; }
.stack { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 4px; padding-bottom: 34px; }
.stack > span { margin-right: 8px; color: var(--dim); font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.stack b { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500; }
.tile-ico { display: grid; width: 44px; height: 44px; margin-bottom: 18px; place-items: center; border-radius: 13px; background: var(--accent-soft); color: var(--accent-text); }
.tile-ico svg { width: 22px; height: 22px; }
.tile { overflow: hidden; }
.tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 70%); opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.tile:hover::after { opacity: 1; }
.tile > * { position: relative; z-index: 1; }
.tile-k { margin-bottom: 10px; }
.module-tag { box-shadow: 0 6px 20px -10px currentColor; }
.hier { background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.run-code { border: 1px solid rgba(143, 132, 255, .25); }


/* simple pages (404) */
.simple-page { max-width: 820px; padding-top: 90px; padding-bottom: 110px; }
.simple-page h1 { margin: 0 0 22px; font-size: clamp(42px, 6vw, 66px); font-weight: 650; letter-spacing: -.06em; line-height: 1.05; }
.simple-page h1 span { background: linear-gradient(100deg, var(--grad-a), var(--grad-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.simple-lede { max-width: 560px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.simple-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* scroll reveal (only when JS is active) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .hero, .module, .run { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding-top: 64px; }
  .module { padding-top: 80px; }
  .module-flip .signals { order: 2; }
  .hier { grid-template-columns: 1fr 1fr; }
  .hier li:nth-child(3) { border-left: 0; }
  .hier li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hier li:nth-child(3)::before { display: none; }
  .deliver-grid { grid-template-columns: 1fr 1fr; }
  .tile-wide { display: flex; }
  .tile-wide .mini-yaml { margin-bottom: 22px; order: 1; }
  .tile-wide .tile-go { order: 2; }
}
@media (max-width: 640px) {
  .site-header { top: 8px; width: calc(100% - 20px); height: 52px; margin-top: 8px; padding: 0 6px 0 16px; }
  .site-header .brand img { width: 88px; }
  .site-header nav { gap: 0; font-size: 13px; }
  .site-header nav > a { padding: 8px 10px; }
  .site-header nav a:not(.nav-github):not(:nth-child(4)) { display: none; }
  .section-wrap, .hero { padding-left: 20px; padding-right: 20px; }
  .hero-lede { font-size: 16px; }
  .terminal-body { font-size: 11px; padding: 18px 16px 22px; }
  .hier { grid-template-columns: 1fr; }
  .hier li + li { border-left: 0; border-top: 1px solid var(--line); }
  .hier li + li::before { top: -9px; left: 24px; margin-top: 0; transform: rotate(90deg); }
  .deliver-grid, .status-cols { grid-template-columns: 1fr; }
  .status { margin-top: 80px; padding: 26px 20px; border-radius: 20px; }
  .deliver, .run { padding-top: 80px; }
  .run { padding-bottom: 80px; }
  .keychain, .signals { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .t-line { opacity: 1; }
  .site-header::after { display: none; }
}
