/* =========================================================
   Paphwey Marketing Site — "Proof of Presence"
   Editorial receipt meets precision-tech.
   Design tokens → typography → chrome → components.
   ========================================================= */

/* ---------- Tokens ---------- */

:root {
    /* Surface */
    --paper: #f6f2e9;           /* bone paper */
    --paper-soft: #efe8d8;      /* deeper bone */
    --paper-2: #faf6ed;         /* near-white warm */
    --ink: #0b0b0d;
    --ink-2: #1a1a22;
    --muted: #55535f;
    --muted-2: #85828e;

    --line: rgba(11, 11, 13, 0.12);
    --line-strong: rgba(11, 11, 13, 0.24);
    --line-soft: rgba(11, 11, 13, 0.06);

    /* Brand */
    --brand: #6f4dff;           /* signature violet */
    --brand-deep: #3d2bb8;
    --brand-ink: #1d0f6b;
    --brand-soft: #ebe5ff;
    --brand-wash: #f4f0ff;

    /* Secondary accent (used sparingly for "proof" moments) */
    --lime: #d6ff3a;
    --lime-ink: #1d2600;
    --lime-soft: #eafb9b;

    /* Dark surface (proof panels) */
    --dark: #0c0d12;
    --dark-2: #15161c;
    --dark-paper: #1a1b22;
    --dark-line: rgba(255, 255, 255, 0.1);
    --dark-line-strong: rgba(255, 255, 255, 0.2);
    --dark-muted: #9fa2b3;

    /* Status */
    --ok: #0a7a3a;
    --warn: #8f6100;
    --danger: #a11a2a;

    /* Radii — editorial, not bubbly */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows — reserved; design is line-led */
    --shadow-sm: 0 1px 0 rgba(11, 11, 13, 0.04);
    --shadow-md: 0 1px 2px rgba(11, 11, 13, 0.04), 0 12px 22px -14px rgba(11, 11, 13, 0.18);
    --shadow-lg: 0 1px 2px rgba(11, 11, 13, 0.06), 0 28px 48px -22px rgba(11, 11, 13, 0.24);
    --shadow-xl: 0 2px 4px rgba(11, 11, 13, 0.08), 0 48px 80px -28px rgba(11, 11, 13, 0.32);

    /* Typography */
    --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
    --font-body: "Inter Tight", "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    /* Motion */
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-in-out: cubic-bezier(0.7, 0, 0.3, 1);
    --d-fast: 140ms;
    --d-base: 220ms;
    --d-slow: 420ms;
}

/* ---------- Reset / base ---------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font: 400 17px/1.55 var(--font-body);
    font-feature-settings: "ss01", "cv11", "ss03";
    letter-spacing: -0.005em;
    overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

::selection { background: var(--brand); color: #fff; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -0.015em;
    line-height: 1.05;
    margin: 0;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.75rem); line-height: 0.98; }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); line-height: 1.02; }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.15; letter-spacing: -0.01em; }
h4 { font-size: 1.05rem; line-height: 1.3; font-family: var(--font-body); font-weight: 600; letter-spacing: -0.01em; }

h1 em, h2 em, h3 em { font-style: italic; }

p { margin: 0; }
p + p { margin-top: 0.85em; }

code, kbd, samp {
    font-family: var(--font-mono);
    font-size: 0.9em;
    font-feature-settings: "calt" 0;
    padding: 0.08em 0.4em;
    border-radius: 4px;
    background: rgba(11, 11, 13, 0.06);
    color: var(--brand-deep);
    letter-spacing: 0;
}

.lead {
    font-size: clamp(1.075rem, 1.3vw, 1.215rem);
    line-height: 1.5;
    color: var(--ink-2);
    max-width: 62ch;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0;
}
.eyebrow::before {
    content: "";
    width: 14px;
    height: 1px;
    background: currentColor;
    opacity: 0.6;
    display: inline-block;
}
.eyebrow.eyebrow-bare::before { display: none; }

/* Highlight marker — lime block behind inline text */
.mark {
    position: relative;
    padding: 0 0.08em;
    background: linear-gradient(180deg, transparent 55%, var(--lime) 55%, var(--lime) 92%, transparent 92%);
    color: inherit;
}
.mark-violet {
    background: linear-gradient(180deg, transparent 55%, var(--brand-soft) 55%, var(--brand-soft) 92%, transparent 92%);
}

/* ---------- Page shell ---------- */

.page-shell {
    width: min(1240px, 100% - 2rem);
    margin-inline: auto;
    padding: 0.9rem 0 3rem;
}

.page-main {
    display: grid;
    gap: 1.2rem;
    padding: 0;
}

/* Soft background auras — kept subtle */
.page-aura {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    filter: blur(70px);
    opacity: 0.5;
}
.page-aura-one {
    width: 600px; height: 600px;
    top: -10%; right: -12%;
    background: radial-gradient(circle, rgba(111, 77, 255, 0.14), transparent 65%);
}
.page-aura-two {
    width: 520px; height: 520px;
    bottom: -10%; left: -8%;
    background: radial-gradient(circle, rgba(214, 255, 58, 0.14), transparent 65%);
}

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0.75rem;
    z-index: 40;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.6rem 0.85rem 0.6rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(246, 242, 233, 0.72);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    margin-bottom: 1.5rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.brand-icon {
    width: 22px; height: 22px;
}
.brand-mark span { font-weight: 400; }

.site-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    justify-self: center;
}
.site-nav a {
    position: relative;
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--ink-2);
    border-radius: 999px;
    transition: color var(--d-base) var(--ease-out), background var(--d-base) var(--ease-out);
}
.site-nav a:hover { color: var(--ink); background: rgba(11,11,13,0.05); }
.site-nav a.is-active { color: var(--ink); }
.site-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 50%; bottom: 0.25rem;
    transform: translateX(-50%);
    width: 20px; height: 2px;
    background: var(--brand);
    border-radius: 2px;
}

.header-cta {
    padding: 0.5rem 0.95rem !important;
    min-height: auto !important;
    font-size: 0.855rem !important;
}

.site-nav-cta { display: none; }

.site-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--paper-2);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    transition: background var(--d-base) var(--ease-out);
}
.site-nav-toggle:hover { background: var(--paper); }
.site-nav-toggle-bar {
    display: block;
    width: 20px;
    height: 1.8px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform var(--d-base) var(--ease-out), opacity var(--d-fast) var(--ease-out);
}
.site-nav-toggle[aria-expanded="true"] .site-nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.site-nav-toggle[aria-expanded="true"] .site-nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.site-nav-toggle[aria-expanded="true"] .site-nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 11, 13, 0.36);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 38;
    opacity: 0;
    transition: opacity var(--d-base) var(--ease-out);
}
.site-nav-backdrop.is-visible { opacity: 1; }

body.nav-open { overflow: hidden; }

/* ---------- Buttons ---------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.85rem;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--d-fast) var(--ease-out),
                background var(--d-base) var(--ease-out),
                color var(--d-base) var(--ease-out),
                border-color var(--d-base) var(--ease-out);
    white-space: nowrap;
}
.button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.button-primary {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.button-primary::after {
    content: "→";
    font-family: var(--font-mono);
    font-size: 0.95em;
    transition: transform var(--d-base) var(--ease-out);
}
.button-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.button-primary:hover::after { transform: translateX(3px); }

.button-secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--line-strong);
}
.button-secondary:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.button-ghost {
    background: transparent;
    color: var(--ink);
    border-color: transparent;
}
.button-ghost:hover { background: rgba(11,11,13,0.05); }

.button-accent {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}
.button-accent:hover { background: var(--brand-deep); border-color: var(--brand-deep); }

/* ---------- Reveal ---------- */

.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 650ms var(--ease-out), transform 650ms var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Section stamp ---------- */

.section-stamp {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1.8rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}
.section-stamp strong { color: var(--ink); font-weight: 500; letter-spacing: 0.14em; }
.section-stamp-right {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted-2);
}
.section-stamp-right::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 999px;
    background: var(--brand);
    display: inline-block;
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ---------- Hero ---------- */

.hero {
    padding: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 2.25rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--paper-2);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
        linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 85% 20%, rgba(0,0,0,0.35), transparent 70%);
    pointer-events: none;
}

.hero-home { padding-top: clamp(3rem, 5vw, 4.5rem); }

.hero > * { position: relative; z-index: 1; }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 3vw, 3rem);
    align-items: center;
}
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
}

.hero-copy-block .eyebrow { margin-bottom: 1.25rem; }
.hero-copy-block h1 { margin: 0.25rem 0 1.1rem; max-width: 14ch; }
.hero-copy-block .lead { margin-bottom: 1.75rem; }

.hero-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.inline-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1.5rem;
}
.inline-pills span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--paper);
    font-size: 0.78rem;
    color: var(--ink-2);
    font-weight: 500;
}
.inline-pills span::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 999px;
    background: var(--brand);
}

/* Hero clarity card — attestation-style receipt */
.hero-clarity-card {
    position: relative;
    padding: 1.5rem 1.6rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.hero-clarity-card::before {
    content: "§ ATTESTATION · PREVIEW";
    position: absolute;
    top: -10px;
    left: 1.25rem;
    padding: 0.15rem 0.6rem;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    border-radius: 4px;
}
.hero-clarity-card .eyebrow { margin-top: 0.3rem; }
.hero-clarity-card h2 {
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    margin: 0.5rem 0 0.7rem;
}
.hero-clarity-card > p { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

.hero-clarity-card-light::before { background: var(--brand); }

.clarity-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px dashed var(--line);
}
.clarity-list > div {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 0.9rem;
    align-items: baseline;
    font-size: 0.92rem;
}
.clarity-list strong {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
}
.clarity-list span { color: var(--muted); }

/* ---------- Statement band ---------- */

.statement-band {
    padding: 1.75rem 2rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-lg);
    background: var(--paper-2);
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.2vw, 1.75rem);
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.statement-band p { max-width: 70ch; }
.statement-band-warning {
    border-left-color: var(--warn);
    background: #fff8e3;
    color: #4d3400;
}

/* ---------- Simple sections / grids / cards ---------- */

.simple-section {
    padding: clamp(1.75rem, 3vw, 2.75rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--paper-2);
}

.simple-intro {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    max-width: 60ch;
}
.simple-intro h2 { max-width: 22ch; }
.simple-intro p { color: var(--muted); font-size: 1.02rem; }

.simple-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.9rem;
}
.simple-grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
    .simple-grid, .simple-grid-compact { grid-template-columns: minmax(0, 1fr); }
}
.simple-grid > *,
.simple-grid-compact > * { min-width: 0; }

.simple-card {
    position: relative;
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    transition: transform var(--d-base) var(--ease-out),
                border-color var(--d-base) var(--ease-out);
}
.simple-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.simple-card h3 { margin-bottom: 0.45rem; }
.simple-card p { color: var(--muted); font-size: 0.95rem; }

/* Numbered step chip card */
.step-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem 1rem;
    align-items: start;
}
.step-card .step-num {
    width: 36px; height: 36px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--paper-2);
    color: var(--ink);
    transition: background var(--d-base), color var(--d-base), border-color var(--d-base);
}
.step-card:hover .step-num { background: var(--brand); color: #fff; border-color: var(--brand); }
.step-card-body { display: grid; gap: 0.3rem; min-width: 0; }

/* ---------- Code blocks (developer docs, demo payloads) ---------- */

.demo-code-block {
    margin: 0.6rem 0 0;
    padding: 0.95rem 1.05rem;
    background: var(--ink);
    color: #dfe3ee;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.55;
    max-width: 100%;
    /* JWTs and signed-attestation tokens are single long unbroken strings.
       With `white-space: pre` they widen the CSS grid track they live in,
       pushing the whole review panel off-screen. Wrap aggressively instead —
       on long tokens we want users to *read* them, not horizontally scroll
       past them. `overflow-wrap: anywhere` covers browsers that don't honor
       `word-break: break-all` on tokens without whitespace. */
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    -webkit-overflow-scrolling: touch;
}
.demo-code-block-compact {
    font-size: 0.74rem;
    padding: 0.8rem 0.95rem;
    line-height: 1.5;
}
.contrast-card-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}
.contrast-card-dark .contrast-card-icon { opacity: 1; }

.contrast-card-dark .demo-code-block {
    background: rgba(0, 0, 0, 0.35);
    color: #e9ecf2;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------- Page link grid ---------- */

.page-link-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
}
.page-link-grid-simple { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .page-link-grid, .page-link-grid-simple { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .page-link-grid, .page-link-grid-simple { grid-template-columns: 1fr; } }

.page-link-card {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 0.55rem;
    padding: 1.3rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    transition: border-color var(--d-base) var(--ease-out), transform var(--d-base) var(--ease-out);
}
.page-link-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.page-link-card h3 { font-size: 1.25rem; margin-bottom: 0.2rem; }
.page-link-card p { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.page-link-card a {
    margin-top: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    align-self: start;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 2px;
    transition: color var(--d-base), border-color var(--d-base);
}
.page-link-card a::after { content: "↗"; transition: transform var(--d-base) var(--ease-out); }
.page-link-card:hover a { color: var(--brand); border-color: var(--brand); }
.page-link-card:hover a::after { transform: translate(2px, -2px); }

/* ---------- Dual panel ---------- */

.dual-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.9rem;
}
@media (max-width: 900px) { .dual-panel { grid-template-columns: minmax(0, 1fr); } }
.dual-panel > * { min-width: 0; }

.contrast-card {
    padding: 1.75rem 1.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--paper-2);
}
.contrast-card h2 {
    font-size: clamp(1.4rem, 2.2vw, 1.85rem);
    margin: 0.4rem 0 0.8rem;
}
.contrast-card ul { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.55rem; }
.contrast-card ul li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--muted);
    font-size: 0.95rem;
}
.contrast-card ul li::before {
    content: "";
    position: absolute; left: 0; top: 0.55em;
    width: 10px; height: 1px;
    background: var(--brand);
}
.contrast-card-dark {
    background: var(--dark);
    border-color: var(--dark-line);
    color: #f0eee6;
}
.contrast-card-dark h2 { color: #f8f6ef; }
.contrast-card-dark .eyebrow { color: var(--dark-muted); }
.contrast-card-dark .eyebrow::before { background: var(--brand); opacity: 1; }
.contrast-card-dark ul li { color: var(--dark-muted); }
.contrast-card-dark ul li::before { background: var(--lime); }
.contrast-card-dark code { background: rgba(255,255,255,0.1); color: var(--lime); }
.contrast-card-dark .lead-copy { color: var(--dark-muted); }

/* ---------- CTA band ---------- */

.cta-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    padding: 2rem 2.25rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(120deg, var(--dark) 0%, #1a103a 80%, #2a1a5e 100%);
    color: #f3eee0;
    position: relative;
    overflow: hidden;
}
.cta-band::before {
    content: "";
    position: absolute; inset: 0;
    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: 48px 48px;
    mask-image: radial-gradient(ellipse at 100% 100%, rgba(0,0,0,0.6), transparent 70%);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band .eyebrow { color: var(--brand); opacity: 1; margin-bottom: 0.6rem; }
.cta-band .eyebrow::before { background: var(--brand); }
.cta-band h2 { color: #fff; max-width: 28ch; font-size: clamp(1.55rem, 2.6vw, 2.15rem); }
.cta-band .cta-actions { display: inline-flex; gap: 0.6rem; flex-wrap: wrap; }
.cta-band .button-primary {
    background: var(--lime);
    color: var(--lime-ink);
    border-color: var(--lime);
}
.cta-band .button-primary:hover { background: #fff; border-color: #fff; color: var(--ink); }
.cta-band .button-secondary { color: #fff; border-color: rgba(255,255,255,0.25); }
.cta-band .button-secondary:hover { background: #fff; color: var(--ink); border-color: #fff; }

@media (max-width: 760px) {
    .cta-band { grid-template-columns: 1fr; }
}

/* ---------- Story panel (dark full-bleed proof panel) ---------- */

.story-panel {
    padding: clamp(2rem, 3.5vw, 3rem);
    border-radius: var(--radius-xl);
    background: var(--dark);
    color: #f0eee6;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--dark-line);
}
.story-panel::before {
    content: "";
    position: absolute; inset: 0;
    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: 48px 48px;
    mask-image: radial-gradient(ellipse at 80% 30%, rgba(0,0,0,0.6), transparent 70%);
    pointer-events: none;
}
.story-panel > * { position: relative; z-index: 1; }
.story-panel h2 { color: #fff; max-width: 28ch; }
.story-panel .eyebrow { color: var(--brand); opacity: 1; }
.story-panel .eyebrow::before { background: var(--brand); }
.story-panel .lead { color: var(--dark-muted); }

.story-intro { max-width: 60ch; margin-bottom: 2rem; }

.story-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}
@media (max-width: 900px) { .story-columns { grid-template-columns: 1fr; } }

.story-column {
    padding: 1.25rem;
    border: 1px solid var(--dark-line);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.02);
    position: relative;
}
.story-column::before {
    content: "";
    position: absolute;
    top: -1px; left: 1.25rem; right: 1.25rem;
    height: 1px;
    background: var(--brand);
    opacity: 0.5;
}
.story-column h3 { color: #fff; font-size: 1.2rem; margin-bottom: 0.4rem; }
.story-column p { color: var(--dark-muted); font-size: 0.93rem; line-height: 1.5; }

/* ---------- Visual stacks (hero side visuals) ---------- */

.visual-stack {
    display: grid;
    gap: 0.6rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow-md);
}
.visual-stack-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.8rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px dashed var(--line);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}
.visual-stack-head strong { color: var(--ink); font-weight: 500; }

.visual-row {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    gap: 0.85rem;
    align-items: baseline;
    padding: 0.45rem 0;
}
.visual-row-index {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--brand);
    letter-spacing: 0.08em;
    font-weight: 600;
}
.visual-row-body strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}
.visual-row-body span { color: var(--muted); font-size: 0.88rem; }

.trust-ladder { counter-reset: ladder; }
.trust-ladder .visual-row { position: relative; padding-left: 1.25rem; }
.trust-ladder .visual-row::before {
    counter-increment: ladder;
    content: "0" counter(ladder);
    position: absolute; left: 0; top: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--muted-2);
    letter-spacing: 0.1em;
}

/* Mission note block (company page hero side) */
.mission-note {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    position: relative;
    box-shadow: var(--shadow-md);
}
.mission-note::before {
    content: "§ MISSION";
    position: absolute;
    top: -10px; left: 1.25rem;
    padding: 0.15rem 0.55rem;
    background: var(--brand);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    border-radius: 4px;
}
.mission-note strong {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0.3rem 0 0.6rem;
}
.mission-note p {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    line-height: 1.25;
    color: var(--ink);
}

/* ---------- Landscape accent variants ---------- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-card {
    padding: 1.5rem 1.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    border-top: 3px solid var(--brand);
    transition: transform var(--d-base) var(--ease-out);
    display: grid;
    gap: 0.5rem;
}
.feature-card:hover { transform: translateY(-3px); }
.feature-card.accent-sky { border-top-color: #4068ff; }
.feature-card.accent-mint { border-top-color: #0a9e5e; }
.feature-card.accent-gold { border-top-color: #c78a3c; }
.feature-card h3 { margin-bottom: 0.1rem; font-size: 1.2rem; }
.feature-card p { color: var(--muted); font-size: 0.94rem; }

.feature-index {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    color: var(--muted);
    text-transform: uppercase;
}

/* Comparison band (legacy vs next) */
.comparison-band {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}
@media (max-width: 900px) { .comparison-band { grid-template-columns: 1fr; } }

/* =========================================================
   TOPOLOGY DIAGRAM — home §02 four-actor illustration
   ========================================================= */

.topology-section {
    display: grid;
    gap: 1.25rem;
}
.topology-diagram {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--paper-2);
    padding: 1.5rem;
    overflow: hidden;
    position: relative;
}
.topology-diagram::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 85% 10%, rgba(214, 255, 58, 0.18), transparent 45%),
        radial-gradient(ellipse at 15% 90%, rgba(111, 77, 255, 0.10), transparent 50%);
    pointer-events: none;
}
.topology-diagram svg {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}
.topology-caption {
    max-width: 68ch;
    margin: 0 auto;
    text-align: center;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 1.4vw, 1.25rem);
    line-height: 1.4;
    font-style: italic;
}

/* ---------- Topology SVG animations ---------- */

.topo-svg { overflow: visible; }

.topo-node-title {
    font-family: var(--font-display);
    font-size: 26px;
    fill: var(--ink);
}
.topo-node-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    fill: var(--muted);
}
.topo-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    fill: var(--muted);
    opacity: 0;
}
.topo-label-2 { fill: var(--brand); }
.topo-stamp-text {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    fill: var(--ink);
}

/* Static connector lines (entry draw) */
.topo-line {
    fill: none;
    stroke-width: 1.5;
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
}
.topo-line-1, .topo-line-3 { stroke: var(--ink); }
.topo-line-2 { stroke: var(--brand); stroke-dasharray: 240; stroke-dashoffset: 240; }

/* Pulse glows (soft breathing) */
.topo-pulse { opacity: 0; transform-origin: center; transform-box: fill-box; }

/* Key glyphs (tiny dots on wallet + agent that flash when activated) */
.topo-key-violet, .topo-key-lime {
    transform-origin: center;
    transform-box: fill-box;
}

/* Outcome stamp — drops in after first cycle */
.topo-stamp {
    opacity: 0;
    transform-origin: center;
    transform-box: fill-box;
}
.topo-stamp-bg { transform-origin: center; transform-box: fill-box; }

/* Traveling packets */
.topo-packet {
    opacity: 0;
    transform-origin: 0 0;
}

/* Trigger animations only when section enters view */
.topology-section.is-visible .topo-line-1 { animation: topo-draw 0.9s 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.topology-section.is-visible .topo-line-2 { animation: topo-draw-violet 1.1s 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.topology-section.is-visible .topo-line-3 { animation: topo-draw 0.9s 1.0s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

.topology-section.is-visible .topo-label-1 { animation: topo-label-in 0.5s 1.2s forwards; }
.topology-section.is-visible .topo-label-2 { animation: topo-label-in 0.5s 1.4s forwards; }
.topology-section.is-visible .topo-label-3 { animation: topo-label-in 0.5s 1.6s forwards; }

.topology-section.is-visible .topo-pulse-1 { animation: topo-breathe 4s 2s ease-in-out infinite; }
.topology-section.is-visible .topo-pulse-2 { animation: topo-breathe 4s 2.5s ease-in-out infinite; }
.topology-section.is-visible .topo-pulse-3 { animation: topo-breathe 4s 3s ease-in-out infinite; }
.topology-section.is-visible .topo-pulse-4 { animation: topo-breathe 4s 3.5s ease-in-out infinite; }

.topology-section.is-visible .topo-packet-1 {
    animation: topo-packet-flow-1 6s 2s cubic-bezier(0.55, 0.05, 0.35, 1) infinite;
}
.topology-section.is-visible .topo-packet-2 {
    animation: topo-packet-flow-2 6s 3s cubic-bezier(0.55, 0.05, 0.35, 1) infinite;
}
.topology-section.is-visible .topo-packet-3 {
    animation: topo-packet-flow-3 6s 4s cubic-bezier(0.55, 0.05, 0.35, 1) infinite;
}

.topology-section.is-visible .topo-key-violet {
    animation: topo-key-flash-violet 6s 3s ease-in-out infinite;
}
.topology-section.is-visible .topo-key-lime {
    animation: topo-key-flash-lime 6s 4s ease-in-out infinite;
}

.topology-section.is-visible .topo-stamp {
    animation: topo-stamp-in 0.8s 5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               topo-stamp-pulse 6s 6s ease-in-out infinite;
}

@keyframes topo-draw {
    to { stroke-dashoffset: 0; }
}
@keyframes topo-draw-violet {
    to { stroke-dashoffset: 0; }
}

@keyframes topo-label-in {
    to { opacity: 0.85; }
}

@keyframes topo-breathe {
    0%, 100% { opacity: 0.0; transform: scale(0.85); }
    50% { opacity: 0.55; transform: scale(1.05); }
}

/* Packet 1: User → Wallet (black signature) along y=190, x 200 → 395 */
@keyframes topo-packet-flow-1 {
    0% { transform: translate(200px, 190px) scale(0); opacity: 0; }
    8% { transform: translate(210px, 190px) scale(1); opacity: 1; }
    25% { transform: translate(395px, 190px) scale(1); opacity: 1; }
    30% { transform: translate(395px, 190px) scale(1.4); opacity: 0.6; }
    35% { transform: translate(395px, 190px) scale(0); opacity: 0; }
    100% { transform: translate(395px, 190px) scale(0); opacity: 0; }
}

/* Packet 2: Wallet → Agent (violet scoped delegation) along y=190, x 485 → 700 */
@keyframes topo-packet-flow-2 {
    0% { transform: translate(485px, 190px) scale(0); opacity: 0; }
    8% { transform: translate(495px, 190px) scale(1); opacity: 1; }
    25% { transform: translate(700px, 190px) scale(1); opacity: 1; }
    30% { transform: translate(700px, 190px) scale(1.4); opacity: 0.6; }
    35% { transform: translate(700px, 190px) scale(0); opacity: 0; }
    100% { transform: translate(700px, 190px) scale(0); opacity: 0; }
}

/* Packet 3: Agent → Business (lime proof) along y=190, x 820 → 1000 */
@keyframes topo-packet-flow-3 {
    0% { transform: translate(820px, 190px) scale(0); opacity: 0; }
    8% { transform: translate(830px, 190px) scale(1); opacity: 1; }
    25% { transform: translate(1000px, 190px) scale(1); opacity: 1; }
    30% { transform: translate(1000px, 190px) scale(1.4); opacity: 0.6; }
    35% { transform: translate(1000px, 190px) scale(0); opacity: 0; }
    100% { transform: translate(1000px, 190px) scale(0); opacity: 0; }
}

@keyframes topo-key-flash-violet {
    0%, 24%, 36%, 100% { transform: scale(1); filter: none; }
    28% { transform: scale(2.2); filter: drop-shadow(0 0 8px rgba(111, 77, 255, 0.8)); }
}
@keyframes topo-key-flash-lime {
    0%, 24%, 36%, 100% { transform: scale(1); filter: none; }
    28% { transform: scale(2.2); filter: drop-shadow(0 0 8px rgba(214, 255, 58, 0.9)); }
}

@keyframes topo-stamp-in {
    0% { opacity: 0; transform: translateY(20px) scale(0.85); }
    70% { opacity: 1; transform: translateY(-4px) scale(1.06); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes topo-stamp-pulse {
    0%, 90%, 100% { filter: none; }
    93% { filter: drop-shadow(0 0 18px rgba(214, 255, 58, 0.7)); }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .topo-line { stroke-dashoffset: 0 !important; }
    .topo-label { opacity: 0.85 !important; }
    .topo-stamp { opacity: 1 !important; }
    .topo-packet { display: none; }
    .topo-pulse { display: none; }
}

/* Tablet + mobile — stack vertically if viewBox feels cramped */
@media (max-width: 720px) {
    .topology-diagram { padding: 1rem; }
    .topo-node-title { font-size: 22px; }
    .topo-node-meta { font-size: 9px; }
    .topo-stamp-text { font-size: 10px; }
}

/* =========================================================
   PROCESS TIMELINE — home §03 four-step horizontal flow
   ========================================================= */

.process-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    position: relative;
    counter-reset: process;
}
.process-timeline::before {
    content: "";
    position: absolute;
    top: 28px;
    left: 12.5%;
    right: 12.5%;
    height: 1px;
    background: linear-gradient(
        to right,
        var(--line-strong) 0%,
        var(--brand) 50%,
        var(--lime) 100%
    );
    z-index: 0;
}
.process-step {
    display: grid;
    gap: 0.85rem;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}
.process-marker {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--paper);
    border: 1.5px solid var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.process-marker::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--line);
}
.process-step:nth-child(1) .process-marker { background: var(--paper); }
.process-step:nth-child(2) .process-marker { background: var(--brand-soft); border-color: var(--brand); }
.process-step:nth-child(3) .process-marker { background: var(--brand); border-color: var(--brand); }
.process-step:nth-child(3) .process-num { color: #fff; }
.process-step:nth-child(4) .process-marker { background: var(--lime); border-color: var(--ink); }
.process-num {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.05em;
    color: var(--ink);
}
.process-body {
    text-align: center;
    display: grid;
    gap: 0.35rem;
}
.process-body h3 {
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    font-family: var(--font-display);
    font-weight: 400;
}
.process-body p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
    max-width: 26ch;
    margin: 0 auto;
}
@media (max-width: 900px) {
    .process-timeline {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .process-timeline::before {
        top: 0;
        bottom: 0;
        left: 28px;
        right: auto;
        width: 1px;
        height: auto;
        background: linear-gradient(
            to bottom,
            var(--line-strong) 0%,
            var(--brand) 50%,
            var(--lime) 100%
        );
    }
    .process-step {
        grid-template-columns: 56px 1fr;
        align-items: start;
        gap: 1rem;
        padding: 0;
        text-align: left;
    }
    .process-marker { margin: 0; }
    .process-body { text-align: left; }
    .process-body p { margin: 0; max-width: 60ch; }
}

/* =========================================================
   PROOF STRIP — standards badges
   ========================================================= */

.proof-strip {
    display: grid;
    gap: 1.25rem;
    padding: 2rem 2.25rem;
    border-radius: var(--radius-xl);
    background: var(--dark);
    color: #f3eee0;
    position: relative;
    overflow: hidden;
}
.proof-strip::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 88% 8%, rgba(214, 255, 58, 0.10), transparent 40%);
    pointer-events: none;
}
.proof-strip > * { position: relative; z-index: 1; }
.proof-strip-head {
    display: grid;
    gap: 0.35rem;
}
.proof-strip-head .eyebrow { color: var(--lime); }
.proof-strip-head .eyebrow::before { background: var(--lime); opacity: 1; }
.proof-strip-head h2 { color: #faf6ed; font-size: clamp(1.5rem, 2.4vw, 2rem); }
.proof-strip-head h2 em { color: var(--lime); font-style: italic; }

.proof-badges {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
.proof-badges li {
    padding: 0.85rem 1rem;
    border: 1px solid var(--dark-line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 0.25rem;
}
.proof-badges strong {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    color: var(--lime);
    text-transform: uppercase;
}
.proof-badges span {
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--dark-muted);
    line-height: 1.4;
}
@media (max-width: 900px) { .proof-badges { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .proof-badges { grid-template-columns: 1fr; } }

.proof-stamp {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    justify-self: start;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: var(--lime);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.proof-stamp > span:first-child {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ink);
}

/* ---------- Section grid (intro + children) ---------- */

.section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 2rem;
    align-items: start;
}
@media (max-width: 900px) { .section-grid { grid-template-columns: 1fr; } }

.sector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}
@media (max-width: 700px) { .sector-grid { grid-template-columns: 1fr; } }
.sector-card {
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--line);
    border-left: 2px solid var(--brand);
    border-radius: var(--radius-md);
    background: var(--paper);
    transition: border-left-color var(--d-base), transform var(--d-base);
}
.sector-card:hover { border-left-color: var(--lime); transform: translateX(3px); }
.sector-card h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.sector-card p { color: var(--muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */

.site-footer {
    margin-top: 2rem;
    padding: 2rem 2rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--paper-2);
    display: grid;
    grid-template-columns: 1.6fr 1fr auto;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 820px) { .site-footer { grid-template-columns: 1fr; } }

.footer-brand p {
    margin-top: 0.8rem;
    max-width: 38ch;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 1rem;
}
.footer-links a {
    text-decoration: none;
    color: var(--ink-2);
    font-size: 0.9rem;
    padding: 0.2rem 0;
    transition: color var(--d-base);
}
.footer-links a:hover { color: var(--brand); }

.footer-meta {
    display: grid;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: right;
    font-family: var(--font-mono);
}
.footer-meta a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.footer-meta a:hover { color: var(--brand); border-color: var(--brand); }
@media (max-width: 820px) { .footer-meta { text-align: left; } }

/* =========================================================
   DEMO WALKTHROUGH (demo.html) — restyled to new system
   ========================================================= */

.public-demo-page { gap: 1rem; }

.demo-story-band {
    padding: clamp(1.5rem, 2.5vw, 2rem);
    border: 1px solid var(--dark-line);
    border-radius: var(--radius-xl);
    background: var(--dark);
    color: #f0eee6;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}
.demo-story-band::before {
    content: "";
    position: absolute; inset: 0;
    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: 48px 48px;
    mask-image: radial-gradient(ellipse at 85% 20%, rgba(0,0,0,0.6), transparent 70%);
}
.demo-story-band > * { position: relative; z-index: 1; }
.demo-story-band .eyebrow { color: var(--brand); opacity: 1; }
.demo-story-band h3 { color: #fff; margin-bottom: 0.4rem; }
.demo-story-phase { color: var(--dark-muted); font-size: 0.88rem; font-family: var(--font-mono); }
.demo-story-tagline { color: var(--dark-muted); margin-top: 0.5rem; }

.demo-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.demo-metric {
    padding: 0.8rem 1rem;
    border: 1px solid var(--dark-line);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.02);
}
.demo-metric .eyebrow { font-size: 0.65rem; margin-bottom: 0.25rem; }
.demo-metric strong { color: #fff; font-size: 1.1rem; font-weight: 500; font-family: var(--font-mono); }

@media (max-width: 820px) { .demo-story-band { grid-template-columns: 1fr; } }

.demo-stage-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
    padding: 0.3rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper-2);
}
.demo-stage-tab {
    padding: 0.65rem 0.85rem;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: background var(--d-base), color var(--d-base);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}
.demo-stage-tab:hover { background: var(--paper); color: var(--ink); }
.demo-stage-tab.is-active { background: var(--ink); color: var(--paper); }
@media (max-width: 640px) { .demo-stage-tabs { grid-template-columns: 1fr 1fr; } }

.demo-journey-card {
    padding: 1.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--paper-2);
}
.demo-journey-card h3 { margin-bottom: 1rem; font-size: 1.35rem; }

.demo-form { display: grid; gap: 0.9rem; max-width: 560px; }
.demo-form label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--ink);
    font-weight: 500;
}
.demo-form input,
.demo-form select,
.email-input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink);
    font: 500 0.95rem var(--font-body);
    transition: border-color var(--d-base), box-shadow var(--d-base);
}
.demo-form input:focus,
.demo-form select:focus,
.email-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.demo-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.demo-selection-card {
    margin-top: 1.25rem;
    padding: 1.1rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-selection-card h4 { font-size: 1.1rem; margin-bottom: 0.35rem; font-family: var(--font-body); font-weight: 600; }
.demo-selection-card p { color: var(--muted); font-size: 0.9rem; }
.demo-selection-card ul {
    list-style: none; padding: 0; margin: 0.75rem 0 0;
    display: grid; gap: 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}
.demo-selection-card ul li::before { content: "› "; color: var(--brand); }

.demo-device-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--paper);
}
.demo-device-pill::before {
    content: "";
    width: 7px; height: 7px; border-radius: 999px;
    background: var(--muted-2);
}
.demo-device-pill.is-active::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(10, 122, 58, 0.15); }

.demo-device-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.55rem;
    margin: 1rem 0;
}
@media (max-width: 720px) { .demo-device-grid { grid-template-columns: 1fr 1fr; } }
.demo-device-cell {
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-device-cell .eyebrow { font-size: 0.65rem; margin-bottom: 0.3rem; }
.demo-device-cell strong { font-family: var(--font-mono); font-weight: 500; font-size: 0.9rem; }

.demo-link-code-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    margin-bottom: 1rem;
}
@media (max-width: 720px) { .demo-link-code-panel { grid-template-columns: 1fr; } }
.link-code-display {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    color: var(--ink);
    font-weight: 500;
    display: inline-block;
    padding: 0.25rem 0;
}

.demo-qr-shell,
.qr-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 1rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--paper);
    color: var(--muted-2);
    text-align: center;
    font-size: 0.85rem;
}
.qr-shell img { max-width: 180px; height: auto; }

.demo-current-step {
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-current-step h4 { font-size: 1.1rem; margin-bottom: 0.3rem; font-family: var(--font-body); font-weight: 600; }
.demo-current-step p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.7rem; }

.demo-upcoming {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-upcoming ol {
    margin: 0.55rem 0 0; padding: 0 0 0 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--muted);
}

.demo-review-layout { display: grid; gap: 1rem; }
.demo-meta-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-meta-list .eyebrow { font-size: 0.66rem; }
.demo-meta-list strong { font-family: var(--font-mono); font-size: 0.92rem; font-weight: 500; }

.demo-details {
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-details > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}
.demo-details > summary::-webkit-details-marker { display: none; }
.demo-details > summary::before {
    content: "›";
    font-family: var(--font-mono);
    color: var(--brand);
    transition: transform var(--d-base);
    display: inline-block;
}
.demo-details[open] > summary::before { transform: rotate(90deg); }
.demo-details pre, .demo-details .event-timeline {
    margin-top: 0.85rem;
    padding: 0.85rem;
    background: var(--ink);
    color: #d6dbe6;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-x: auto;
}

.demo-feedback-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.8rem;
}
.demo-feedback-row .demo-feedback {
    flex: 1 1 auto;
    margin-top: 0;
    min-width: 0;
}
.demo-feedback-row .demo-feedback-reset {
    flex: 0 0 auto;
}
.demo-feedback {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--paper);
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 0.8rem;
}
.demo-feedback[data-tone="success"] { border-color: #b4e0c5; background: #ecf8f0; color: #0a3d1f; }
.demo-feedback[data-tone="warning"] { border-color: #f0d48c; background: #fdf6e3; color: #5a4100; }
.demo-feedback[data-tone="error"]   { border-color: #e9b2ba; background: #fbeaec; color: #6a1520; }

/* =========================================================
   GUIDED DEMO (demo.html) — journey card shell
   Rules for JS-generated markup in public-site.js
   ========================================================= */

.demo-journey-shell { display: grid; gap: 1.25rem; }
.demo-card-stack { display: grid; gap: 1rem; margin-top: 1rem; }
.demo-card-head { margin-bottom: 1rem; }
.demo-card-head h3 { font-size: 1.35rem; margin-top: 0.25rem; font-family: var(--font-body); font-weight: 600; }
.demo-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

.demo-stage-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
    padding: 0.3rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper-2);
    margin-top: 1rem;
}
@media (max-width: 640px) { .demo-stage-nav { grid-template-columns: 1fr 1fr; } }

.demo-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 640px) { .demo-form-grid { grid-template-columns: 1fr; } }

.demo-metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.demo-metric-card {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--dark-line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.demo-metric-card span {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--dark-muted);
}
.demo-metric-card strong {
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 500;
}

.demo-signal-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.35rem;
}
.demo-signal-list li {
    color: var(--dark-muted);
    font-size: 0.85rem;
    line-height: 1.45;
    padding-left: 0.85rem;
    position: relative;
}
.demo-signal-list li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--brand);
    font-family: var(--font-mono);
}
.demo-signal-list-compact li { font-size: 0.8rem; }

.demo-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.demo-status-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted-2);
}
.demo-status-pill.is-active { color: var(--ok); border-color: #b4e0c5; background: #ecf8f0; }
.demo-status-pill.is-active::before { background: var(--ok); }
.demo-status-pill.is-pending { color: #5a4100; border-color: #f0d48c; background: #fdf6e3; }
.demo-status-pill.is-pending::before { background: #c78a00; }

.demo-device-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.demo-device-summary { color: var(--muted); font-size: 0.88rem; }

.demo-linking-layout {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 1rem;
    align-items: start;
    margin: 1rem 0;
}
@media (max-width: 720px) { .demo-linking-layout { grid-template-columns: 1fr; } }

.demo-inline-code {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
    word-break: break-all;
}

.demo-qr-empty {
    color: var(--muted-2);
    font-size: 0.82rem;
    text-align: center;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.demo-current-step-copy { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.7rem; }

.demo-attribute-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: grid;
    gap: 0.35rem;
}
.demo-attribute-list li {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--muted);
    padding-left: 0.85rem;
    position: relative;
}
.demo-attribute-list li::before {
    content: "•";
    color: var(--brand);
    position: absolute;
    left: 0;
}

.demo-upcoming-shell {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-upcoming-list {
    margin: 0.55rem 0 0;
    padding: 0 0 0 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--muted);
    display: grid;
    gap: 0.3rem;
}

.demo-review-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .demo-review-layout { grid-template-columns: 1fr; } }
/* `min-width: 0` lets the grid track shrink below its content's intrinsic
   min-content size. Without it, a long unbroken token inside a child `<pre>`
   forces the track wider than the viewport. Wrapping on `.demo-code-block`
   handles the common case; this is belt-and-braces for any future child
   that's not as well-behaved. */
.demo-review-column { display: grid; gap: 0.75rem; min-width: 0; }

.demo-review-toggle {
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-review-toggle > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}
.demo-review-toggle > summary::-webkit-details-marker { display: none; }
.demo-review-toggle > summary::before {
    content: "›";
    font-family: var(--font-mono);
    color: var(--brand);
    transition: transform var(--d-base);
    display: inline-block;
}
.demo-review-toggle[open] > summary::before { transform: rotate(90deg); }
.demo-review-toggle pre {
    margin-top: 0.85rem;
    padding: 0.85rem;
    background: var(--ink);
    color: #d6dbe6;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-x: auto;
}

.demo-token-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-token-meta > div { display: grid; gap: 0.2rem; }
.demo-token-meta span {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted-2);
}
.demo-token-meta strong { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 500; }

.demo-summary-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    margin: 0;
}
@media (max-width: 640px) { .demo-summary-list { grid-template-columns: 1fr; } }
.demo-summary-list > div { display: grid; gap: 0.2rem; }
.demo-summary-list dt {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted-2);
}
.demo-summary-list dd {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: var(--ink);
    font-weight: 500;
    word-break: break-word;
}

.demo-stage-list { display: grid; gap: 0.5rem; }
.demo-stage-card {
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-stage-card.demo-stage-completed { border-left-color: var(--ok); }
.demo-stage-card.demo-stage-active,
.demo-stage-card.demo-stage-in_progress { border-left-color: var(--brand); }
.demo-stage-card.demo-stage-waiting,
.demo-stage-card.demo-stage-pending { border-left-color: #c78a00; }
.demo-stage-card.demo-stage-failed { border-left-color: #a63a4a; }

.demo-stage-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}
.demo-stage-head strong {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ink);
}
.demo-stage-card p {
    color: var(--muted);
    font-size: 0.87rem;
    line-height: 1.5;
    margin: 0;
}
.demo-stage-meta {
    margin-top: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--muted-2);
}

.demo-inline-status {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: var(--paper-2);
    color: var(--muted);
    border: 1px solid var(--line);
}

.demo-event-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.demo-event-item {
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-event-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}
.demo-event-head strong {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ink);
}
.demo-event-head span {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--muted-2);
}
.demo-event-item p {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.demo-empty {
    padding: 0.9rem 1rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--paper);
    color: var(--muted);
    font-size: 0.88rem;
    text-align: center;
    font-family: var(--font-body);
}
.demo-empty strong {
    display: block;
    color: var(--ink);
    margin-bottom: 0.25rem;
    font-weight: 600;
}
.demo-event-item.demo-empty { text-align: left; }
.demo-event-item.demo-empty strong { display: block; }

.demo-last-action {
    margin-top: 0.8rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}
.demo-last-action > summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    list-style: none;
    font-family: var(--font-body);
}
.demo-last-action > summary::-webkit-details-marker { display: none; }
.demo-last-action > summary::before {
    content: "›";
    font-family: var(--font-mono);
    color: var(--brand);
    margin-right: 0.5rem;
    transition: transform var(--d-base);
    display: inline-block;
}
.demo-last-action[open] > summary::before { transform: rotate(90deg); }
.demo-action-details {
    margin-top: 0.85rem;
    padding: 0.85rem;
    background: var(--ink);
    color: #d6dbe6;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-x: auto;
}

.demo-journey-card.is-active { display: block; }
.demo-journey-card[hidden] { display: none; }

/* =========================================================
   LINK DEVICE (link_device.html) utility styles
   ========================================================= */

.device-link-form {
    display: grid;
    gap: 0.9rem;
    max-width: 560px;
    margin-top: 0.5rem;
}
.form-field { display: grid; gap: 0.35rem; }
.form-field label { font-size: 0.85rem; font-weight: 500; color: var(--ink); }

.link-code-panel {
    display: grid;
    gap: 0.4rem;
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
    margin: 1rem 0;
}
.link-principal-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 0.3rem;
}
.link-principal-value { font-size: 1rem; }
.link-status-pill {
    align-self: start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
}
.link-status-pill::before {
    content: "";
    width: 6px; height: 6px; border-radius: 999px;
    background: var(--brand);
}
.link-expiry { font-size: 0.85rem; color: var(--muted); }
.link-dark-note { color: var(--dark-muted); font-size: 0.9rem; margin-top: 0.8rem; }

.utility-note {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 0.6rem 0.85rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    margin-top: 0.8rem;
}
.utility-note code { font-size: 0.82rem; }
.utility-note-error { border-color: #e9b2ba; background: #fbeaec; color: #6a1520; }

/* =========================================================
   Utility classes
   ========================================================= */

.stack-sm { display: grid; gap: 0.5rem; }
.stack-md { display: grid; gap: 1rem; }
.stack-lg { display: grid; gap: 1.75rem; }

.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--muted); }

/* =========================================================
   Long-form developer guide pages
   ========================================================= */

.guide-layout {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: clamp(1.75rem, 3vw, 3rem);
    align-items: start;
}
@media (max-width: 920px) {
    .guide-layout { grid-template-columns: minmax(0, 1fr); }
    .guide-toc { position: static !important; }
}

.guide-toc {
    position: sticky;
    top: 5.5rem;
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1rem 1rem 1.1rem;
    border-left: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
.guide-toc strong {
    display: block;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.68rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
}
.guide-toc a {
    display: block;
    padding: 0.22rem 0;
    color: var(--muted);
    text-decoration: none;
    border-left: 1px solid transparent;
    padding-left: 0.65rem;
    margin-left: -0.75rem;
    transition: color var(--d-base), border-color var(--d-base);
}
.guide-toc a:hover { color: var(--ink); }
.guide-toc a.is-active { color: var(--ink); border-color: var(--brand); }

.guide-body { min-width: 0; display: grid; gap: 2.2rem; }
.guide-body > section { scroll-margin-top: 5rem; }
.guide-body h2 {
    font-size: clamp(1.55rem, 2.8vw, 2.1rem);
    margin-bottom: 0.9rem;
}
.guide-body h3 {
    font-size: 1.15rem;
    margin: 1.4rem 0 0.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.guide-body p { color: var(--ink-2); max-width: 68ch; }
.guide-body p + p { margin-top: 0.7rem; }
.guide-body ul, .guide-body ol { max-width: 68ch; color: var(--ink-2); padding-left: 1.1rem; }
.guide-body li + li { margin-top: 0.35rem; }
.guide-body hr { border-top: 1px solid var(--line); margin: 1.75rem 0 0.5rem; }

.callout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-md);
    background: var(--paper-2);
    font-size: 0.95rem;
    color: var(--ink-2);
}
.callout .callout-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 0.1rem;
}
.callout-warn { border-left-color: #c17b00; background: #fdf6e3; }
.callout-warn .callout-label { color: #7a4a00; }
.callout-ok { border-left-color: var(--ok); background: #ecf8f0; }
.callout-ok .callout-label { color: #0a3d1f; }

.endpoint-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper-2);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    align-items: center;
}
.endpoint-method {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    background: var(--ink);
    color: var(--paper);
    text-transform: uppercase;
}
.endpoint-method.get { background: var(--brand); }
.endpoint-method.del { background: var(--danger); }

.field-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.6rem;
}
.field-table th, .field-table td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    line-height: 1.45;
}
.field-table th {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line-strong);
    font-weight: 500;
}
.field-table td:first-child {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--brand-deep);
    white-space: nowrap;
}
.field-table td:nth-child(2) {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}
.field-table .required {
    color: var(--danger);
    font-size: 0.72rem;
    font-family: var(--font-mono);
    margin-left: 0.25rem;
}

.framework-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper-2);
    width: fit-content;
    margin-bottom: 0.9rem;
}
.framework-tabs button {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    cursor: pointer;
    transition: background var(--d-base), color var(--d-base);
}
.framework-tabs button.is-active { background: var(--ink); color: var(--paper); }

.guide-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
}
.guide-hero-meta span {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper-2);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
}

.guide-next-prev {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}
@media (max-width: 680px) { .guide-next-prev { grid-template-columns: 1fr; } }
.guide-next-prev a {
    display: block;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--ink);
    transition: border-color var(--d-base), transform var(--d-base);
}
.guide-next-prev a:hover { border-color: var(--ink); transform: translateY(-2px); }
.guide-next-prev .nav-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.25rem;
    display: block;
}
.guide-next-prev strong { font-family: var(--font-display); font-size: 1.1rem; font-weight: 400; }

/* =========================================================
   Responsive
   ========================================================= */

/* ---------- Mobile + tablet: burger nav ---------- */
@media (max-width: 1024px) {
    .site-header {
        grid-template-columns: auto 1fr auto;
        padding: 0.5rem 0.75rem 0.5rem 0.9rem;
        gap: 0.5rem;
    }
    .header-cta { display: none; }
    .site-nav-toggle { display: inline-flex; justify-self: end; grid-column: 3; }

    .site-nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100dvh;
        width: min(340px, 86vw);
        background: var(--paper-2);
        border-left: 1px solid var(--line);
        box-shadow: -12px 0 40px -20px rgba(11, 11, 13, 0.4);
        padding: 5rem 1.25rem 1.75rem;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
        z-index: 39;
        transform: translateX(100%);
        transition: transform var(--d-base) var(--ease-out);
        overflow-y: auto;
        justify-self: auto;
    }
    .site-nav.is-open { transform: translateX(0); }
    .site-nav a {
        padding: 0.95rem 1rem;
        font-size: 1rem;
        font-weight: 500;
        border-radius: var(--radius-md);
        color: var(--ink-2);
        border-bottom: 1px solid var(--line-soft);
    }
    .site-nav a:hover { background: var(--paper); }
    .site-nav a.is-active { background: var(--brand-soft); color: var(--brand-ink); }
    .site-nav a.is-active::after { display: none; }
    .site-nav-cta {
        display: inline-flex;
        justify-content: center;
        margin-top: 0.75rem;
        padding: 0.95rem 1rem !important;
        background: var(--ink);
        color: var(--paper) !important;
        border-radius: 999px;
        border-bottom: none !important;
        font-family: var(--font-body);
        font-weight: 500;
        text-decoration: none;
    }
    .site-nav-cta:hover { background: var(--brand) !important; color: #fff !important; }

    .site-nav-backdrop { display: block; opacity: 0; pointer-events: none; }
    .site-nav-backdrop.is-visible { opacity: 1; pointer-events: auto; }
}

/* ---------- Phone adjustments ---------- */
@media (max-width: 640px) {
    body { font-size: 16px; }
    .page-shell { width: min(1240px, 100% - 1.25rem); padding-bottom: 2rem; }
    .site-header {
        top: 0.5rem;
        padding: 0.4rem 0.65rem 0.4rem 0.75rem;
    }
    .brand-mark { font-size: 1.1rem; }
    .brand-icon { width: 20px; height: 20px; }
    .hero { padding: 1.75rem 1.25rem; }
    .clarity-list > div { grid-template-columns: 1fr; gap: 0.2rem; }
}
