/* caira.si: one stylesheet, no framework. Tokens first, then layout, components and the demos. */

:root {
    --bg: #f5f5f1;
    --surface: #ffffff;
    --sunken: #ecece7;
    --line: #d9dad3;
    --line-2: #c3c5bc;
    --ink: #171b21;
    --ink-2: #434b57;
    --ink-3: #6b7482;
    --accent: #1f4fd8;
    --accent-hover: #183fb0;
    --accent-ink: #ffffff;
    --accent-soft: #e3eafc;
    --amber: #a85600;
    --amber-soft: #fbead3;
    --green: #137a4c;
    --green-soft: #dcf2e6;
    --red: #b9382b;
    --red-soft: #f9e1dc;
    --grid: rgba(23, 27, 33, .055);
    --shadow: 0 1px 2px rgba(23, 27, 33, .06), 0 12px 32px rgba(23, 27, 33, .08);
    --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --gutter: clamp(16px, 4vw, 40px);
    --radius: 12px;
    color-scheme: light;
}

/* The site is always light, whatever the visitor's system setting. */

/* ── base ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; text-wrap: balance; font-weight: 600; }
h1 { font-size: clamp(34px, 4.6vw, 58px); letter-spacing: -.03em; }
h2 { font-size: clamp(27px, 3.2vw, 40px); }
h3 { font-size: 19px; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 2px; }
code { font-family: var(--mono); font-size: .9em; background: var(--sunken); padding: .1em .35em; border-radius: 4px; }
button, input, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

.wrap { max-width: 1180px; margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 120px); }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.eyebrow {
    font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 14px;
}
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); max-width: 62ch; margin-bottom: 1.4em; }
.footnote { font-size: 14px; color: var(--ink-3); max-width: 72ch; margin-top: 28px; }

/* ── buttons ──────────────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line-2);
    background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; }
.btn-lg { padding: 13px 22px; font-size: 17px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── header ───────────────────────────────────────────────────────── */

.top {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease;
}
.top.scrolled { border-bottom-color: var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 21px; letter-spacing: -.02em; }
.mark { width: 28px; height: 28px; color: var(--accent); }
.mark.small { width: 20px; height: 20px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; display: block; box-shadow: 0 0 0 2px var(--surface); }
.avatar.sm { width: 24px; height: 24px; }
.avatar.lg { width: 60px; height: 60px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); }
.hero-who { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.hero-who .eyebrow { margin: 0; }
.hero-who small { display: block; font-size: 14px; color: var(--ink-3); margin-top: 1px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) {
    position: relative; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px;
    padding: 8px 12px; border-radius: 8px;
}
.nav a:not(.btn):hover { color: var(--ink); background: var(--sunken); }
.nav a:not(.btn)::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px;
    background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.nav a.active::after { transform: scaleX(1); }
.nav-cta { margin-left: 10px; }
.menu-btn {
    display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
    flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer;
}
.menu-btn span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 880px) {
    .menu-btn { display: flex; }
    .nav {
        position: absolute; top: 66px; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 2px;
        padding: 10px var(--gutter) 16px; background: var(--surface); border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        transform: translateY(-8px); opacity: 0; pointer-events: none; transition: transform .2s ease, opacity .2s ease;
    }
    .nav.open { transform: none; opacity: 1; pointer-events: auto; }
    .nav a:not(.btn) { padding: 12px; font-size: 16px; }
    .nav a:not(.btn)::after { display: none; }
    .nav-cta { margin: 8px 0 0; }
}

/* ── hero ─────────────────────────────────────────────────────────── */

.hero {
    position: relative; overflow: hidden;
    padding-block: clamp(48px, 7vw, 96px) clamp(56px, 8vw, 110px);
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: center top;
}
.hero::after {
    content: ""; position: absolute; inset: auto 0 0 0; height: 160px;
    background: linear-gradient(transparent, var(--bg)); pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-copy h1 { margin-bottom: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 30px; }
.hero-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink-2); font-size: 15px; }
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.hero-facts li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.hero-facts strong { color: var(--ink); font-weight: 600; }

@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; }
}

/* ── demo frames (shared by every demonstration) ──────────────────── */

.demo {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.demo-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--sunken);
    font-size: 13px; color: var(--ink-2);
}
.demo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: none; }
.demo-title { font-weight: 600; color: var(--ink); }
.demo-bar .tag, .demo-bar .switch { margin-left: auto; }
.demo-note { margin: 0; padding: 8px 14px 10px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.tag {
    display: inline-flex; align-items: center; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em;
    padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s ease; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s ease; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* chat */
.demo-chat { display: flex; flex-direction: column; min-height: 440px; }
.demo-tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); }
.demo-tab {
    appearance: none; border: 0; background: none; cursor: pointer;
    padding: 8px 10px 10px; font-size: 13px; font-weight: 500; color: var(--ink-3); position: relative; white-space: nowrap;
}
.demo-tab:hover { color: var(--ink); }
.demo-tab[aria-selected="true"] { color: var(--accent); font-weight: 600; }
.demo-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
@media (max-width: 420px) { .demo-tab { padding-inline: 7px; font-size: 12px; } }

/* industries */
.industries { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 36px; }
.industry { padding: 22px 20px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); display: grid; align-content: start; gap: 8px; transition: transform .2s ease, box-shadow .2s ease; }
.industry:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.industry h3 { margin: 0; font-size: 18px; }
.industry p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.industry-reg { font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em; color: var(--accent); }
.industry-q { font-style: italic; color: var(--ink); border-left: 3px solid var(--accent-soft); padding-left: 10px; margin-top: 6px; }
.industry-more { background: var(--surface); border-style: dashed; }
@media (max-width: 1000px) { .industries { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .industries { grid-template-columns: 1fr; } }
.demo-log { flex: 1; padding: 18px 16px 6px; display: flex; flex-direction: column; gap: 14px; min-height: 290px; }
.msg { max-width: 92%; font-size: 15px; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--accent-soft); color: var(--ink); padding: 9px 13px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; max-width: 96%; }
.bot-col { display: grid; gap: 8px; min-width: 0; }
.msg .meta { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.msg .meta .tag { font-size: 10.5px; }
.msg ul { margin: 2px 0 0; padding-left: 18px; }
.msg li { margin: 2px 0; }
.ent { position: relative; display: inline-block; border-radius: 4px; padding: 0 2px; margin: 0 -2px; transition: background .25s ease, color .25s ease; }
.model .ent { font-family: var(--mono); font-size: .88em; background: var(--amber-soft); color: var(--amber); }
.ent .plain, .ent .tok { transition: opacity .2s ease; }
.ent .tok { display: none; }
.model .ent .plain { display: none; }
.model .ent .tok { display: inline; }
.model .msg.user { background: var(--sunken); }
.model .you { display: inline; }
.you { display: none; font-family: var(--mono); font-size: 11px; color: var(--amber); margin-right: 6px; }
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 6px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.caret { display: inline-block; width: 2px; height: 1em; background: var(--ink); vertical-align: -2px; margin-left: 1px; animation: caret 1s steps(2) infinite; }
.demo-asks { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.ask-btn {
    appearance: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
    padding: 6px 12px; font-size: 13px; color: var(--ink-2); cursor: pointer; text-align: left;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ask-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--ink); }
.ask-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 500; }
.ask-btn:disabled { opacity: .55; cursor: wait; }

@keyframes blink { 50% { opacity: .25; } }
@keyframes caret { 50% { opacity: 0; } }

/* ── pillars ──────────────────────────────────────────────────────── */

.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 40px; }
.pillar {
    padding: 26px 24px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pillar:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.pillar-icon { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 18px; }
.pillar-icon svg { width: 24px; height: 24px; }
.pillar p { margin: 0; color: var(--ink-2); font-size: 15px; }
@media (max-width: 880px) { .pillars { grid-template-columns: 1fr; } }

/* ── journey ──────────────────────────────────────────────────────── */

.journey { margin-top: 36px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.steps {
    list-style: none; margin: 0; padding: 14px 14px 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px;
    counter-reset: step;
}
.step-btn {
    appearance: none; width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
    padding: 10px 8px 9px; cursor: pointer; display: grid; gap: 4px; justify-items: center; text-align: center;
    color: var(--ink-2); font-size: 12px; line-height: 1.25; font-weight: 500;
    transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}
.step-btn i { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); }
.step-btn:hover { border-color: var(--accent); color: var(--ink); }
.step-btn[aria-current="step"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); transform: translateY(-2px); }
.step-btn[aria-current="step"] i { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step-btn.done i { background: var(--green-soft); color: var(--green); border-color: transparent; }
.step-panel { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; padding: 22px 22px 18px; align-items: start; }
.step-visual {
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; min-height: 230px;
    font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--ink-2); overflow-x: auto;
}
.step-visual.swap { animation: swapIn .35s ease; }
.step-text h3 { font-size: 22px; margin-bottom: 8px; }
.step-text p { color: var(--ink-2); }
.step-count { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.step-controls { display: flex; gap: 8px; margin-top: 16px; }
.step-progress { height: 3px; background: var(--line); }
.step-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.v-line { display: flex; gap: 10px; align-items: baseline; margin: 0 0 6px; }
.v-k { color: var(--ink-3); min-width: 92px; flex: none; }
.v-arrow { color: var(--ink-3); text-align: center; margin: 6px 0; }
.v-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.v-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 6px; background: var(--sunken); }
.v-list li.off { opacity: .55; text-decoration: line-through; }
.v-list li.on { outline: 1px solid var(--accent); }
.v-tok { background: var(--amber-soft); color: var(--amber); border-radius: 4px; padding: 0 3px; }
.v-name { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 3px; }
.v-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.v-chips span { border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 9px; }
.v-chips span.on { background: var(--green-soft); color: var(--green); border-color: transparent; font-weight: 600; }
.v-chips span.ref { background: var(--red-soft); color: var(--red); border-color: transparent; }
.v-table { width: 100%; border-collapse: collapse; }
.v-table td, .v-table th { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); font-weight: 400; }
.v-table th { color: var(--ink-3); font-weight: 500; }
.v-table .allow { color: var(--green); }
.v-table .pseud { color: var(--amber); }
.v-table .deny { color: var(--red); }
.v-hash { word-break: break-all; }

@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 960px) {
    .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .step-panel { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── five ways ────────────────────────────────────────────────────── */

.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 40px; }
.way { position: relative; padding: 24px 22px 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.way-n {
    display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
    background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: 13px; font-weight: 600; margin-bottom: 14px;
}
.way h3 { font-size: 18px; }
.way p { margin: 0; color: var(--ink-2); font-size: 15px; }
.way-never { border-color: var(--amber); background: var(--amber-soft); }
.way-never .way-n { background: var(--amber); color: #fff; }
.way-never p { color: var(--ink); }
@media (max-width: 960px) { .ways { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .ways { grid-template-columns: 1fr; } }

/* ── facility report ──────────────────────────────────────────────── */

.demo-report { margin-top: 36px; }
.report-body { padding: 16px; display: grid; gap: 16px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--bg); display: grid; gap: 2px; }
.tile b { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.tile span { font-size: 12.5px; color: var(--ink-2); }
.tile.bad b { color: var(--red); }
.tile.warn b { color: var(--amber); }
.tile.flash { animation: tileFlash 1s ease; }
.brief { border: 1px solid var(--accent-soft); background: var(--accent-soft); border-radius: 10px; padding: 14px 16px; }
.brief-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.brief-head .muted { font-size: 12.5px; }
.brief-text { margin: 0; font-size: 15.5px; line-height: 1.6; }
.cite {
    appearance: none; border: 0; background: none; padding: 0 2px; margin: 0 -2px; font: inherit; color: var(--ink);
    border-bottom: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); cursor: pointer; border-radius: 2px;
    transition: background .15s ease;
}
.cite:hover, .cite:focus-visible { background: var(--surface); }
.ask { display: grid; gap: 8px; }
.ask-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-banner {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px;
    padding: 8px 12px; border-radius: 8px; background: var(--amber-soft); color: var(--ink); animation: swapIn .3s ease;
}
.ask-banner .link { appearance: none; border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; font-size: 13px; }
.table-wrap { overflow-x: auto; }
.rows { width: 100%; border-collapse: collapse; font-size: 14px; }
.rows th, .rows td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rows th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.rows td.num, .rows th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rows tr { transition: background .25s ease, opacity .25s ease; }
.rows tr.lit { background: var(--amber-soft); }
.rows tr.hide { display: none; }
.rows .ref { font-family: var(--mono); font-size: 13px; }
.rows .overdue { color: var(--red); font-weight: 600; }
.rows .soon { color: var(--amber); font-weight: 600; }
@keyframes tileFlash { 0% { background: var(--amber-soft); } 100% { background: var(--bg); } }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── rules ────────────────────────────────────────────────────────── */

.rules-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; margin-top: 36px; align-items: start; }
.rule-body { padding: 18px 18px 20px; display: grid; gap: 18px; }
.rule-facts { margin: 0; display: grid; gap: 8px; font-size: 14px; }
.rule-facts div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; }
.rule-facts dt { color: var(--ink-3); }
.rule-facts dd { margin: 0; }
.rule-slider { display: grid; gap: 8px; }
.rule-slider > span:first-child { font-weight: 600; font-size: 14px; }
.rule-slider output { font-size: 32px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.rule-slider output.out { color: var(--red); }
.rule-slider input[type="range"] { width: 100%; accent-color: var(--accent); margin: 4px 0 0; }
.range-scale { position: relative; height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.range-scale i { position: absolute; top: 0; bottom: 0; background: var(--green-soft); border-inline: 2px solid var(--green); }
.rule-slider .hint { font-size: 12.5px; color: var(--ink-3); }
.finding-slot { min-height: 150px; }
.finding-none { margin: 0; padding: 14px; border: 1px dashed var(--line-2); border-radius: 10px; color: var(--ink-3); font-size: 14px; }
.finding { border: 1px solid var(--amber); border-radius: 10px; overflow: hidden; animation: pop .35s cubic-bezier(.2, .9, .3, 1.3); }
.finding.decided { border-color: var(--line-2); animation: none; }
.finding-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; background: var(--amber-soft); font-size: 13px; }
.finding-head strong { font-family: var(--mono); font-size: 12.5px; }
.finding-body { padding: 12px; display: grid; gap: 10px; font-size: 14px; }
.finding-body p { margin: 0; }
.finding-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sign { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; animation: swapIn .25s ease; }
.sign input { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); min-width: 200px; }
.decision { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.rules-copy h3 { margin-top: 0; }
.rule-types { margin: 0 0 22px; display: grid; gap: 12px; }
.rule-types div { display: grid; grid-template-columns: 76px 1fr; gap: 10px; }
.rule-types dt { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 600; }
.rule-types dd { margin: 0; color: var(--ink-2); font-size: 15px; }
.lifecycle { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.lifecycle span { border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 10px; }
.lifecycle span.ok { background: var(--green-soft); color: var(--green); border-color: transparent; }
.lifecycle span.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.lifecycle i { color: var(--ink-3); font-style: normal; }
.rules-copy > p:last-child { color: var(--ink-2); font-size: 15px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) { .rules-grid { grid-template-columns: 1fr; } }

/* ── audit chain ──────────────────────────────────────────────────── */

.demo-audit { margin-top: 36px; }
.chain td { font-size: 13.5px; }
.chain .hash { font-family: var(--mono); font-size: 12px; white-space: nowrap; transition: color .2s ease; }
.chain .hash.changed { color: var(--red); font-weight: 600; }
.chain .edit {
    width: 100%; min-width: 220px; border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 8px; background: var(--bg); font: inherit; font-size: 13.5px;
}
.chain .edit:focus { border-color: var(--accent); outline: none; }
.chain tr.ok td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.chain tr.broken { background: var(--red-soft); }
.chain tr.broken td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.chain tr.after { opacity: .7; }
.chain .who { white-space: nowrap; }
.chain .tools { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.chain-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line); }
.chain-msg { margin: 0; font-size: 14px; color: var(--ink-2); }
.chain-msg.bad { color: var(--red); font-weight: 600; }
.chain-msg.ok { color: var(--green); font-weight: 600; }
.audit-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 32px; }
.audit-notes p { color: var(--ink-2); font-size: 15px; margin: 0; }
@media (max-width: 760px) { .audit-notes { grid-template-columns: 1fr; } }

/* ── fit ──────────────────────────────────────────────────────────── */

.fit-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.fit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.fit-list li { padding: 16px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; color: var(--ink-2); font-size: 15px; }
.fit-list strong { color: var(--ink); }
@media (max-width: 900px) { .fit-grid { grid-template-columns: 1fr; } }

/* ── faq ──────────────────────────────────────────────────────────── */

.faq-wrap { max-width: 860px; }
.faq { display: grid; gap: 10px; margin-top: 28px; }
.faq details { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.faq summary {
    list-style: none; cursor: pointer; padding: 16px 48px 16px 18px; font-weight: 600; position: relative; font-size: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: ""; position: absolute; right: 18px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
    border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details p { margin: 0; padding: 0 18px 18px; color: var(--ink-2); font-size: 15px; animation: swapIn .25s ease; }

/* ── contact ──────────────────────────────────────────────────────── */

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.contact-alt { color: var(--ink-2); }
.form { display: grid; gap: 14px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); }
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; }
.field.invalid input { border-color: var(--red); }
.form-note { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.form-note.bad { color: var(--red); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

/* ── footer ───────────────────────────────────────────────────────── */

.foot { border-top: 1px solid var(--line); padding-block: 28px 40px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot .logo { font-size: 18px; }
.foot .mark { width: 22px; height: 22px; }
.foot-note, .foot-copy { margin: 0; font-size: 13px; color: var(--ink-3); }

/* ── reveal on scroll (only once scripts run; content is always visible without them) ── */

.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
.js .pillars .reveal:nth-child(2), .js .ways .reveal:nth-child(3n+2) { transition-delay: .08s; }
.js .pillars .reveal:nth-child(3), .js .ways .reveal:nth-child(3n) { transition-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js .reveal { opacity: 1; transform: none; }
}
