/* ═══════════════════════════════════════════════════════════════════
   SemPKM Walkthroughs — scrollytelling persona flows
   Isolated stylesheet: nothing here touches the classic site.
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --border-subtle: #1e1e2e;
    --text-primary: #e8e8f0;
    --text-secondary: #9898b0;
    --text-muted: #68688a;
    --accent-1: #e8772e;
    --accent-2: #f59e0b;
    --accent-gradient: linear-gradient(135deg, #e8772e, #f59e0b);
    --green: #34d399;
    --amber: #fbbf24;
    --radius-lg: 12px;
    --radius-md: 8px;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;

    /* Graph-paper background: fine minor grid + stronger major grid */
    background-image:
        linear-gradient(rgba(232, 119, 46, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 119, 46, 0.045) 1px, transparent 1px),
        linear-gradient(rgba(152, 152, 176, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(152, 152, 176, 0.05) 1px, transparent 1px);
    background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
    background-position: -1px -1px;
}

a { color: inherit; }
kbd {
    font-family: var(--mono);
    font-size: 0.78em;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0.1em 0.4em;
    color: var(--text-secondary);
}
code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 0.1em 0.35em;
    color: var(--accent-2);
}

.gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ── Nav ─────────────────────────────────────────────────────────── */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.nav-logo {
    font-size: 1.25rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.02em;
}
.nav-logo span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    list-style: none;
}
.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.92rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.nav-cta {
    color: #0a0a0f;
    background: var(--accent-gradient);
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-md);
}
.nav-links a.nav-cta:hover { opacity: 0.9; color: #0a0a0f; }

/* ── Hero ────────────────────────────────────────────────────────── */
.wt-hero {
    max-width: 760px;
    margin: 0 auto;
    padding: 7rem 1.5rem 5rem;
    text-align: center;
}
.wt-hero h1 {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
}
.wt-hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto;
}
/* ── Flow tabs (persona switcher) ────────────────────────────────── */
.flow-tabs {
    position: sticky;
    top: 57px; /* just below the nav */
    z-index: 90;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}
.flow-tabs-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.6rem 1.5rem;
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.flow-tabs-inner::-webkit-scrollbar { display: none; }
.flow-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    font-family: inherit;
    text-align: left;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.45rem 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.flow-tab strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}
.flow-tab span {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.flow-tab:hover { border-color: var(--text-muted); }
.flow-tab-active {
    border-color: rgba(232, 119, 46, 0.55);
    background: rgba(232, 119, 46, 0.09);
}
.flow-tab-active span { color: var(--accent-2); }

/* ── Walkthrough layout ──────────────────────────────────────────── */
.walkthrough {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 4rem;
    /* NOTE: columns must stretch to the full row height (the default) —
       align-items:start would collapse .stage-col to its content height
       and leave position:sticky with no room to travel. */
}

.stage-col { min-width: 0; }
.stage {
    position: sticky;
    top: calc(50vh - 230px);              /* stuck: vertically centered */
    margin-top: calc(46vh - 230px);       /* start: aligned with step 1's center */
}

/* Browser frame */
.stage-frame {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(232, 119, 46, 0.06),
        0 24px 60px -18px rgba(0, 0, 0, 0.65);
}
.stage-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.6rem 0.9rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
}
.stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-subtle);
    flex-shrink: 0;
}
.stage-dot:nth-child(1) { background: #4a3038; }
.stage-dot:nth-child(2) { background: #4a4230; }
.stage-dot:nth-child(3) { background: #2f4a38; }
.stage-url {
    flex: 1;
    margin-left: 0.6rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.25rem 0.7rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stage-url .stage-clock {
    color: var(--accent-2);
    font-weight: 500;
}
.stage-body {
    position: relative;
    height: 420px;
    background: var(--bg-primary);
    overflow: hidden;
}

/* Scenes: stacked, crossfade */
.scene {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
}
.scene-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    z-index: 1;
}

/* ── Steps column ────────────────────────────────────────────────── */
.steps-col {
    min-width: 0;
    padding: 12vh 0 18vh;
}
.step {
    min-height: 68vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0 2rem 1.75rem;
    border-left: 2px solid var(--border-subtle);
    opacity: 0.35;
    transition: opacity 0.4s ease, border-color 0.4s ease;
}
.step-active {
    opacity: 1;
    border-left-color: var(--accent-1);
}
.step-time {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--accent-2);
    margin-bottom: 0.75rem;
}
.step h2 {
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 0.9rem;
}
.step p {
    color: var(--text-secondary);
    font-size: 1.02rem;
    max-width: 46ch;
}

/* ── Finale ──────────────────────────────────────────────────────── */
.wt-finale {
    max-width: 700px;
    margin: 0 auto;
    padding: 4rem 1.5rem 6rem;
    text-align: center;
}
.wt-finale h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.wt-finale > p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2.25rem;
}
.wt-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.btn {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.8rem 1.75rem;
    border-radius: var(--radius-md);
    transition: opacity 0.2s, border-color 0.2s;
}
.btn-primary {
    background: var(--accent-gradient);
    color: #0a0a0f;
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    background: var(--bg-card);
}
.btn-secondary:hover { border-color: var(--text-muted); }
.wt-back { margin-top: 2.5rem; }
.wt-back a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
}
.wt-back a:hover { color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════════
   Mini-UI scenes
   ═══════════════════════════════════════════════════════════════════ */

/* Shared bits */
.mini-type-chip {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--accent-2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.08);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    white-space: nowrap;
}
.mini-field {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-bottom: 0.7rem;
}
.mini-field-tall { min-height: 3.4rem; color: var(--text-secondary); }
.mini-tag {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--accent-1);
}

/* Scene 1 — command palette + capture */
.mini-workspace-dim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(var(--border-subtle) 1px, transparent 1px) 0 0 / 100% 44px,
        var(--bg-primary);
    opacity: 0.5;
}
.mini-palette {
    position: relative;
    width: min(340px, 88%);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 45px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    margin-bottom: 1.1rem;
}
.mini-palette-input {
    padding: 0.7rem 0.9rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}
.mini-palette-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.mini-palette-item-active {
    background: rgba(232, 119, 46, 0.12);
    color: var(--text-primary);
}
.mini-note-card {
    position: relative;
    width: min(340px, 88%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.8rem 0.9rem;
}
.mini-note-card .mini-type-chip { float: right; }
.mini-note-title {
    font-size: 0.85rem;
    line-height: 1.45;
    padding-right: 0.5rem;
}
.mini-caret {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent-2);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.scene-1-stack { position: relative; }

/* Scene 2 — schema form */
.mini-form {
    width: min(400px, 92%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
}
.mini-form-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.7rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.88rem;
}
.mini-form label {
    display: block;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.mini-form label em {
    color: var(--accent-1);
    font-style: normal;
}
.mini-form-note {
    font-size: 0.74rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-subtle);
    padding-top: 0.6rem;
    margin-top: 0.1rem;
}

/* Scene 3 — relations */
.mini-relations {
    width: min(400px, 92%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    font-size: 0.82rem;
}
.mini-rel-head, .mini-rel-group {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}
.mini-rel-head {
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-subtle);
}
.mini-rel-group { margin: 0.6rem 0 0.3rem; }
.mini-rel-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.32rem 0;
    flex-wrap: wrap;
}
.mini-pred {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--accent-2);
}
.mini-arrow { color: var(--text-muted); }
.mini-rel-row a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--border-subtle);
    text-underline-offset: 3px;
    cursor: pointer;
}
.mini-badge {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.08);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
}

/* Scene 4 — views */
.mini-views { width: min(420px, 94%); }
.mini-view-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}
.mini-view-tab {
    font-size: 0.74rem;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
}
.mini-view-tab-active {
    color: var(--text-primary);
    border-color: rgba(232, 119, 46, 0.5);
    background: rgba(232, 119, 46, 0.1);
}
.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.mini-table th, .mini-table td {
    text-align: left;
    padding: 0.42rem 0.7rem;
    border-bottom: 1px solid var(--border-subtle);
}
.mini-table th {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-card);
}
.mini-table tr:last-child td { border-bottom: none; }
.mini-pill {
    font-family: var(--mono);
    font-size: 0.62rem;
    color: var(--amber);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
}
.mini-pill-green {
    color: var(--green);
    border-color: rgba(52, 211, 153, 0.3);
}
.mini-kanban {
    display: flex;
    gap: 0.6rem;
}
.mini-kcol {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem;
}
.mini-kcol > span {
    display: block;
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}
.mini-kcard {
    height: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 5px;
    margin-bottom: 0.4rem;
}
.mini-kcard-hi { border-color: rgba(232, 119, 46, 0.5); }

/* Scene 5 — validation */
.mini-lint {
    width: min(400px, 92%);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.mini-lint-warn {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-md);
    padding: 0.8rem 0.9rem;
    font-size: 0.82rem;
    color: var(--amber);
}
.mini-lint-warn svg { flex-shrink: 0; margin-top: 2px; }
.mini-lint-warn strong { color: var(--text-primary); font-weight: 600; }
.mini-lint-warn span {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}
.mini-lint-fix label {
    display: block;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.mini-lint-fix .mini-field { margin-bottom: 0; }
.mini-lint-pass {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.9rem;
    font-size: 0.84rem;
    color: var(--green);
    font-weight: 500;
}
.mini-lint-pass svg { flex-shrink: 0; }

/* Scene 6 — event log */
.mini-log {
    width: min(430px, 94%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
}
.mini-log-head {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding-bottom: 0.6rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-subtle);
}
.mini-log-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0;
    font-size: 0.78rem;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}
.mini-log-row:last-of-type { border-bottom: none; }
.mini-op {
    font-family: var(--mono);
    font-size: 0.64rem;
    border-radius: 4px;
    padding: 0.08rem 0.4rem;
    white-space: nowrap;
}
.mini-op-amber {
    color: var(--amber);
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.25);
}
.mini-op-green {
    color: var(--green);
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.25);
}
.mini-log-meta {
    font-family: var(--mono);
    font-size: 0.64rem;
    color: var(--text-muted);
    margin-left: auto;
}
.mini-log-actions { display: inline-flex; gap: 0.4rem; }
.mini-log-actions i {
    font-style: normal;
    font-family: var(--mono);
    font-size: 0.62rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 0.05rem 0.4rem;
    cursor: pointer;
}
.mini-log-note {
    font-size: 0.74rem;
    color: var(--text-muted);
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border-subtle);
    margin-top: 0.2rem;
}

/* Stance-colored predicates (Maya flow) */
.mini-pred-green { color: var(--green); }
.mini-pred-red { color: #f87171; }

/* Scene — claims graph */
.mini-graph { width: min(400px, 92%); }
.mini-graph svg {
    width: 100%;
    height: auto;
    display: block;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}
.mg-edge { stroke: var(--border-subtle); stroke-width: 2; }
.mg-edge-green { stroke: rgba(52, 211, 153, 0.55); }
.mg-edge-red { stroke: rgba(248, 113, 113, 0.55); }
.mg-node { fill: var(--bg-card); stroke: var(--text-muted); stroke-width: 1.5; }
.mg-node-q { fill: rgba(232, 119, 46, 0.15); stroke: var(--accent-1); }
.mg-node-green { stroke: var(--green); }
.mg-node-red { stroke: #f87171; }
.mg-label {
    fill: var(--text-primary);
    font-family: var(--mono);
    font-size: 11px;
    text-anchor: middle;
}
.mg-tag {
    fill: var(--text-muted);
    font-family: var(--mono);
    font-size: 10px;
    text-anchor: middle;
}
.mini-graph-legend {
    display: flex;
    gap: 1.1rem;
    justify-content: center;
    margin-top: 0.7rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}
.mini-graph-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.mg-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}
.mg-dot-green { background: var(--green); }
.mg-dot-red { background: #f87171; }
.mg-dot-pulse { animation: dot-pulse 1.6s ease-in-out infinite; }
@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* Scene — SPARQL query */
.mini-query { width: min(420px, 94%); }
.mini-query-head {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.mini-query-code {
    font-family: var(--mono);
    font-size: 0.74rem;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    margin-bottom: 0.8rem;
    overflow-x: auto;
}
.q-kw { color: var(--accent-2); }
.q-pred { color: var(--green); }
.q-obj { color: #f87171; }

/* Scene — federation sync */
.mini-sync {
    width: min(410px, 92%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    font-size: 0.8rem;
}
.mini-sync-head {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding-bottom: 0.6rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-subtle);
}
.mini-sync-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border-subtle);
}
.mini-sync-row:last-of-type { border-bottom: none; }
.mini-sync-row .mini-log-meta { margin-left: auto; }
.mini-sync-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0 0.2rem;
    color: var(--text-secondary);
    font-size: 0.76rem;
}
.mini-sync-stats strong { color: var(--text-primary); }

/* ── Agents teaser flow ──────────────────────────────────────────── */
.agents-teaser {
    max-width: 640px;
    margin: 0 auto;
    padding: 4.5rem 1.5rem 3rem;
    text-align: center;
}
.agents-chip {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: var(--accent-2);
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    margin-bottom: 1.1rem;
}
.agents-teaser h2 {
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.9rem;
}
.agents-teaser > p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}
.agents-frame {
    text-align: left;
    margin-bottom: 1.75rem;
}
.agents-body {
    background: var(--bg-primary);
    padding: 0.6rem 1.1rem;
    font-size: 0.8rem;
}
.agents-body .mini-sync-row { flex-wrap: wrap; }
.agents-goal {
    color: var(--text-muted);
    font-size: 0.74rem;
}
.agents-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.4rem;
}

/* ═══════════════════════════════════════════════════════════════════
   Scene animations — each activation replays the user's action.
   Elements animate to their natural state (fill-mode: both), so the
   global reduced-motion block collapses everything to an instant jump.
   ═══════════════════════════════════════════════════════════════════ */

@keyframes wt-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
@keyframes wt-slide-right {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: none; }
}
@keyframes wt-pop {
    0%   { opacity: 0; transform: scale(0.6); }
    70%  { opacity: 1; transform: scale(1.08); }
    100% { opacity: 1; transform: none; }
}
@keyframes wt-draw {
    from { stroke-dashoffset: 220; }
    to   { stroke-dashoffset: 0; }
}

/* Generic stagger: children of a .stagger container cascade in */
.scene-active .stagger > * { animation: wt-fade-up 0.35s ease both; }
.scene-active .stagger > :nth-child(2) { animation-delay: 0.10s; }
.scene-active .stagger > :nth-child(3) { animation-delay: 0.20s; }
.scene-active .stagger > :nth-child(4) { animation-delay: 0.30s; }
.scene-active .stagger > :nth-child(5) { animation-delay: 0.40s; }
.scene-active .stagger > :nth-child(6) { animation-delay: 0.50s; }
.scene-active .stagger > :nth-child(7) { animation-delay: 0.60s; }
.scene-active .stagger > :nth-child(8) { animation-delay: 0.70s; }
.scene-active .stagger > :nth-child(9) { animation-delay: 0.80s; }

/* ── Capture scene: pick "Create new object", palette closes,
      the note card appears and the thought types in ── */
.mini-note-wide { width: min(500px, 94%); }
@keyframes wt-palette-cycle {
    0%        { opacity: 0; transform: translateY(8px); }
    7%, 30%   { opacity: 1; transform: none; }
    38%, 100% { opacity: 0; transform: scale(0.98); }
}
@keyframes wt-item-select {
    0%       { opacity: 0; transform: translateY(8px); background: rgba(232, 119, 46, 0.12); }
    6%, 100% { opacity: 1; transform: none; }
    0%, 21%  { background: rgba(232, 119, 46, 0.12); }
    24%, 28% { background: rgba(232, 119, 46, 0.4); }
    32%, 100% { background: rgba(232, 119, 46, 0.12); }
}
.scene-active .mini-palette { animation: wt-palette-cycle 4.2s ease both; }
.scene-active .stagger > .mini-palette-item-active { animation: wt-item-select 4.2s linear both; animation-delay: 0s; }
.scene-active .mini-note-card { animation: wt-fade-up 0.4s ease 1.7s both; }
.scene-active .mini-note-title .mini-typetext-live { animation-duration: 1.5s; animation-delay: 2.2s; }

/* ── Form scenes: the title types in, remaining values fill after ── */
.scene-active .mini-typetext-live { animation: wt-type 1s steps(24, end) 0.9s both; }
@keyframes wt-caret-window {
    0%, 20%  { opacity: 0; }
    22%, 48% { opacity: 1; }
    50%, 100% { opacity: 0; }
}
.mini-caret-live { animation: none; }
.scene-active .mini-caret-live { animation: wt-caret-window 4s linear both; }
.mini-fill { display: inline; }
.scene-active .mini-fill-1 { animation: wt-fade-up 0.3s ease 2.1s both; display: inline-block; }
.scene-active .mini-fill-2 { animation: wt-fade-up 0.35s ease 2.5s both; display: inline-block; }
.scene-active .stagger > .mini-form-note { animation-delay: 3.1s; }

/* ── Query scene: cursor clicks Run, results land ── */
.mini-query { position: relative; }
.mini-query-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mini-run {
    font-family: var(--mono);
    font-size: 0.66rem;
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 5px;
    padding: 0.12rem 0.5rem;
    background: rgba(52, 211, 153, 0.07);
}
@keyframes mq-cursor {
    0%        { opacity: 0; transform: translate(230px, 70px) scale(1); }
    14%, 26%  { opacity: 1; transform: translate(230px, 70px) scale(1); }
    48%       { transform: translate(355px, 0px) scale(1); }
    54%       { transform: translate(355px, 0px) scale(0.8); }
    60%, 100% { opacity: 1; transform: translate(355px, 0px) scale(1); }
}
@keyframes mq-run-flash {
    0%, 52%   { background: rgba(52, 211, 153, 0.07); }
    56%, 64%  { background: rgba(52, 211, 153, 0.35); }
    72%, 100% { background: rgba(52, 211, 153, 0.07); }
}
.scene-active .mini-query .mv-cursor { animation: mq-cursor 2.8s ease-in-out 0.3s both; }
.scene-active .mini-run { animation: mq-run-flash 2.8s linear 0.3s both; }

/* Relations: rows slide in; the inferred badge pops last */
.scene-active .mini-relations > .mini-rel-row { animation-name: wt-slide-right; }
.scene-active .mini-badge {
    animation: wt-pop 0.35s ease 1s both;
    display: inline-block;
}

/* ── Views scene: a cursor clicks Table → Kanban → Graph ─────────── */
.mini-views { position: relative; }
.mini-view-body { position: relative; height: 190px; margin-top: 0.7rem; }
.mv-panel { position: absolute; inset: 0; opacity: 0; }
.mv-panel-table { opacity: 1; }
.mv-panel .mini-kanban { margin-top: 0; height: 100%; }
.mv-graph { width: 100%; height: 100%; display: block; }
.mv-graph line { stroke: #3a3a52; stroke-width: 1.3; }
.mv-graph circle { fill: var(--bg-card); stroke: var(--text-secondary); stroke-width: 1.5; }
.mv-graph .mv-g-center { fill: #2a1c12; stroke: var(--accent-1); stroke-width: 2; }
.mv-graph .mv-g-green { stroke: var(--green); }
.mv-cursor {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    opacity: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

@keyframes mv-cursor-move {
    0%       { opacity: 0; transform: translate(24px, 12px) scale(1); }
    8%, 28%  { opacity: 1; transform: translate(24px, 12px) scale(1); }
    36%      { transform: translate(90px, 12px) scale(1); }
    39%      { transform: translate(90px, 12px) scale(0.8); }
    42%, 64% { transform: translate(90px, 12px) scale(1); }
    72%      { transform: translate(153px, 12px) scale(1); }
    75%      { transform: translate(153px, 12px) scale(0.8); }
    78%, 100% { opacity: 1; transform: translate(153px, 12px) scale(1); }
}
@keyframes mv-show-table  { 0%, 40% { opacity: 1; } 44%, 100% { opacity: 0; } }
@keyframes mv-show-kanban { 0%, 40% { opacity: 0; } 44%, 74% { opacity: 1; } 78%, 100% { opacity: 0; } }
@keyframes mv-show-graph  { 0%, 74% { opacity: 0; } 78%, 100% { opacity: 1; } }
@keyframes mv-tab-1 {
    0%, 40%   { color: #e8e8f0; border-color: rgba(232, 119, 46, 0.5); background: rgba(232, 119, 46, 0.1); }
    44%, 100% { color: #68688a; border-color: #1e1e2e; background: transparent; }
}
@keyframes mv-tab-2 {
    0%, 40%   { color: #68688a; border-color: #1e1e2e; background: transparent; }
    44%, 74%  { color: #e8e8f0; border-color: rgba(232, 119, 46, 0.5); background: rgba(232, 119, 46, 0.1); }
    78%, 100% { color: #68688a; border-color: #1e1e2e; background: transparent; }
}
@keyframes mv-tab-3 {
    0%, 74%   { color: #68688a; border-color: #1e1e2e; background: transparent; }
    78%, 100% { color: #e8e8f0; border-color: rgba(232, 119, 46, 0.5); background: rgba(232, 119, 46, 0.1); }
}

.scene-active .mini-view-tabs { animation: wt-fade-up 0.35s ease both; }
.scene-active .mini-view-body { animation: wt-fade-up 0.35s ease 0.1s both; }
.scene-active .mini-views .mv-cursor { animation: mv-cursor-move 5.5s ease-in-out 0.5s both; }
.scene-active .mv-panel-table  { animation: mv-show-table 5.5s linear 0.5s both; }
.scene-active .mv-panel-kanban { animation: mv-show-kanban 5.5s linear 0.5s both; }
.scene-active .mv-panel-graph  { animation: mv-show-graph 5.5s linear 0.5s both; }
.scene-active .mini-view-tab:nth-child(1) { animation: mv-tab-1 5.5s linear 0.5s both; }
.scene-active .mini-view-tab:nth-child(2) { animation: mv-tab-2 5.5s linear 0.5s both; }
.scene-active .mini-view-tab:nth-child(3) { animation: mv-tab-3 5.5s linear 0.5s both; }
/* the moved card slides in while the kanban view is up */
.scene-active .mini-kcard-hi { animation: wt-slide-right 0.5s ease 3.1s both; }

/* ── Lint scene: Alice types the action item, warning turns green ── */
.mini-typetext {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    vertical-align: bottom;
}
@keyframes wt-type { from { max-width: 0; } to { max-width: var(--type-w, 200px); } }
@keyframes wt-caret-off { to { opacity: 0; } }
@keyframes wt-warn-cycle {
    0%        { opacity: 0; transform: translateY(8px); }
    9%, 62%   { opacity: 1; transform: none; }
    76%, 100% { opacity: 0.22; transform: none; }
}
.scene-active .stagger > .mini-lint-warn { animation: wt-warn-cycle 4s ease both; animation-delay: 0s; }
.scene-active .stagger > .mini-lint-fix  { animation: wt-fade-up 0.35s ease both; animation-delay: 0.7s; }
.scene-active .stagger > .mini-lint-pass { animation: wt-pop 0.4s ease both; animation-delay: 2.7s; }
.scene-active .mini-lint-fix .mini-typetext { animation: wt-type 1.2s steps(22, end) 1.3s both; }
.scene-active .mini-caret-fix {
    animation: caret-blink 1.1s steps(1) infinite,
               wt-caret-off 0.01s linear 2.6s forwards;
}

/* Claims graph: edges draw, nodes pop, labels settle last */
.scene-active .mini-graph .mg-edge {
    stroke-dasharray: 220;
    animation: wt-draw 0.7s ease-out both;
}
.scene-active .mini-graph .mg-edge:nth-of-type(2) { animation-delay: 0.12s; }
.scene-active .mini-graph .mg-edge:nth-of-type(3) { animation-delay: 0.24s; }
.scene-active .mini-graph .mg-edge:nth-of-type(4) { animation-delay: 0.36s; }
.scene-active .mini-graph .mg-node {
    transform-box: fill-box;
    transform-origin: center;
    animation: wt-pop 0.4s ease both;
}
.scene-active .mini-graph circle.mg-node:nth-of-type(2) { animation-delay: 0.15s; }
.scene-active .mini-graph circle.mg-node:nth-of-type(3) { animation-delay: 0.25s; }
.scene-active .mini-graph circle.mg-node:nth-of-type(4) { animation-delay: 0.35s; }
.scene-active .mini-graph circle.mg-node:nth-of-type(5) { animation-delay: 0.45s; }
.scene-active .mini-graph .mg-label,
.scene-active .mini-graph .mg-tag { animation: wt-fade-up 0.35s ease 0.55s both; }
.scene-active .mini-graph-legend { animation: wt-fade-up 0.35s ease 0.75s both; }

/* Claims: stance predicates pop once their rows have landed */
.scene-active .mini-pred-green,
.scene-active .mini-pred-red {
    display: inline-block;
    animation: wt-pop 0.35s ease both;
}
.scene-active .mini-pred-green { animation-delay: 0.75s; }
.scene-active .mini-pred-red   { animation-delay: 0.95s; }

/* Query: the code appears first, then results arrive as it "runs" */
.scene-active .mini-query .mini-table tr:not(:first-child) {
    animation: wt-fade-up 0.3s ease both;
}
.scene-active .mini-query .mini-table tr:nth-child(2) { animation-delay: 1.9s; }
.scene-active .mini-query .mini-table tr:nth-child(3) { animation-delay: 2.1s; }

/* Views: table rows cascade in under the header */
.scene-active .mini-views .mini-table tr:not(:first-child) {
    animation: wt-fade-up 0.3s ease both;
}
.scene-active .mini-views .mini-table tr:nth-child(2) { animation-delay: 0.35s; }
.scene-active .mini-views .mini-table tr:nth-child(3) { animation-delay: 0.45s; }
.scene-active .mini-views .mini-table tr:nth-child(4) { animation-delay: 0.55s; }

/* Sync: peers slide in one by one */
.scene-active .mini-sync > .mini-sync-row { animation-name: wt-slide-right; }

/* ═══════════════════════════════════════════════════════════════════
   Mobile: stage pins to top, steps scroll beneath
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .walkthrough {
        /* block, not grid: a sticky child of a single-column grid can only
           travel within its own row, which is just its content height */
        display: block;
        padding: 0;
    }
    .stage-col {
        position: sticky;
        top: 106px; /* below the nav + flow tabs */
        z-index: 50;
        background: linear-gradient(var(--bg-primary) 88%, transparent);
        padding: 0.75rem 1rem 1.25rem;
    }
    .stage { position: static; margin-top: 0; }
    .stage-body { height: 360px; }
    .scene { padding: 1rem; }

    /* Compact the form-heavy scenes so they fit the shorter stage */
    .mini-form { padding: 0.75rem 0.85rem; }
    .mini-form-head { padding-bottom: 0.5rem; margin-bottom: 0.6rem; font-size: 0.82rem; }
    .mini-form label, .mini-lint-fix label { margin-bottom: 0.2rem; }
    .mini-field { padding: 0.35rem 0.6rem; margin-bottom: 0.45rem; font-size: 0.78rem; }
    .mini-field-tall { min-height: 2.5rem; }
    .mini-form-note, .mini-log-note { font-size: 0.7rem; padding-top: 0.45rem; }
    .mini-relations, .mini-sync, .mini-log { padding: 0.8rem 0.9rem; }
    .mini-rel-row { padding: 0.26rem 0; }
    .mini-table th, .mini-table td { padding: 0.34rem 0.6rem; }
    .mini-query-code { padding: 0.6rem 0.8rem; font-size: 0.7rem; }
    .mini-note-wide { width: min(500px, 94%); }
    .mini-note-title .mini-typetext-live {
        white-space: normal;
        max-width: none !important;
        animation: wt-fade-up 0.4s ease 2.2s both !important;
    }

    .steps-col { padding: 4vh 1.25rem 10vh; }
    .step {
        min-height: 55vh;
        padding-left: 1.1rem;
    }
    .step p { max-width: none; }

    .wt-hero { padding: 4.5rem 1.25rem 3.5rem; }
    .nav-links a:not(.nav-cta) { display: none; }
}

@media (max-width: 480px) {
    .stage-body { height: 330px; }
    .mini-kanban { display: none; }
}

/* ── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        animation-delay: 0s !important;
        transition-duration: 0.001s !important;
        transition-delay: 0s !important;
    }
}
