/* ============================================================
   LOCI v2 DESIGN SYSTEM — shared across all v2 pages
   Fonts: Inter (voice), IBM Plex Mono (accent)
   ============================================================ */

/* ==========================
   VARIABLES & RESET
   ========================== */
:root {
    --background: #0A0A0A;
    --surface: #141414;
    --surface-2: #1B1B1B;
    --primary-text: #F5F5F5;
    --secondary-text: #A3A3A3;
    --border-color: #262626;
    --border-hover: #8A8A8A;

    /* Signal-family accents (from the product itself), desaturated for dark */
    --sig-amount: #4C8FE0;      /* comparison / amount   */
    --sig-channel: #17A98A;     /* channel               */
    --sig-beneficiary: #9A6BE0; /* beneficiary / logical */
    --sig-velocity: #D9A02B;    /* velocity / aggregation*/
    --sig-location: #D95757;    /* location / action     */

    --ok: #2EBD85;
    --warn: #D9A02B;
    --danger: #E05252;

    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

    --max-width: 1280px;
    --header-height: 64px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--secondary-text);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================
   TYPOGRAPHY
   ========================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--primary-text);
}
h1 { font-size: clamp(2.6rem, 6vw, 4.75rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.4rem); font-weight: 600; }
p  { max-width: 65ch; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--secondary-text);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.eyebrow::before {
    content: '';
    width: 8px; height: 8px;
    background: var(--primary-text);
    display: inline-block;
}
.mono { font-family: var(--font-mono); }

/* ==========================
   LAYOUT
   ========================== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 110px 0; position: relative; }
.section-header { max-width: 720px; margin-bottom: 64px; }
.section-header.centered { margin-left: auto; margin-right: auto; text-align: center; }
.section-header.centered .eyebrow { justify-content: center; }
.section-header p { margin-top: 16px; font-size: 17px; }
.section-header.centered p { margin-left: auto; margin-right: auto; }

.dot-grid {
    background-image: radial-gradient(circle at 1px 1px, var(--border-color) 1px, transparent 0);
    background-size: 24px 24px;
}

/* ==========================
   HEADER
   ========================== */
header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}
nav { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-left { display: flex; align-items: center; gap: 48px; }
.logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: 24px; font-weight: 800;
    color: var(--primary-text);
    letter-spacing: -0.03em;
}
.nav-links { display: flex; list-style: none; gap: 32px; }
.nav-link {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--secondary-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--primary-text); }
.nav-right { display: flex; align-items: center; gap: 12px; }

/* Desktop dropdowns */
.nav-links > li { position: relative; }
.caret { font-size: 9px; margin-left: 4px; opacity: 0.7; }
.nav-drop { position: absolute; top: 100%; left: -14px; padding-top: 14px; display: none; z-index: 1001; }
.nav-item:hover .nav-drop, .nav-item:focus-within .nav-drop { display: block; }
.nav-drop-panel {
    background: #0D0D0D;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    min-width: 250px;
    padding: 8px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.5);
}
.nav-drop-panel a {
    display: block;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--secondary-text);
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 6px;
    transition: all 0.15s;
}
.nav-drop-panel a:hover { color: var(--primary-text); background: var(--surface-2); }
.nav-drop-panel a.active { color: var(--primary-text); }
.nav-drop-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: #6B6B6B;
    padding: 10px 12px 4px;
}
.nav-drop-label:not(:first-child) { border-top: 1px solid var(--border-color); margin-top: 6px; padding-top: 12px; }

/* Mobile menu */
.nav-toggle {
    display: none;
    align-items: center; justify-content: center;
    padding: 10px 16px;
    font-family: var(--font-mono);
    font-size: 14px; font-weight: 500;
    border-radius: 6px;
    background: transparent;
    color: var(--secondary-text);
    border: 1px solid var(--border-color);
    cursor: pointer;
}
.nav-toggle:hover { color: var(--primary-text); border-color: var(--secondary-text); }
#mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height); left: 0; right: 0; bottom: 0;
    background: rgba(10,10,10,0.98);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    overflow-y: auto;
    padding: 28px 24px 48px;
    z-index: 999;
}
#mobile-menu.open { display: block; }
body.menu-open { overflow: hidden; }
.mm-group { margin-bottom: 28px; }
.mm-label {
    font-family: var(--font-mono);
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--secondary-text);
    margin-bottom: 6px;
}
.mm-link {
    display: block;
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--primary-text);
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.mm-link.mm-single { margin-bottom: 28px; }
.mm-ctas { display: grid; gap: 12px; margin-top: 8px; }
@media (max-width: 992px) { .nav-toggle { display: inline-flex; } }
@media (min-width: 993px) { #mobile-menu { display: none !important; } }

/* ==========================
   BUTTONS
   ========================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-mono);
    font-size: 14px; font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s var(--ease-out);
    cursor: pointer;
    border: 1px solid transparent;
}
.btn-primary { background: var(--primary-text); color: #000; border-color: var(--primary-text); }
.btn-primary:hover { background: transparent; color: var(--primary-text); }
.btn-secondary { background: transparent; color: var(--secondary-text); border-color: var(--border-color); }
.btn-secondary:hover { color: var(--primary-text); border-color: var(--secondary-text); }
.btn-large { padding: 14px 28px; font-size: 15px; }

/* ==========================
   HERO
   ========================== */
.hero {
    padding-top: calc(var(--header-height) + 100px);
    padding-bottom: 80px;
    position: relative;
    overflow: hidden;
}
.hero-content { text-align: center; max-width: 940px; margin: 0 auto; }
.hero-content .eyebrow { justify-content: center; animation: fadeInUp 0.6s var(--ease-out); }
.hero h1 { margin-bottom: 28px; animation: fadeInUp 0.6s 0.1s var(--ease-out) both; }
.hero h1 em { font-style: normal; color: var(--secondary-text); }
.hero-description {
    font-size: 18px;
    margin: 0 auto 20px auto;
    max-width: 62ch;
    animation: fadeInUp 0.6s 0.2s var(--ease-out) both;
}
.hero-stats-line {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--primary-text);
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px;
    margin-bottom: 44px;
    animation: fadeInUp 0.6s 0.25s var(--ease-out) both;
}
.hero-stats-line span::before { content: '▸ '; color: var(--secondary-text); }
.hero-ctas {
    display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap;
    animation: fadeInUp 0.6s 0.3s var(--ease-out) both;
}
.hero-video-link {
    font-family: var(--font-mono); font-size: 14px;
    color: var(--secondary-text); text-decoration: none;
    border-bottom: 1px dashed var(--border-hover);
}
.hero-video-link:hover { color: var(--primary-text); }

/* ==========================
   PRODUCT VIGNETTE WINDOW (shared chrome)
   ========================== */
.vignette-section { margin-top: 90px; animation: fadeInUp 0.8s 0.5s var(--ease-out) both; }
.vignette-window {
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
    overflow: hidden;
    max-width: 1100px;
    margin: 0 auto;
}
.vignette-titlebar {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: #000;
    border-bottom: 1px solid var(--border-color);
}
.v-dots { display: flex; gap: 6px; }
.v-dot-w { width: 12px; height: 12px; border-radius: 50%; background: #333; }
.v-dot-w:first-child { background: #444; }
.vignette-title { font-family: var(--font-mono); font-size: 13px; color: var(--secondary-text); }
.v-live {
    margin-left: auto;
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--ok);
    display: inline-flex; align-items: center; gap: 6px;
}
.v-live::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%;
    background: var(--ok);
    animation: blink 1.6s infinite;
}
.v-live.muted { color: var(--secondary-text); }
.v-live.muted::before { background: var(--secondary-text); }
.vignette-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    background: var(--background);
}
.vignette-flow {
    padding: 40px 40px 44px;
    position: relative;
    background-image: radial-gradient(circle at 1px 1px, #1E1E1E 1px, transparent 0);
    background-size: 22px 22px;
}

.v-node {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 18px;
    max-width: 460px;
    opacity: 0.25;
    transform: translateY(6px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), border-color 0.4s;
}
.v-node.on { opacity: 1; transform: translateY(0); }
.v-node.on.flagged { border-color: rgba(217, 160, 43, 0.55); }
.v-node.on.decided { border-color: rgba(76, 143, 224, 0.55); }

.v-node-tag {
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--secondary-text);
    display: flex; align-items: center; gap: 7px;
    margin-bottom: 7px;
}
.v-sig { width: 8px; height: 8px; border-radius: 2px; background: var(--c, #666); flex: none; }
.v-node-title {
    font-family: var(--font-sans);
    font-size: 15px; font-weight: 600;
    color: var(--primary-text);
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.v-node-meta { font-family: var(--font-mono); font-size: 12px; color: var(--secondary-text); margin-top: 5px; }

.v-badge {
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
    opacity: 0;
    transition: opacity 0.4s 0.35s;
    white-space: nowrap;
}
.v-node.on .v-badge { opacity: 1; }
.v-badge.trig { color: var(--warn); border-color: rgba(217,160,43,0.4); background: rgba(217,160,43,0.08); }
.v-badge.pass { color: var(--ok); border-color: rgba(46,189,133,0.4); background: rgba(46,189,133,0.08); }
.v-badge.rev  { color: var(--sig-amount); border-color: rgba(76,143,224,0.45); background: rgba(76,143,224,0.08); }

.v-edge {
    width: 1px; height: 26px;
    margin-left: 40px;
    background: var(--border-color);
    position: relative;
    overflow: hidden;
}
.v-edge::after {
    content: '';
    position: absolute; top: -100%; left: 0;
    width: 100%; height: 100%;
    background: var(--primary-text);
    transition: top 0.4s linear;
}
.v-edge.on::after { top: 0; }

/* decision node score bars */
.v-scorebars { margin-top: 12px; display: grid; gap: 7px; }
.v-scorebar-row {
    display: grid; grid-template-columns: 190px 1fr 44px;
    align-items: center; gap: 10px;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--secondary-text);
}
.v-scorebar-track { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.v-scorebar-fill {
    height: 100%; width: 0;
    background: var(--warn);
    border-radius: 3px;
    transition: width 0.8s var(--ease-out) 0.3s;
}
.v-node.on .v-scorebar-fill.f1 { width: 64%; }
.v-node.on .v-scorebar-fill.f2 { width: 46%; }

/* right column: explanation panel */
.v-explain {
    border-left: 1px solid var(--border-color);
    background: #0D0D0D;
    padding: 28px 24px;
    display: flex; flex-direction: column; gap: 14px;
}
.v-explain-label {
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 600; letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--secondary-text);
}
.v-explain-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface);
    padding: 14px 16px;
    opacity: 0.2;
    transform: translateX(8px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), border-color 0.4s;
}
.v-explain-card.on { opacity: 1; transform: translateX(0); }
.v-explain-card.on.hot { border-color: rgba(217,160,43,0.5); }
.v-explain-rule { font-family: var(--font-mono); font-size: 11px; color: var(--primary-text); margin-bottom: 4px; }
.v-explain-reason { font-size: 13px; line-height: 1.5; color: var(--secondary-text); }
.v-explain-contrib { font-family: var(--font-mono); font-size: 11px; color: var(--warn); margin-top: 6px; }

.v-explain-summary {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    font-family: var(--font-mono);
    font-size: 12px; line-height: 1.7;
    color: var(--secondary-text);
    opacity: 0;
    transition: opacity 0.6s var(--ease-out);
}
.v-explain-summary.on { opacity: 1; }
.v-explain-summary strong { color: var(--primary-text); font-weight: 600; }

/* ==========================
   PRODUCT SCREENSHOT FRAME
   ========================== */
.shot-window {
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.shot-window img { display: block; width: 100%; height: auto; }
.shot-caption {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--secondary-text);
    text-align: center;
    margin: 14px auto 0;
}
.shot-caption.left { text-align: left; margin-left: 0; margin-right: 0; }

/* Cropped band: fixed-height viewport onto a taller screen; hover pans down */
.shot-crop { position: relative; overflow: hidden; }
.shot-crop img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: object-position 4s var(--ease-out);
}
.shot-crop:hover img { object-position: center bottom; }
.shot-hint {
    position: absolute; bottom: 12px; right: 14px;
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--secondary-text);
    background: rgba(10,10,10,0.75);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 11px;
    pointer-events: none;
    backdrop-filter: blur(4px);
}
@media (prefers-reduced-motion: reduce) {
    .shot-crop img { transition: none; }
}

/* Drag-to-compare: two views of the same thing, split by a handle */
.compare {
    position: relative;
    overflow: hidden;
    --split: 58%;
    cursor: col-resize;
    touch-action: none;
    background: #000;
}
.compare-pane { position: absolute; inset: 0; }
.compare-code { padding: 24px 24px 24px 28px; overflow: hidden; }
.compare-code pre {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.75;
    color: var(--secondary-text);
    white-space: pre;
}
.compare-code .hl { color: var(--primary-text); }
.compare-code .hl-warn { color: var(--warn); }
.compare-over { clip-path: inset(0 0 0 var(--split)); }
.compare-over img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}
.compare-handle {
    position: absolute; top: 0; bottom: 0;
    left: var(--split);
    width: 2px;
    background: var(--primary-text);
    transform: translateX(-1px);
    z-index: 3;
}
.compare-handle::after {
    content: '◂ ▸';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--primary-text);
    color: #000;
    font-family: var(--font-mono);
    font-size: 12px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}
.compare-label {
    position: absolute; top: 12px;
    z-index: 2;
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--primary-text);
    background: rgba(10,10,10,0.75);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 11px;
    pointer-events: none;
    backdrop-filter: blur(4px);
}
.compare-label.left { left: 12px; }
.compare-label.right { right: 12px; }

/* ==========================
   METRICS STRIP
   ========================== */
.metrics {
    background: #000;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}
.metrics::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 1px 1px, var(--border-color) 1px, transparent 0);
    background-size: 24px 24px;
    opacity: 0.5;
}
.metrics-content { position: relative; z-index: 1; }
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 48px;
    text-align: center;
}
.metric-item { opacity: 0; transform: translateY(20px); }
.metric-item.visible { animation: fadeInUp 0.6s var(--ease-out) forwards; }
.metric-value {
    font-family: var(--font-sans);
    font-size: 56px; font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--primary-text);
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}
.metric-label {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--secondary-text);
}
.metrics-eyebrow-row { text-align: center; margin-bottom: 48px; }
.metrics-note {
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--secondary-text);
    max-width: 760px;
    margin: 56px auto 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

/* ==========================
   SYSTEM / FEATURE CARDS
   ========================== */
.system-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.system-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.system-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 28px;
    transition: all 0.3s var(--ease-out);
    position: relative;
}
.system-card:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.system-card-name {
    font-family: var(--font-mono);
    font-size: 16px; font-weight: 600;
    color: var(--primary-text);
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 6px;
}
.system-card-role {
    font-family: var(--font-mono);
    font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--secondary-text);
    margin-bottom: 14px;
}
.system-card p { font-size: 14.5px; line-height: 1.6; }

/* ==========================
   AUTOGRAPHER — Evidence Canvas components
   ========================== */
.ag-canvas-wrap {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--background);
    overflow: hidden;
}
.ag-canvas-titlebar {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: #000;
}
.ag-canvas {
    padding: 44px 36px;
    background-image: radial-gradient(circle at 1px 1px, #1E1E1E 1px, transparent 0);
    background-size: 22px 22px;
    display: grid;
    grid-template-columns: 220px 1fr 300px;
    gap: 36px;
    align-items: center;
}
.ag-node {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), border-color 0.4s;
}
.ag-canvas.play .ag-node { opacity: 1; transform: translateY(0); }
.ag-node-tag {
    font-family: var(--font-mono);
    font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
    color: var(--secondary-text);
    margin-bottom: 6px;
}
.ag-node-title { font-size: 14px; font-weight: 600; color: var(--primary-text); }
.ag-node-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--secondary-text); margin-top: 5px; line-height: 1.7; }

.ag-signals { display: grid; gap: 12px; max-width: 520px; width: 100%; margin: 0 auto; }
.ag-signal {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); font-size: 12px;
}
.ag-signal .code { color: var(--primary-text); }
.ag-signal .stats { color: var(--secondary-text); font-size: 11px; margin-left: auto; white-space: nowrap; }
.ag-signal { opacity: 0; transform: translateX(-8px); transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); }
.ag-canvas.play .ag-signal { opacity: 1; transform: translateX(0); }
.ag-canvas.play .ag-signal:nth-child(2) { transition-delay: 0.5s; }
.ag-canvas.play .ag-signal:nth-child(3) { transition-delay: 0.8s; }
.ag-canvas.play .ag-signal:nth-child(4) { transition-delay: 1.1s; }
.ag-canvas.play .ag-signal:nth-child(5) { transition-delay: 1.4s; }
.ag-canvas.play .ag-node.ag-dataset { transition-delay: 0.1s; }
.ag-canvas.play .ag-node.ag-candidate { transition-delay: 1.9s; }
.ag-canvas.play .ag-node.ag-candidate-2 { transition-delay: 2.4s; }

.ag-candidate .conf-row, .conf-row {
    display: flex; gap: 8px; margin: 10px 0 12px; flex-wrap: wrap;
}
.ag-pill {
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    padding: 3px 9px; border-radius: 999px;
    border: 1px solid var(--border-color); color: var(--secondary-text);
}
.ag-pill.ok { color: var(--ok); border-color: rgba(46,189,133,0.4); background: rgba(46,189,133,0.08); }
.ag-pill.warn { color: var(--danger); border-color: rgba(224,82,82,0.4); background: rgba(224,82,82,0.08); }
.ag-clause {
    font-family: var(--font-mono); font-size: 11.5px;
    color: var(--secondary-text);
    border-left: 2px solid var(--border-color);
    padding-left: 10px;
    margin-top: 8px;
    line-height: 1.7;
}
.ag-clause b { color: var(--primary-text); font-weight: 600; }
.ag-exits { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.ag-exit {
    font-family: var(--font-mono); font-size: 11px;
    padding: 5px 11px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--primary-text);
}
.ag-exit.locked { color: #555; border-style: dashed; }

.ag-table-wrap { margin-top: 56px; }
.ag-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 13px;
}
.ag-table th {
    text-align: left;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--secondary-text);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}
.ag-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--secondary-text);
}
.ag-table td:first-child { color: var(--primary-text); font-family: var(--font-sans); font-weight: 500; font-size: 14.5px; }
.ag-table .num { font-variant-numeric: tabular-nums; }
.ag-table .good { color: var(--ok); }
.ag-table .mid { color: var(--warn); }
.ag-table a { color: var(--secondary-text); text-decoration: none; border-bottom: 1px dashed var(--border-hover); }
.ag-table a:hover { color: var(--primary-text); }

/* ==========================
   API / CODE
   ========================== */
.api-section { display: grid; grid-template-columns: 1fr 1.5fr; gap: 64px; align-items: center; }
.api-section + .api-section { margin-top: 100px; }
.api-text h2 { margin-bottom: 16px; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.api-text p { margin-bottom: 24px; }
.code-container {
    background: #000; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden;
    display: grid; grid-template-rows: auto 1fr;
}
.code-tabs { display: flex; background: var(--surface); border-bottom: 1px solid var(--border-color); grid-row: 1; grid-column: 1; }
.code-tab {
    padding: 12px 20px; cursor: pointer;
    color: var(--secondary-text);
    font-family: var(--font-mono); font-size: 13px; font-weight: 500;
    position: relative;
}
.code-tab.active { color: var(--primary-text); }
.code-tab.active::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
    height: 2px; background: var(--primary-text);
}
/* Panels share one grid cell: the container holds the tallest panel's height,
   so switching tabs never changes the block's size. */
.code-panel { visibility: hidden; grid-row: 2; grid-column: 1; padding: 20px; max-height: 500px; overflow: auto; position: relative; }
.code-panel.active { visibility: visible; }
.code-panel pre { white-space: pre-wrap; word-wrap: break-word; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: var(--secondary-text); }
.code-panel .hl { color: var(--primary-text); }
.code-panel .hl-warn { color: var(--warn); }
.code-panel .hl-danger { color: var(--danger); }
.copy-btn {
    position: absolute; top: 16px; right: 16px;
    background: var(--surface); border: 1px solid var(--border-color);
    color: var(--primary-text);
    font-family: var(--font-mono); font-size: 12px;
    padding: 6px 12px; border-radius: 6px; cursor: pointer;
    transition: all 0.2s;
}
.copy-btn:hover { background: var(--background); }

/* ==========================
   WORKFLOW STEPS
   ========================== */
.workflow-steps { display: flex; justify-content: space-between; position: relative; }
.workflow-step { text-align: center; position: relative; flex: 1; padding: 0 20px; }
.step-number {
    width: 48px; height: 48px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
    font-family: var(--font-mono);
    font-weight: 600; font-size: 18px;
    color: var(--secondary-text);
    position: relative; z-index: 2;
}
.workflow-steps::before {
    content: ''; position: absolute; top: 24px; left: 15%; right: 15%;
    height: 1px; background: var(--border-color); z-index: 1;
}
.step-title { margin-bottom: 12px; }
.step-description { max-width: 300px; margin: 0 auto; font-size: 15px; }

/* ==========================
   CTA
   ========================== */
.cta { text-align: center; background: var(--surface); border: 1px solid var(--border-color); border-radius: 16px; padding: 80px 40px; }
.cta-content { max-width: 700px; margin: 0 auto; }
.cta h2 { margin-bottom: 16px; }
.cta-description { font-size: 17px; margin: 0 auto 40px auto; }
.cta-form { display: flex; gap: 16px; max-width: 520px; margin: 0 auto; }
.cta-input {
    flex: 1; padding: 14px 20px;
    border: 1px solid var(--border-color); border-radius: 6px;
    font-size: 15px; outline: none;
    background: var(--background); color: var(--primary-text);
    font-family: var(--font-mono);
    transition: all 0.2s;
}
.cta-input:focus { border-color: var(--border-hover); }

/* ==========================
   FOOTER
   ========================== */
footer { background: #000; padding: 64px 0 32px; border-top: 1px solid var(--border-color); }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand h3 { font-size: 24px; margin-bottom: 16px; color: var(--primary-text); }
.footer-brand p { color: var(--secondary-text); max-width: 300px; font-size: 14.5px; }
.footer-column h4 {
    font-family: var(--font-mono);
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 20px; color: var(--primary-text);
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: var(--secondary-text); text-decoration: none; transition: color 0.2s; font-size: 14px; }
.footer-links a:hover { color: var(--primary-text); }
.footer-bottom {
    padding-top: 32px; border-top: 1px solid var(--border-color);
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px;
}
.footer-copyright { color: var(--secondary-text); font-size: 14px; }
.footer-address { color: var(--secondary-text); font-size: 12px; margin-top: 16px; line-height: 1.6; }
.footer-compliance { margin-top: 16px; }
.footer-compliance img { height: 50px; }
.footer-social { display: flex; gap: 16px; }
.social-link {
    width: 40px; height: 40px;
    background: var(--surface); border: 1px solid var(--border-color); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--secondary-text); text-decoration: none;
    transition: all 0.2s;
}
.social-link:hover { background: var(--primary-text); color: #000; border-color: var(--primary-text); }

/* ==========================
   MODALS
   ========================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none; align-items: center; justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}
.modal-content {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%; max-width: 900px; max-height: 90vh;
    position: relative; padding: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.95); opacity: 0;
    transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}
#calendar-modal .modal-content { height: 80vh; max-height: 700px; }
#video-modal .modal-content { aspect-ratio: 16 / 9; height: auto; padding: 0; background: #000; }
.modal-overlay.visible { display: flex; }
.modal-overlay.visible .modal-content { transform: scale(1); opacity: 1; }
.modal-close-btn {
    position: absolute; top: -15px; right: -15px;
    width: 36px; height: 36px;
    background: var(--primary-text); color: #000;
    border: none; border-radius: 50%;
    font-size: 24px; line-height: 36px; text-align: center;
    cursor: pointer; z-index: 10;
    transition: transform 0.2s;
}
.modal-close-btn:hover { transform: scale(1.1); }
.modal-content iframe { border-radius: 8px; width: 100%; height: 100%; border: none; }

/* ==========================
   COOKIE CONSENT
   ========================== */
#cookie-consent-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 24px; z-index: 3000;
    display: none; align-items: center; justify-content: center; gap: 24px;
    transform: translateY(100%);
    transition: transform 0.5s var(--ease-out);
}
#cookie-consent-banner.visible { display: flex; transform: translateY(0); }
#cookie-consent-banner p { margin: 0; flex-grow: 1; text-align: center; font-size: 14px; }
.cookie-consent-buttons { display: flex; gap: 16px; }

/* ==========================
   ANIMATIONS
   ========================== */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .v-node, .v-edge::after, .v-explain-card, .v-explain-summary, .ag-node, .ag-signal { opacity: 1 !important; transform: none !important; }
}

/* ==========================
   RESPONSIVE (shared)
   ========================== */
@media (max-width: 1080px) {
    .vignette-body { grid-template-columns: 1fr; }
    .v-explain { border-left: none; border-top: 1px solid var(--border-color); }
    .ag-canvas { grid-template-columns: 1fr; gap: 24px; }
    .system-grid, .system-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) {
    .nav-links { display: none; }
    .api-section { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .nav-right .btn-secondary { display: none; }
    .hero h1 { font-size: 2.5rem; }
    .hero-description { font-size: 16px; }
    .hero-ctas { flex-direction: column; width: 100%; max-width: 320px; margin: 0 auto; }
    .system-grid, .system-grid.cols-4 { grid-template-columns: 1fr; }
    .workflow-steps { flex-direction: column; gap: 48px; }
    .workflow-steps::before { display: none; }
    .metrics-grid { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }
    .footer-brand p { margin: 0 auto; }
    .footer-bottom { flex-direction: column; align-items: center; gap: 24px; }
    .footer-info { text-align: center; order: 2; }
    .footer-social { order: 1; }
    .cta-form { flex-direction: column; }
    #cookie-consent-banner { flex-direction: column; text-align: center; }
    .vignette-flow { padding: 24px 18px 30px; }
    .v-scorebar-row { grid-template-columns: 130px 1fr 40px; }
    .ag-table th:nth-child(4), .ag-table td:nth-child(4) { display: none; }
}
