/* Tironian site. Dark by design: the brand is a violet quill on black. */
:root {
  --bg: #000;
  --bg-2: #07060b;
  --panel: #0c0b12;
  --panel-2: #12101b;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #eeebf6;
  --muted: #9d98b1;
  --faint: #6c6781;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-3: #c4b5fd;
  --accent-ink: #1b0f3a;
  --glow: rgba(139, 92, 246, 0.35);
  --mark: rgba(139, 92, 246, 0.32);
  --ok: #5eead4;
  --warn: #fbbf24;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p a, li a, .link { color: var(--accent-3); text-decoration: underline; text-decoration-color: rgba(196, 181, 253, 0.35); text-underline-offset: 3px; }
p a:hover, li a:hover, .link:hover { text-decoration-color: var(--accent-3); }
code, pre, kbd, .mono { font-family: var(--mono); }
p code, li code, td code, dd code {
  font-size: 0.86em; background: rgba(139, 92, 246, 0.12); color: var(--accent-3);
  padding: 0.12em 0.4em; border-radius: 5px;
}
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute; left: -9999px; }
.sr-only:focus { left: 16px; top: 12px; z-index: 100; background: #fff; color: #000; padding: 8px 12px; border-radius: 8px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }

/* Grid paper behind the hero, fading out at the edges */
.grid-bg { position: relative; isolation: isolate; }
.grid-bg::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 30%, transparent 75%);
}
html { overflow-x: clip; }
.glow { overflow: hidden; }
.glow::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 720px; height: 720px; left: 50%; top: -260px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(139, 92, 246, 0.22), transparent 62%);
  filter: blur(10px);
}

/* Header */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.72); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: 0.01em; font-size: 17px; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--muted); font-size: 14.5px; padding: 6px 10px; border-radius: 8px; transition: color .15s, background .15s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.head-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 9px; width: 40px; height: 36px; cursor: pointer; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 16px; height: 1.5px; background: currentColor; margin: 0 auto; position: relative; transition: transform .2s; }
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -5px; } .menu-btn span::after { top: 5px; }
.menu-open .menu-btn span { background: transparent; }
.menu-open .menu-btn span::before { transform: translateY(5px) rotate(45deg); }
.menu-open .menu-btn span::after { transform: translateY(-5px) rotate(-45deg); }

/* Buttons and keyboard chips (shortcuts work: see site.js) */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px;
  border-radius: 10px; font-weight: 550; font-size: 15px; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .2s; white-space: nowrap; font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 28px -8px var(--glow); }
.btn-accent:hover { background: #7c4def; }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
kbd, .kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  font-size: 11px; font-weight: 600; border-radius: 5px; line-height: 1;
  border: 1px solid currentColor; opacity: 0.6;
}
.btn-primary kbd { border-color: rgba(0, 0, 0, 0.35); }

/* Hero */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2); }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
h1, h2, h3 { letter-spacing: -0.02em; margin: 0; }
.display { font-size: clamp(40px, 6.2vw, 70px); line-height: 1.02; font-weight: 600; margin: 18px 0 20px; }
.display .soft { color: var(--muted); font-weight: 400; }
.hl { background: linear-gradient(transparent 12%, var(--mark) 12%, var(--mark) 92%, transparent 92%); padding: 0 0.12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.lede { font-size: 18.5px; color: var(--muted); max-width: 56ch; margin: 0 0 28px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta-note { font-size: 13px; color: var(--faint); margin-top: 12px; }

/* Command box: "GET STARTED LOCALLY" */
.cmd-label { font: 600 11.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin: 30px 0 10px; }
.cmd {
  display: flex; align-items: center; gap: 12px; max-width: 520px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 10px 10px 14px;
  font: 14px/1.4 var(--mono);
}
.cmd .prompt { color: var(--accent-2); user-select: none; }
.cmd code { flex: 1; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.copy-btn {
  flex: none; background: rgba(255, 255, 255, 0.05); color: var(--muted); border: 1px solid var(--line-2);
  border-radius: 7px; height: 30px; padding: 0 10px; font: 500 12.5px/1 var(--sans); cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent-2); }
.copy-btn.done { color: var(--ok); border-color: rgba(94, 234, 212, 0.4); }
details.explain { max-width: 520px; margin-top: 8px; font-size: 14px; color: var(--muted); }
details.explain summary { cursor: pointer; color: var(--faint); font-size: 13px; list-style: none; }
details.explain summary::before { content: "+ "; color: var(--accent-2); }
details.explain[open] summary::before { content: "− "; }
details.explain p { margin: 8px 0 0; }

/* Hero circuit: the logo in the middle, the pieces it connects around it */
.circuit { position: relative; aspect-ratio: 1 / 1; max-width: 520px; width: 100%; margin-left: auto; }
.circuit svg.wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wires path { fill: none; stroke: rgba(167, 139, 250, 0.28); stroke-width: 1; }
.wires .pulse { stroke: var(--accent-2); stroke-width: 1.6; stroke-dasharray: 6 260; stroke-linecap: round; animation: travel 4.5s linear infinite; filter: drop-shadow(0 0 4px var(--accent)); }
.wires .pulse:nth-of-type(2n) { animation-delay: -1.5s; } .wires .pulse:nth-of-type(3n) { animation-delay: -3s; }
@keyframes travel { from { stroke-dashoffset: 266; } to { stroke-dashoffset: 0; } }
.core {
  position: absolute; left: 35%; top: 35%; width: 30%; height: 30%;
  background: radial-gradient(circle at 50% 40%, #16122a, #07060c 70%); border: 1px solid var(--line-2); border-radius: 22px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 60px -10px var(--glow), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.core img { width: 80%; height: 80%; object-fit: contain; }
.node {
  position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 6px;
  font: 500 11.5px/1.2 var(--mono); color: var(--muted); text-align: center; width: 112px;
}
.node b {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line-2); color: var(--text); font: 600 13px/1 var(--sans);
}
.node b svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Langfuse-style frame with crop marks and hatched gutters */
.frame { position: relative; border: 1px solid var(--line); background: rgba(12, 11, 18, 0.55); }
.frame > .corner { position: absolute; width: 12px; height: 12px; border-color: var(--accent-2); border-style: solid; opacity: 0.8; }
.frame > .tl { left: -1px; top: -1px; border-width: 1px 0 0 1px; }
.frame > .tr { right: -1px; top: -1px; border-width: 1px 1px 0 0; }
.frame > .bl { left: -1px; bottom: -1px; border-width: 0 0 1px 1px; }
.frame > .br { right: -1px; bottom: -1px; border-width: 0 1px 1px 0; }
.hatch { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 9px); }

/* Facts strip (true numbers only) */
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.facts span { display: inline-flex; gap: 6px; align-items: baseline; }
.facts b { color: var(--text); font-weight: 600; }
.facts i { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); align-self: center; }

/* Built-on strip */
.built-on { padding: 34px 0 10px; text-align: center; }
.built-on p { color: var(--faint); font-size: 13.5px; margin: 0 0 18px; }
.built-on ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; }
.built-on li { font: 600 17px/1 var(--sans); color: #6f6a86; letter-spacing: -0.01em; transition: color .2s; }
.built-on li:hover { color: var(--text); }
.built-on li small { font: 500 11px/1 var(--mono); color: var(--faint); margin-left: 6px; }

/* Sections */
section { padding: 96px 0; }
.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.kicker { font: 600 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 16px; display: block; }
.num { font: 500 15px/1 var(--mono); color: var(--faint); margin-right: 10px; }
.h2 { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.06; font-weight: 600; }
.h2 .accent { color: var(--accent-2); }
.h2 .soft { color: var(--muted); font-weight: 400; }
.sub { color: var(--muted); font-size: 18px; margin: 16px 0 0; max-width: 62ch; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Feature rows (Helicone's numbered sections) */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 56px 0; border-top: 1px solid var(--line); }
.feature:first-of-type { border-top: 0; }
.feature.flip .feature-copy { order: 2; }
.feature-copy h3 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.1; font-weight: 600; margin: 14px 0 14px; }
.feature-copy h3 .accent { color: var(--accent-2); }
.feature-copy p { color: var(--muted); font-size: 17px; margin: 0 0 18px; }
.ticks { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; color: var(--muted); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 8px; border-left: 2px solid var(--accent-2); border-bottom: 2px solid var(--accent-2); transform: rotate(-45deg); }
.ticks li b { color: var(--text); font-weight: 600; }

/* Product mock, tilted like Helicone's dashboard cards */
.mock-stage { perspective: 1600px; }
.mock {
  background: linear-gradient(180deg, #100e18, #0a0910); border: 1px solid var(--line-2); border-radius: 16px; padding: 16px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02), 0 0 90px -40px var(--glow);
  transform: rotateX(8deg) rotateY(-10deg) rotateZ(1deg); transition: transform .6s ease; font-size: 13px;
}
.mock-stage:hover .mock { transform: rotateX(2deg) rotateY(-3deg); }
.mock-bar { display: flex; gap: 6px; margin-bottom: 12px; }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a2635; }
.mock-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.mock-title b { font-size: 15px; }
.mock-title span { color: var(--faint); font: 12px var(--mono); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: rgba(255, 255, 255, 0.015); }
.tile small { display: block; color: var(--faint); font: 10px/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.tile strong { display: block; font-size: 19px; margin-top: 4px; font-weight: 600; }
.rows { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.row { display: grid; grid-template-columns: 1.6fr 0.6fr 0.9fr 1fr; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--line); align-items: center; color: var(--muted); }
.row:first-child { border-top: 0; color: var(--faint); font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.row b { color: var(--text); font-weight: 500; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px/1 var(--mono); padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line-2); width: max-content; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live { color: var(--accent-2); border-color: rgba(167, 139, 250, 0.35); }
.pill.shadow { color: var(--ok); border-color: rgba(94, 234, 212, 0.3); }
.pill.fail { color: var(--warn); border-color: rgba(251, 191, 36, 0.3); }
.pill.learn { color: var(--faint); }
.bar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; }
.bar .gate { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--warn); }

/* Terminal mock */
.term { background: #08070d; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; font: 13px/1.7 var(--mono); box-shadow: 0 30px 70px -40px #000; }
.term-head { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.term-head i { width: 9px; height: 9px; border-radius: 50%; background: #2a2635; }
.term-head span { margin-left: 8px; }
.term pre { margin: 0; padding: 16px 18px; overflow-x: auto; color: #d8d3ea; }
.t-c { color: var(--accent-2); } .t-m { color: var(--faint); } .t-ok { color: var(--ok); } .t-w { color: var(--warn); }

/* The loop (Phoenix's OBSERVE ... MEASURE tabs) */
.loop-tabs { display: flex; gap: 6px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: var(--bg-2); width: max-content; max-width: 100%; margin: 0 auto 26px; }
.loop-tabs button {
  background: none; border: 0; color: var(--muted); font: 600 12.5px/1 var(--mono); letter-spacing: 0.1em;
  padding: 11px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center;
}
.loop-tabs button span { color: var(--faint); font-weight: 500; }
.loop-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }
.loop-tabs button[aria-selected="true"] span { color: rgba(255, 255, 255, 0.7); }
.loop-panel { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: center; padding: 34px; border-radius: 18px; }
.loop-panel[hidden] { display: none; }
.loop-panel h3 { font-size: 30px; margin: 10px 0 12px; font-weight: 600; }
.loop-panel p { color: var(--muted); margin: 0 0 16px; font-size: 16.5px; }

/* Cards */
.cards { display: grid; gap: 16px; }
.cards.c2 { grid-template-columns: repeat(2, 1fr); }
.cards.c3 { grid-template-columns: repeat(3, 1fr); }
.cards.c4 { grid-template-columns: repeat(4, 1fr); }
.card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)); transition: border-color .2s, transform .2s; }
.card:hover { border-color: rgba(167, 139, 250, 0.35); }
a.card:hover { transform: translateY(-2px); }
.card .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(139, 92, 246, 0.12); color: var(--accent-2); margin-bottom: 16px; border: 1px solid rgba(139, 92, 246, 0.25); }
.card .ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.card .more { display: inline-block; margin-top: 14px; color: var(--accent-3); font: 600 12.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.card .tag { position: absolute; top: 18px; right: 18px; font: 600 10.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2); border: 1px solid rgba(167, 139, 250, 0.35); padding: 4px 7px; border-radius: 6px; }

/* Big quote (Helicone) */
.quote { text-align: center; padding: 110px 0; background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(139, 92, 246, 0.1), transparent 70%); }
.quote blockquote { margin: 0 auto; max-width: 900px; font-size: clamp(28px, 4.2vw, 50px); line-height: 1.12; font-weight: 600; letter-spacing: -0.025em; color: var(--faint); }
.quote blockquote b { color: var(--text); font-weight: 600; }
.quote cite { display: block; margin-top: 26px; font-style: normal; color: var(--muted); font-size: 15px; }
.quote cite span { display: block; color: var(--faint); font-size: 13.5px; margin-top: 4px; }

/* Install tabs (Langfuse) */
.tabs { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg-2); }
.tab-list { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab-list button { background: none; border: 0; border-right: 1px solid var(--line); color: var(--muted); padding: 14px 18px; font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; }
.tab-list button[aria-selected="true"] { color: var(--text); background: rgba(139, 92, 246, 0.1); box-shadow: inset 0 -2px 0 var(--accent); }
.tab-panel { padding: 22px; }
.tab-panel[hidden] { display: none; }
.tab-panel pre { margin: 0; background: #06050a; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; overflow-x: auto; font: 13.5px/1.75 var(--mono); color: #d8d3ea; }
.tab-panel p { color: var(--muted); margin: 14px 0 0; font-size: 15px; }

/* FAQ (Helicone layout, Langfuse wording style) */
.faq { display: grid; grid-template-columns: 0.8fr 1.6fr; gap: 48px; }
.faq-side { position: sticky; top: 96px; align-self: start; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative; font-size: 17.5px; font-weight: 500;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .2s;
}
.faq-list details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq-list summary:hover { color: var(--accent-3); }
.faq-list .answer { color: var(--muted); padding: 0 40px 22px 0; }
.faq-list .answer p { margin: 0 0 12px; }
.faq-cat { font: 600 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2); margin: 40px 0 4px; }
.faq-cat:first-child { margin-top: 0; }

/* Closing call to action */
.final { text-align: center; padding: 120px 0; position: relative; overflow: hidden; }
.final .h2 { font-size: clamp(34px, 5vw, 60px); }
.final .cta-row { justify-content: center; margin-top: 30px; }
.final img.mark-big { width: 96px; margin: 0 auto 26px; filter: drop-shadow(0 0 30px var(--glow)); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 64px 0 40px; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 30px; }
.foot-brand img { width: 160px; margin-bottom: 14px; }
.foot-brand p { color: var(--faint); margin: 0; max-width: 32ch; }
.foot-col h4 { margin: 0 0 14px; font: 600 11.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.foot-col a { display: block; color: var(--muted); padding: 4px 0; }
.foot-col a:hover { color: var(--text); }
.foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }

/* Docs layout (Langfuse-style sidebar) */
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; padding: 48px 0 96px; }
.doc-side { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 8px; font-size: 14px; }
.doc-side h5 { margin: 22px 0 8px; font: 600 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.doc-side h5:first-child { margin-top: 0; }
.doc-side a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--muted); border-left: 1px solid var(--line); border-radius: 0 7px 7px 0; }
.doc-side a:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.doc-side a.on { color: var(--accent-3); border-left-color: var(--accent); background: rgba(139, 92, 246, 0.08); }
.side-card { margin-top: 26px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--bg-2); }
.side-card dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 13px; }
.side-card dt { color: var(--faint); } .side-card dd { margin: 0; color: var(--text); font-family: var(--mono); }
.prose { max-width: 780px; }
.prose h1 { font-size: clamp(34px, 4.6vw, 48px); line-height: 1.08; font-weight: 600; margin: 10px 0 16px; }
.prose h2 { font-size: 26px; margin: 56px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); font-weight: 600; scroll-margin-top: 90px; }
.prose h3 { font-size: 19px; margin: 32px 0 10px; font-weight: 600; scroll-margin-top: 90px; }
.prose p, .prose li { color: #c9c4db; }
.prose .lead { font-size: 19px; color: var(--muted); }
.prose ul, .prose ol { padding-left: 22px; } .prose li { margin: 6px 0; }
.prose pre { background: #07060c; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font: 13.5px/1.75 var(--mono); color: #d8d3ea; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font: 600 11.5px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.prose td:first-child { white-space: nowrap; }
.callout { border: 1px solid rgba(139, 92, 246, 0.35); background: rgba(139, 92, 246, 0.07); border-radius: 12px; padding: 14px 16px; margin: 20px 0; color: #d9d2f5; font-size: 15px; }
.callout b { color: #fff; }
.callout.warn { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.06); }
.toc-mobile { display: none; }

/* Page hero for inner pages */
.page-hero { padding: 76px 0 40px; text-align: center; }
.page-hero .display { font-size: clamp(36px, 5.4vw, 60px); }
.page-hero .lede { margin: 0 auto; }

/* Cost calculator */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 18px; overflow: hidden; }
.calc-in { padding: 28px; border-right: 1px solid var(--line); }
.calc-out { padding: 28px; background: rgba(139, 92, 246, 0.05); display: grid; align-content: center; gap: 18px; }
.calc label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.calc label b { color: var(--text); font-family: var(--mono); }
.calc input[type="range"] { width: 100%; accent-color: var(--accent); margin-bottom: 22px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; margin-bottom: 22px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 9px 14px; font: 500 13.5px var(--sans); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.big-num { font-size: 52px; font-weight: 650; letter-spacing: -0.03em; line-height: 1; }
.big-num small { font-size: 16px; color: var(--muted); font-weight: 500; margin-left: 6px; letter-spacing: 0; }
.calc-out p { margin: 0; color: var(--muted); font-size: 14px; }
.price-cards .card { display: flex; flex-direction: column; }
.price { font-size: 40px; font-weight: 650; letter-spacing: -0.03em; margin: 8px 0 4px; }
.price small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.price-cards .ticks { margin-top: 14px; }
.price-cards .card.featured { border-color: rgba(139, 92, 246, 0.5); box-shadow: 0 0 60px -30px var(--glow); }

/* Changelog timeline */
.timeline { position: relative; max-width: 820px; margin: 0 auto; }
.timeline::before { content: ""; position: absolute; left: 132px; top: 8px; bottom: 0; width: 1px; background: var(--line); }
.entry { display: grid; grid-template-columns: 132px 1fr; gap: 32px; padding: 0 0 54px; position: relative; }
.entry::before { content: ""; position: absolute; left: 128px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px #000, 0 0 14px var(--accent); }
.entry time { font: 500 13px/1.6 var(--mono); color: var(--faint); text-align: right; padding-right: 8px; }
.entry h3 { font-size: 21px; margin: 0 0 10px; font-weight: 600; }
.entry p, .entry li { color: var(--muted); }
.entry ul { padding-left: 20px; margin: 10px 0 0; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .wires .pulse { animation: none; display: none; }
  .mock { transform: none; }
  html { scroll-behavior: auto; }
}

/* Toast for shortcuts and copy */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; background: #16131f; border: 1px solid var(--line-2); color: var(--text); padding: 10px 16px; border-radius: 10px; font-size: 14px; transition: all .25s; z-index: 80; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Grid and flex children default to min-width: auto, which lets one long code line widen
   the whole page on a phone. Let them shrink; wide content scrolls inside its own box. */
.hero-grid > *, .feature > *, .loop-panel > *, .faq > *, .calc > *, .doc-layout > *, .cards > *, .foot-grid > *, .entry > * { min-width: 0; }
.term, .tabs, .mock, .prose pre { max-width: 100%; }

/* Responsive */
@media (max-width: 1000px) {
  .hero-grid, .feature, .loop-panel, .faq, .calc { grid-template-columns: 1fr; }
  .feature.flip .feature-copy { order: 0; }
  .circuit { margin: 10px auto 0; max-width: 460px; }
  .cards.c4 { grid-template-columns: repeat(2, 1fr); }
  .cards.c3 { grid-template-columns: repeat(2, 1fr); }
  .faq-side { position: static; }
  .calc-in { border-right: 0; border-bottom: 1px solid var(--line); }
  .foot-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-brand { grid-column: 1 / -1; }
  .doc-layout { grid-template-columns: 1fr; gap: 0; }
  .doc-side { display: none; }
  .toc-mobile { display: block; margin: 0 0 24px; }
  .toc-mobile select { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font: 14px var(--sans); }
}
.nav-wrap { display: flex; align-items: center; gap: 28px; flex: 1; }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav-wrap { display: none; }
  .menu-open .nav-wrap {
    display: flex; flex-direction: column; align-items: stretch; gap: 14px; position: absolute; left: 0; right: 0; top: 64px;
    background: #050408; border-bottom: 1px solid var(--line); padding: 10px 20px 20px; max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .menu-open .nav { flex-direction: column; gap: 2px; }
  .menu-open .nav a { padding: 12px 10px; font-size: 16px; }
  .menu-open .head-actions { display: flex; }
  .site-head .wrap { gap: 12px; }
}
@media (max-width: 640px) {
  section { padding: 64px 0; }
  .hero { padding: 44px 0 20px; }
  .cards.c2, .cards.c3, .cards.c4 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1.4fr 0.8fr 1fr; }
  .row > :nth-child(2) { display: none; }
  .mock { transform: none; }
  .loop-panel { padding: 20px; }
  .loop-tabs { width: 100%; }
  .loop-tabs button { flex: 1 1 30%; justify-content: center; padding: 10px 6px; }
  .node { width: 76px; font-size: 10px; }
  .node b { width: 36px; height: 36px; border-radius: 10px; }
  .node b svg { width: 18px; height: 18px; }
  .timeline::before { left: 4px; }
  .entry { grid-template-columns: 1fr; gap: 6px; padding-left: 26px; }
  .entry::before { left: 0; }
  .entry time { text-align: left; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .quote { padding: 72px 0; }
  .big-num { font-size: 42px; }
}
