/* Aurora Lab: dark night-sky shell, white "paper" artifacts on top. */
:root {
  --bg: #0b1020;
  --bg-2: #10172b;
  --surface: #141c33;
  --line: rgba(148, 163, 184, 0.16);
  --text: #e6ebf5;
  --muted: #9aa6bf;
  --accent: #2dd4bf;
  --accent-2: #a78bfa;
  --accent-ink: #052e2b;
  --paper: #ffffff;
  --paper-text: #0f172a;
  --paper-muted: #55627a;
  --paper-line: #e2e8f0;
  --paper-tint: #f0fdfa;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 18px 40px -18px rgba(0,0,0,0.6);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fc;
    --bg-2: #eef2f9;
    --surface: #ffffff;
    --line: rgba(15, 23, 42, 0.1);
    --text: #0f172a;
    --muted: #55627a;
    --accent: #0d9488;
    --accent-2: #7c3aed;
    --accent-ink: #ffffff;
    --shadow: 0 1px 2px rgba(15,23,42,0.06), 0 12px 32px -16px rgba(15,23,42,0.18);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--mono); font-size: 0.88em; font-variant-ligatures: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

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

.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand img { border-radius: 50%; }
.nav nav { display: flex; align-items: center; gap: 20px; }
.nav nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav nav a:not(.btn):hover { color: var(--text); }
@media (max-width: 560px) { .nav nav a:not(.btn) { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none; letter-spacing: -0.005em;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -10px var(--accent); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { box-shadow: none; border-color: var(--muted); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 88px 0 72px; isolation: isolate; }
@media (min-width: 720px) { .hero { padding: 128px 0 104px; } }
.aurora { position: absolute; inset: -20% -10% auto -10%; height: 140%; z-index: -1; filter: blur(48px); opacity: .55; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(40% 30% at 22% 28%, rgba(45, 212, 191, .55), transparent 70%),
    radial-gradient(35% 26% at 62% 18%, rgba(74, 222, 128, .35), transparent 70%),
    radial-gradient(38% 30% at 82% 40%, rgba(167, 139, 250, .40), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
.aurora::after { animation-duration: 26s; animation-direction: alternate-reverse; opacity: .6; transform: scaleX(-1); }
@keyframes drift { from { transform: translate3d(-3%, 0, 0) skewX(-6deg); } to { transform: translate3d(4%, 4%, 0) skewX(6deg); } }
@media (prefers-reduced-motion: reduce) { .aurora::before, .aurora::after { animation: none; } }
@media (prefers-color-scheme: light) { .aurora { opacity: .35; } }

.eyebrow { margin: 0 0 12px; color: var(--accent); font: 500 13px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(40px, 7vw, 68px); }
h2 { font-size: clamp(30px, 4.4vw, 42px); }
h3 { font-size: 24px; }
.lede { max-width: 640px; margin: 22px 0 0; font-size: clamp(17px, 2vw, 19px); color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.cta.center { justify-content: center; margin-top: 40px; }
.areas { list-style: none; padding: 0; margin: 44px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 15px; }
.areas li { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.d1 { background: #2dd4bf; } .d2 { background: #4ade80; } .d3 { background: #60a5fa; } .d4 { background: #a78bfa; }

/* Sections */
.section { padding: 72px 0; border-top: 1px solid var(--line); }
@media (min-width: 720px) { .section { padding: 104px 0; } }
.section-lede { max-width: 720px; color: var(--muted); margin: 18px 0 0; font-size: 17px; }
.eq { font-family: var(--serif); color: var(--text); white-space: nowrap; font-size: 1.05em; }

.pipeline { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; counter-reset: none; }
@media (min-width: 720px) { .pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pipeline a {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px;
}
.pipeline a:hover { border-color: var(--accent); }
.pipeline span { color: var(--accent); font: 500 12px var(--mono); }

/* Example blocks */
.example { display: grid; gap: 28px; margin-top: 72px; scroll-margin-top: 84px; }
@media (min-width: 960px) {
  .example { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
  .example .ex-copy { position: sticky; top: 92px; }
  .example.wide { grid-template-columns: minmax(0, 1fr); }
  .example.wide .ex-copy { position: static; max-width: 720px; }
}
.ex-num { margin: 0 0 10px; color: var(--muted); font: 500 13px var(--mono); }
.ex-copy p { color: var(--muted); }
.ex-copy h3 { margin-bottom: 14px; }
.ask {
  margin: 18px 0; padding: 14px 16px; border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 0 10px 10px 0;
  color: var(--text) !important; font-family: var(--serif); font-style: italic; font-size: 17px;
}
.ask span { display: block; font: 500 11px var(--mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }

/* Paper artifacts */
.paper {
  margin: 0; background: var(--paper); color: var(--paper-text);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.doc { padding: 24px 20px; font-size: 15.5px; line-height: 1.65; }
@media (min-width: 720px) { .doc { padding: 32px 36px; } }
.doc p { margin: 0 0 12px; }
.doc h4 { font-size: 22px; margin: 0 0 18px; color: var(--paper-text); }
.doc-kicker { font: 500 11px var(--mono) !important; letter-spacing: .1em; text-transform: uppercase; color: #0d9488; margin-bottom: 8px !important; }
.doc-h { font-weight: 600; margin-top: 20px !important; margin-bottom: 4px !important; }
.refs { margin: 0 0 8px; padding-left: 20px; }
.refs li { margin-bottom: 14px; }
.refs li::marker { color: #0d9488; font-weight: 600; }
.refs span { display: block; color: var(--paper-muted); margin-top: 4px; }
.doc i, .doc em { font-family: var(--serif); }

.table-scroll { overflow-x: auto; margin: 16px 0 18px; border: 1px solid var(--paper-line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
caption { text-align: left; padding: 10px 14px; font-size: 13px; color: var(--paper-muted); border-bottom: 1px solid var(--paper-line); }
th, td { padding: 7px 14px; text-align: left; border-bottom: 1px solid var(--paper-line); white-space: nowrap; }
th { font-weight: 600; background: #f8fafc; }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
td.muted { color: var(--paper-muted); }
tr.hl td { background: var(--paper-tint); font-weight: 600; }
@media (max-width: 480px) { th, td { padding: 7px 8px; } td.num { font-size: 12px; } }

pre {
  margin: 16px 0 0; padding: 16px 18px; border-radius: 10px; overflow-x: auto;
  background: #0b1020; color: #e6ebf5; font: 13px/1.6 var(--mono);
}
pre .c { color: #7dd3c7; }

/* Before/after slider */
.compare { padding: 12px; }
.compare-stage { position: relative; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.compare-stage img { width: 100%; }
.compare-before { position: absolute; inset: 0; height: 100%; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #0d9488; pointer-events: none; }
.compare-line::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%; background: #0d9488; color: #fff;
  display: grid; place-items: center; font: 600 15px var(--sans); box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.tag { position: absolute; top: 10px; padding: 4px 9px; border-radius: 999px; font: 500 11px var(--mono); background: rgba(11,16,32,.78); color: #fff; pointer-events: none; }
.tag-left { left: 10px; } .tag-right { right: 10px; background: #0d9488; }
.compare-range { width: 100%; margin: 12px 0 2px; accent-color: #0d9488; height: 28px; cursor: ew-resize; }

.fig-grid { display: grid; gap: 24px; }
.fig-grid .paper img { padding: 16px 16px 0; margin: 0 auto; }
.fig-grid .paper:first-child img { max-width: min(100%, 860px); }
figcaption { padding: 14px 20px 20px; font-size: 14px; line-height: 1.6; color: var(--paper-muted); }
figcaption b { color: var(--paper-text); }

/* Writing */
.write-grid { display: grid; gap: 20px; }
@media (min-width: 960px) { .write-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .changes { grid-column: 1 / -1; } }
.prose { font-family: var(--serif); font-size: 18px; line-height: 1.7; }
.draft { background: #fbfaf7; }
.draft .doc-kicker { color: #b45309; }
.changes { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 8px; }
.changes .doc-kicker { color: var(--accent); }
.changes ol { margin: 0; padding-left: 20px; color: var(--muted); }
.changes li { margin-bottom: 10px; }
.changes li::marker { color: var(--accent); font-weight: 600; }

/* How it works */
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 16px; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.steps span { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font: 600 14px var(--mono); }
.steps h3 { font-size: 20px; margin: 14px 0 8px; }
.steps p { margin: 0; color: var(--muted); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.footer .brand { color: var(--muted); font-weight: 500; }
.footer nav { display: flex; gap: 18px; }
.footer nav a { color: var(--muted); }

/* ---------- Docs pages ---------- */
.docs-hero { padding: 56px 0 32px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; isolation: isolate; }
.docs-hero .aurora { opacity: .35; }
.crumbs { font: 500 13px var(--mono); color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: var(--muted); }
.docs-hero h1 { font-size: clamp(34px, 5.5vw, 52px); }
.docs-hero .lede { margin-top: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding: 0; list-style: none; }
.meta li { font: 500 12.5px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; background: var(--surface); }
.docs { display: grid; gap: 40px; padding-top: 48px; padding-bottom: 88px; }
@media (min-width: 980px) { .docs { grid-template-columns: 220px minmax(0, 1fr); gap: 56px; } }
.toc { font-size: 14px; }
@media (min-width: 980px) { .toc { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; } }
.toc p { margin: 0 0 8px; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
@media (max-width: 979px) { .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.toc a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); background: var(--surface); }
.prose-doc { max-width: 760px; min-width: 0; }
.prose-doc section { scroll-margin-top: 84px; padding-bottom: 8px; }
.prose-doc h2 { font-size: 28px; margin: 48px 0 14px; }
.prose-doc section:first-child h2 { margin-top: 0; }
.prose-doc h3 { font-size: 19px; margin: 26px 0 8px; }
.prose-doc p, .prose-doc li { color: var(--muted); }
.prose-doc p strong, .prose-doc li strong { color: var(--text); }
.prose-doc ul, .prose-doc ol.steps-list { padding-left: 20px; }
.prose-doc li { margin-bottom: 6px; }
.prose-doc li::marker { color: var(--accent); }
.prose-doc code { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--text); }
.prose-doc pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose-doc pre { margin: 14px 0 18px; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 18px 0; }
.callout p { margin: 0; }
.doc-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 14px 0 20px; }
.doc-table table { font-size: 14px; }
.doc-table th { background: var(--surface); color: var(--text); }
.doc-table th, .doc-table td { border-bottom: 1px solid var(--line); white-space: normal; vertical-align: top; }
.doc-table td { color: var(--muted); }
.doc-table td code { white-space: nowrap; }
.shots { display: grid; gap: 18px; margin: 16px 0 8px; }
.shots figure { margin: 0; }
.shots img { border-radius: 12px; border: 1px solid var(--line); background: #fff; width: 100%; }
.shots figcaption { color: var(--muted); padding: 8px 2px 0; font-size: 14px; }
.prompt { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--text) !important; }
.skill-cards { display: grid; gap: 16px; margin-top: 36px; }
@media (min-width: 820px) { .skill-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.skill-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.skill-card:hover { border-color: var(--accent); }
.skill-card img { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.skill-card h3 { font-size: 20px; margin: 0 0 6px; }
.skill-card p { margin: 0; color: var(--muted); font-size: 15px; }
.skill-card .soon { opacity: .6; }
.prose-doc ol { padding-left: 20px; }
.prose-doc li em { font-family: var(--serif); font-size: 1.05em; color: var(--text); }
.prose-doc h2 code { font-size: .8em; }
@media (prefers-color-scheme: dark) { .prose-doc pre { background: #141c33; border: 1px solid var(--line); } }
@media (max-width: 600px) { .doc-table td code { white-space: normal; overflow-wrap: anywhere; } .doc-table th, .doc-table td { padding: 8px 10px; } }
