/* Landing page layout. Tokens, frame and shared components live in site.css. */

em { font-style: normal; color: var(--accent); }
.soft { color: var(--ink-soft); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none; }

/* Hero: a faint grid that fades out towards the bottom */
.hero { position: relative; padding-block: clamp(56px, 9vw, 112px); }
.hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: -1px -1px;
    -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
    mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
    opacity: 0.7;
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 5.6vw, 4.2rem); margin-top: 22px; }
.lede { font-size: 1.12rem; color: var(--muted); margin-top: 22px; max-width: 46ch; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-note { margin-top: 26px; }

.stack { display: grid; gap: 12px; }
.stack-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 12px; min-width: 0; }
.stack-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack-head .label-mono { display: inline-flex; align-items: center; gap: 8px; }
.stack-head .dot { background: var(--accent); }
.cmd-line { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 8px; padding: 9px 12px; box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.cmd-line code { flex: 1; min-width: 0; background: none; border: 0; padding: 0; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--code-ink); }
.cmd-line .p { color: var(--code-muted); margin-right: 6px; }
.stored { display: flex; gap: 12px; align-items: flex-start; }
.check { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.72rem; color: var(--ok); background: var(--ok-soft); flex: none; }
.stored-title { font-weight: 500; font-size: 0.94rem; }
.stored-url { font: 0.8rem var(--font-mono); color: var(--brand); word-break: break-all; margin-top: 2px; }

/* Hero console: the third stack card */
.scenario-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.scenario-tabs button {
    font: 500 0.7rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint);
    background: transparent; border: 0; border-radius: 6px; padding: 4px 8px; cursor: pointer;
}
.scenario-tabs button:hover { color: var(--ink); }
.scenario-tabs button[aria-selected="true"] { color: var(--brand); background: var(--brand-soft); }
.console-log { list-style: none; margin: 0; padding: 4px 0 0; min-height: 168px; display: grid; align-content: start; gap: 8px; font: 0.8rem/1.5 var(--font-mono); color: var(--code-ink); }
.console-log li { display: grid; grid-template-columns: minmax(0, 1fr) auto 52px; gap: 10px; align-items: center; animation: rise 0.25s ease both; }
.console-log .req { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-log .req::before { content: "→ "; color: var(--faint); }
.console-log .t { color: var(--faint); text-align: right; font-size: 0.74rem; }
.console-log .note { display: block; color: var(--brand); font-family: var(--font-body); font-size: 0.85rem; padding-top: 8px; border-top: 1px dashed var(--line-dashed); }
.console-log .waiting .t::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--warn); animation: blink 0.8s infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0.2; } }

/* Three reasons: columns split by hairlines */
.triad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.triad-item { padding: 40px clamp(20px, 3vw, 40px) 48px; display: grid; gap: 10px; align-content: start; }
.triad-item + .triad-item { border-left: 1px solid var(--line); }
.triad-item .icon { width: 20px; height: 20px; fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 18px; }
.triad-item h3 { font-size: 1.1rem; }
.triad-item p { color: var(--muted); font-size: 0.93rem; }

/* Sections */
/* Jumps from the nav land below the sticky header instead of under it. */
section[id] { scroll-margin-top: 72px; }
.section { padding-block: clamp(56px, 8vw, 96px); }
.section-tint { background: var(--surface-2); }
.section-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); max-width: 22ch; margin-top: 14px; }
.section-lede { color: var(--muted); margin-top: 14px; max-width: 60ch; font-size: 1.02rem; }
.big { font-size: clamp(2rem, 4.4vw, 3.2rem); margin-top: 18px; max-width: 16ch; }

.statement { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 40px; align-items: end; }
.statement-copy { display: grid; gap: 14px; color: var(--muted); font-size: 1.02rem; max-width: 46ch; margin-top: 18px; }
.statement-copy p { color: inherit; }

/* Architecture diagram */
.diagram { margin: 56px 0 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(24px, 4vw, 48px); }
.diagram-cols { display: grid; grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1.2fr) 48px minmax(0, 1fr); align-items: end; }
.diagram-col { display: grid; gap: 16px; justify-items: center; min-width: 0; }
.zone { background: var(--surface-2); padding: 3px 8px; border-radius: 2px; }
.zone-brand { background: var(--brand-soft); color: var(--brand); }
.node { width: 100%; display: grid; gap: 6px; padding: 16px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); min-height: 118px; align-content: start; }
.node strong { font-weight: 500; font-size: 1rem; }
.node-sub { font-size: 0.8rem; color: var(--muted); }
.node-brand { background: var(--brand-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent); }
.node-brand strong, .node-brand .label-mono { color: var(--brand); }
.node-brand strong { font-family: var(--font-mono); font-size: 0.86rem; }
.node-dashed { box-shadow: none; border: 1px dashed var(--line-dashed); }
.node-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tokens { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.tokens span { white-space: nowrap; }
.arrow { align-self: center; height: 1px; margin-top: 44px; background-image: linear-gradient(90deg, var(--brand) 50%, transparent 50%); background-size: 6px 1px; position: relative; }
.arrow::after { content: ""; position: absolute; right: 0; top: -3px; border: 3.5px solid transparent; border-left: 5px solid var(--brand); border-right: 0; }
.diagram-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 36px; border-top: 1px solid var(--line); }
.diagram-foot span { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; font-size: 0.82rem; color: var(--muted); }
.diagram-foot span + span { border-left: 1px solid var(--line); }
.diagram-foot .dot { background: var(--ok); }

/* Hairline grids: cells share borders instead of floating as cards */
.grid-2, .grid-3, .grid-4 { display: grid; margin-top: 40px; border-top: 1px solid var(--line); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cell { padding: 28px clamp(20px, 3vw, 36px); display: grid; gap: 10px; align-content: start; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: background 0.15s ease; }
.grid-2 .cell:nth-child(2n), .grid-3 .cell:nth-child(3n), .grid-4 .cell:nth-child(4n) { border-right: 0; }
.cell header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.cell header code { font-size: 0.8rem; }
.cell h3 { font-size: 1.05rem; }
.cell p { color: var(--muted); font-size: 0.93rem; }
a.cell:hover { background: var(--surface-2); color: var(--ink); }
.endpoint header { justify-content: flex-start; }
.endpoint header code { background: none; border: 0; padding: 0; font-size: 0.98rem; color: var(--ink); }

.two-col { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; }
.checklist li { padding: 14px 0 14px 28px; position: relative; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 0.96rem; }
.checklist li:first-child { padding-top: 0; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 14px; font-size: 0.8rem; color: var(--ok); }
.checklist li:first-child::before { top: 0; }
.checklist strong { color: var(--ink); font-weight: 500; }

.numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 56px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.numbers div { padding: 24px clamp(20px, 3vw, 36px); }
.numbers div + div { border-left: 1px solid var(--line); }
.numbers dt { font: 300 2.6rem var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.numbers dd { margin: 6px 0 0; }

.terminal { box-shadow: var(--shadow); }

.cta { padding-block: clamp(64px, 9vw, 112px); text-align: center; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; }
.cta-inner { display: grid; justify-items: center; }
.cta .big { max-width: none; margin-top: 0; }
.cta .lede { margin-inline: auto; }
.cta .hero-actions { justify-content: center; }

/* Try it now */
.try-terminal { margin-top: 28px; }
.try-panel { padding: 20px; display: grid; gap: 18px; min-width: 0; }
.try-panel form { display: grid; gap: 10px; }
.textarea { height: auto; min-height: 200px; padding: 12px; line-height: 1.6; resize: vertical; display: block; }
.try-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 4px; }
.try-actions .btn[disabled] { opacity: 0.7; cursor: progress; transform: none; }
.try-status { font-size: 0.88rem; color: var(--muted); }
.try-status.is-ok { color: var(--ok); }
.try-status.is-error { color: var(--err); }
.try-result { display: grid; gap: 10px; padding-top: 16px; border-top: 1px dashed var(--line-dashed); }
.result-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.result-value { font: 0.82rem var(--font-mono); color: var(--brand); word-break: break-all; background: none; border: 0; padding: 0; }
code.result-value { color: var(--code-ink); }
.token-note { font-size: 0.82rem; color: var(--warn); background: var(--warn-soft); border-radius: 6px; padding: 6px 10px; }
.try-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.try-links a { font-size: 0.84rem; padding: 4px 11px; border-radius: 999px; box-shadow: 0 0 0 1px var(--line); text-decoration: none; color: var(--ink); background: var(--surface); }
.try-links a:hover { box-shadow: 0 0 0 1px var(--brand); color: var(--brand); }
.try-links .try-builder { color: var(--brand); }

/* Builder */
.builder { margin-top: 40px; padding: 0; overflow: hidden; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.presets-label { font: 500 0.7rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-right: 6px; }
.chip {
    font: 500 0.84rem var(--font-body); color: var(--ink);
    background: var(--surface); border: 0; box-shadow: 0 0 0 1px var(--line); border-radius: 999px;
    padding: 6px 13px; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.chip:hover { box-shadow: 0 0 0 1px var(--faint); }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-btn); }

.builder-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.builder-form { display: grid; align-content: start; padding: 8px 24px 24px; border-right: 1px solid var(--line); background: var(--surface); }
.group { border: 0; margin: 0; padding: 18px 0; border-bottom: 1px dashed var(--line-dashed); display: grid; gap: 16px; min-width: 0; }
.group legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; font: 500 0.7rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.group legend + * { clear: both; }

.field { display: grid; gap: 8px; min-width: 0; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 500; font-size: 0.9rem; color: var(--ink); }
.field-head .hint { font-weight: 400; color: var(--faint); font-size: 0.8rem; }
.value { font: 500 0.76rem var(--font-mono); color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; min-width: 52px; text-align: center; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.input, .select select {
    width: 100%; height: 40px;
    font: 400 0.93rem var(--font-body); color: var(--ink);
    background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px;
    padding: 0 12px; transition: box-shadow 0.15s ease;
}
.mono-input { font-family: var(--font-mono); font-size: 0.86rem; }
.input::placeholder { color: var(--faint); }
.input:hover, .select select:hover { box-shadow: inset 0 0 0 1px var(--faint); }
.input:focus, .select select:focus { outline: none; box-shadow: inset 0 0 0 1px var(--brand), 0 0 0 3px var(--brand-soft); }
.select { position: relative; display: block; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer; }
.select::after {
    content: ""; position: absolute; right: 15px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
    border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); pointer-events: none;
}

/* Range: the filled part of the track is driven by --fill, set from JS. */
.range { --fill: 0%; -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--brand) var(--fill), var(--line) var(--fill)); }
.range::-moz-range-track { height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--brand) var(--fill), var(--line) var(--fill)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); transition: transform 0.12s ease; }
.range::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--brand-soft); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--brand-soft); }
.ticks { display: flex; justify-content: space-between; font: 400 0.7rem var(--font-mono); color: var(--faint); margin-top: -4px; }

.step-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mini {
    font: 500 0.74rem var(--font-mono); color: var(--muted);
    background: var(--surface); border: 1px dashed var(--line-dashed); border-radius: 6px; padding: 4px 9px; cursor: pointer;
}
.mini:hover { color: var(--ink); border-color: var(--brand); border-style: solid; }
.mini-clear { font-family: var(--font-body); margin-left: auto; }

.switch { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--line); transition: background 0.15s ease; margin-top: 2px; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s ease; }
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--brand-soft); }
.switch-text { display: grid; font-size: 0.84rem; color: var(--muted); line-height: 1.4; }
.switch-text strong { color: var(--ink); font-size: 0.9rem; font-weight: 500; }

.reset-btn {
    justify-self: start; margin-top: 18px;
    font: 500 0.72rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint);
    background: none; border: 0; padding: 4px 0; cursor: pointer;
}
.reset-btn:hover { color: var(--ink); }

.builder-out { display: grid; gap: 14px; align-content: start; padding: 24px; background: var(--bg); min-width: 0; }
@media (min-width: 961px) {
    .builder-out { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); align-self: start; }
}
.url-pre { white-space: pre-wrap; word-break: break-all; }
.url-pre .u-base { color: var(--code-ink); }
.url-pre .u-sep { color: var(--code-muted); }
.url-pre .u-key { color: var(--code-key); }
.url-pre .u-val { color: var(--code-str); }
.url-pre .u-cmd { color: var(--code-cmd); }

.preview { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); padding: 16px 18px; display: grid; gap: 12px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.preview-head h3 { font: 500 0.7rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.preview-delay { font: 500 0.74rem var(--font-mono); color: var(--warn); background: var(--warn-soft); padding: 2px 9px; border-radius: 999px; }
.preview-outcomes { display: flex; flex-wrap: wrap; gap: 8px; }
.outcome-card { display: grid; gap: 4px; min-width: 96px; padding: 10px 12px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface-2); }
.outcome-card .pill { justify-self: start; font-size: 0.78rem; }
.outcome-card span.label { font-size: 0.78rem; color: var(--muted); }
.outcome-card .bar { height: 3px; border-radius: 999px; background: var(--line); overflow: hidden; }
.outcome-card .bar i { display: block; height: 100%; background: currentColor; }
.outcome-card.s2 { color: var(--ok); }
.outcome-card.s3 { color: var(--info); }
.outcome-card.s4 { color: var(--warn); }
.outcome-card.s5 { color: var(--err); }
.outcome-card, .outcome-card.s2, .outcome-card.s3, .outcome-card.s4, .outcome-card.s5 { background: var(--surface-2); }
.seq-arrow { align-self: center; color: var(--faint); font-size: 0.9rem; }
.outcome { margin: 0; padding: 12px 0 0 18px; border-top: 1px dashed var(--line-dashed); display: grid; gap: 5px; color: var(--muted); font-size: 0.9rem; }
.outcome li.warn { color: var(--warn); list-style: "⚠  "; }

@media (max-width: 960px) {
    .hero-grid, .builder-body, .two-col, .statement { grid-template-columns: minmax(0, 1fr); }
    .builder-form { border-right: 0; border-bottom: 1px solid var(--line); }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 .cell:nth-child(3n), .grid-4 .cell:nth-child(4n) { border-right: 1px solid var(--line); }
    .grid-3 .cell:nth-child(2n), .grid-4 .cell:nth-child(2n) { border-right: 0; }
    .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .numbers div:nth-child(3) { border-left: 0; }
    .numbers div:nth-child(n + 3) { border-top: 1px solid var(--line); }
    .diagram-cols { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .arrow { width: 1px; height: 28px; margin: 0 auto; background-image: linear-gradient(var(--brand) 50%, transparent 50%); background-size: 1px 6px; }
    .arrow::after { right: -3px; top: auto; bottom: 0; border: 3.5px solid transparent; border-top: 5px solid var(--brand); border-bottom: 0; }
}
@media (max-width: 640px) {
    .triad, .grid-2, .grid-3, .grid-4, .diagram-foot { grid-template-columns: minmax(0, 1fr); }
    .triad-item + .triad-item { border-left: 0; border-top: 1px solid var(--line); }
    .diagram-foot span + span { border-left: 0; }
    .cell, .grid-3 .cell:nth-child(3n), .grid-4 .cell:nth-child(4n) { border-right: 0; }
    .field-row { grid-template-columns: minmax(0, 1fr); }
    .result-row { grid-template-columns: minmax(0, 1fr) auto; }
    .result-row .label-mono { grid-column: 1 / -1; }
    .presets, .builder-form, .builder-out { padding-inline: 16px; }
    .console-log li { grid-template-columns: minmax(0, 1fr) auto; }
    .console-log .t { display: none; }
}
