/* =========================================================
   rollup.quest // dark-mode neon crypto schematic
   ========================================================= */

:root {
    --void-black: #0a0a12;
    --signal-white: #e0e0e8;
    --rollup-cyan: #00f0ff;
    --proof-purple: #7b2ff7;
    --fault-red: #ff3864;
    --deep-void: #0d0d1a;
    --panel-dark: #1a1a2e;
    --valid-green: #39ff14;

    --font-display: 'Orbitron', 'Inter', sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-code: 'JetBrains Mono', 'Menlo', monospace;
    --font-data: 'Share Tech Mono', 'JetBrains Mono', monospace;

    --content-max: 680px;
    --content-offset: 60px;

    --glow-cyan-1: 0 0 4px rgba(0, 240, 255, 0.40);
    --glow-cyan-2: 0 0 12px rgba(0, 240, 255, 0.20);
    --glow-cyan-3: 0 0 24px rgba(0, 240, 255, 0.10);
    --glow-purple-1: 0 0 4px rgba(123, 47, 247, 0.40);
    --glow-purple-2: 0 0 12px rgba(123, 47, 247, 0.20);
    --glow-purple-3: 0 0 24px rgba(123, 47, 247, 0.10);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void-black);
    color: var(--signal-white);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Background atmosphere ---------- */

.circuit-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
}

.data-flow-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.data-flow-bg .flow-path {
    fill: none;
    stroke: var(--rollup-cyan);
    stroke-width: 1;
    opacity: 0.18;
}

.data-flow-bg .flow-particle {
    fill: var(--rollup-cyan);
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.7));
}

.data-flow-bg .flow-particle.purple {
    fill: var(--proof-purple);
    filter: drop-shadow(0 0 4px rgba(123, 47, 247, 0.7));
}

/* ---------- HUD overlay frame ---------- */

.hud-frame {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
}

.corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1px solid var(--rollup-cyan);
    opacity: 0.65;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.4));
}

.corner-tl { top: 24px; left: 24px; border-right: 0; border-bottom: 0; }
.corner-tr { top: 24px; right: 24px; border-left: 0; border-bottom: 0; }
.corner-bl { bottom: 24px; left: 24px; border-right: 0; border-top: 0; }
.corner-br { bottom: 24px; right: 24px; border-left: 0; border-top: 0; }

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(to right,
        transparent 0%,
        rgba(0, 240, 255, 0.45) 50%,
        transparent 100%);
    opacity: 0.45;
    animation: scanLineSweep 30s linear infinite;
    pointer-events: none;
}

@keyframes scanLineSweep {
    0%   { transform: translateY(0vh); }
    100% { transform: translateY(100vh); }
}

.coordinate-readout {
    position: absolute;
    bottom: 30px;
    right: 38px;
    font-family: var(--font-data);
    font-size: 11px;
    color: var(--rollup-cyan);
    letter-spacing: 0.18em;
    opacity: 0.85;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.hud-status {
    position: absolute;
    top: 32px;
    right: 80px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-data);
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--signal-white);
    opacity: 0.7;
}

.hud-status-dot {
    width: 6px;
    height: 6px;
    background: var(--valid-green);
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.8);
    animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ---------- Persistent Hex Ticker ---------- */

.hex-ticker {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 100vh;
    overflow: hidden;
    z-index: 40;
    pointer-events: none;
    background: linear-gradient(to right,
        rgba(13, 13, 26, 0.85),
        rgba(13, 13, 26, 0));
    border-right: 1px solid rgba(0, 240, 255, 0.08);
}

.hex-ticker::before,
.hex-ticker::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 2;
    pointer-events: none;
}

.hex-ticker::before {
    top: 0;
    background: linear-gradient(to bottom, var(--void-black), transparent);
}

.hex-ticker::after {
    bottom: 0;
    background: linear-gradient(to top, var(--void-black), transparent);
}

.hex-ticker-track {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 4px;
    font-family: var(--font-data);
    font-size: 10px;
    line-height: 1.4;
    color: rgba(0, 240, 255, 0.55);
    text-align: center;
    will-change: transform;
}

.hex-ticker-cell {
    opacity: 0.55;
    transition: opacity 200ms ease;
}

.hex-ticker-cell.bright {
    color: var(--rollup-cyan);
    opacity: 1;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
}

.hex-ticker-cell.purple {
    color: var(--proof-purple);
}

/* ---------- Layer Navigation (right edge dots) ---------- */

.layer-nav {
    position: fixed;
    right: 26px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
}

.layer-nav ol {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.layer-dot {
    width: 8px;
    height: 8px;
    background: transparent;
    border: 1px solid rgba(0, 240, 255, 0.5);
    cursor: pointer;
    padding: 0;
    transition: all 250ms ease;
    position: relative;
}

.layer-dot::before {
    content: '';
    position: absolute;
    inset: -6px;
}

.layer-dot.completed {
    background: var(--rollup-cyan);
    border-color: var(--rollup-cyan);
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

.layer-dot.active {
    background: var(--rollup-cyan);
    border-color: var(--rollup-cyan);
    box-shadow:
        0 0 4px rgba(0, 240, 255, 0.8),
        0 0 12px rgba(0, 240, 255, 0.5),
        0 0 24px rgba(0, 240, 255, 0.25);
    animation: dotPulse 1.6s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% {
        box-shadow:
            0 0 4px rgba(0, 240, 255, 0.8),
            0 0 12px rgba(0, 240, 255, 0.5),
            0 0 24px rgba(0, 240, 255, 0.25);
    }
    50% {
        box-shadow:
            0 0 6px rgba(0, 240, 255, 1),
            0 0 24px rgba(0, 240, 255, 0.7),
            0 0 48px rgba(0, 240, 255, 0.35);
    }
}

.layer-nav-tooltip {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translate(-8px, -50%);
    background: var(--panel-dark);
    border: 1px solid rgba(0, 240, 255, 0.5);
    color: var(--rollup-cyan);
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.15em;
    padding: 6px 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 200ms ease;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.layer-nav-tooltip.visible {
    opacity: 1;
    transform: translate(0, -50%);
}

/* ---------- Layer Sections ---------- */

main {
    position: relative;
    z-index: 5;
}

.layer {
    position: relative;
    min-height: 100vh;
    padding: 120px 0 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.layer:nth-of-type(odd) {
    background: var(--void-black);
}

.layer:nth-of-type(even) {
    background: var(--deep-void);
}

.layer:not(.layer-hero)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right,
        transparent,
        rgba(0, 240, 255, 0.25) 30%,
        rgba(123, 47, 247, 0.25) 70%,
        transparent);
}

.layer-content {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 32px;
    transform: translateX(var(--content-offset));
    position: relative;
    z-index: 2;
}

.layer-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 20vw;
    color: var(--signal-white);
    opacity: 0.025;
    letter-spacing: 0.05em;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    transition: transform 800ms ease;
}

.layer-header {
    margin-bottom: 56px;
}

.layer-tag {
    display: inline-block;
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--rollup-cyan);
    margin-bottom: 20px;
    padding: 4px 10px;
    border: 1px solid rgba(0, 240, 255, 0.35);
    background: rgba(0, 240, 255, 0.05);
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.layer-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--signal-white);
    margin-bottom: 20px;
}

.accent-cyan {
    color: var(--rollup-cyan);
    text-shadow:
        0 0 4px rgba(0, 240, 255, 0.4),
        0 0 12px rgba(0, 240, 255, 0.25),
        0 0 24px rgba(0, 240, 255, 0.12);
}

.accent-purple {
    color: var(--proof-purple);
    text-shadow:
        0 0 4px rgba(123, 47, 247, 0.4),
        0 0 12px rgba(123, 47, 247, 0.25),
        0 0 24px rgba(123, 47, 247, 0.12);
}

.accent-green { color: var(--valid-green); }
.accent-red { color: var(--fault-red); }

.accent-cyan-stroke { stroke: var(--rollup-cyan); fill: rgba(0, 240, 255, 0.06); }
.accent-purple-stroke { stroke: var(--proof-purple); fill: rgba(123, 47, 247, 0.06); }
.accent-green-stroke { stroke: var(--valid-green); fill: rgba(57, 255, 20, 0.06); }

.layer-deck {
    font-size: 17px;
    line-height: 1.7;
    color: rgba(224, 224, 232, 0.85);
    max-width: 600px;
}

/* ---------- HERO LAYER ---------- */

.layer-hero {
    min-height: 100vh;
    padding: 0;
    justify-content: center;
    align-items: center;
}

.hero-stage {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-line {
    display: block;
    width: 0;
    height: 1px;
    background: var(--rollup-cyan);
    box-shadow:
        0 0 6px rgba(0, 240, 255, 0.6),
        0 0 16px rgba(0, 240, 255, 0.35);
    margin: 30px auto;
    transition: width 1500ms cubic-bezier(0.7, 0, 0.3, 1);
}

.hero-line.drawn {
    width: min(720px, 60vw);
}

.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 0.95;
    text-align: center;
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    pointer-events: none;
}

.hero-word {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 10vw;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: inline-flex;
    line-height: 1.05;
    margin: 6px 0;
}

.hero-word-rollup {
    color: var(--rollup-cyan);
    text-shadow:
        0 0 8px rgba(0, 240, 255, 0.5),
        0 0 24px rgba(0, 240, 255, 0.25),
        0 0 48px rgba(0, 240, 255, 0.12);
}

.hero-word-quest {
    color: var(--proof-purple);
    text-shadow:
        0 0 8px rgba(123, 47, 247, 0.55),
        0 0 24px rgba(123, 47, 247, 0.3),
        0 0 48px rgba(123, 47, 247, 0.15);
}

.hero-word .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 400ms ease;
}

.hero-word .char.visible {
    opacity: 1;
}

.hero-title.scan-active::after {
    content: '';
    position: absolute;
    left: -10%;
    width: 120%;
    height: 4px;
    top: 0;
    background: linear-gradient(to right,
        transparent,
        rgba(0, 240, 255, 0.7) 50%,
        transparent);
    animation: heroScanSweep 400ms ease forwards;
    pointer-events: none;
}

@keyframes heroScanSweep {
    from { top: -5%; opacity: 0; }
    20%  { opacity: 1; }
    90%  { opacity: 1; }
    to   { top: 105%; opacity: 0; }
}

.hero-subtitle {
    margin-top: 56px;
    font-family: var(--font-body);
    font-size: 16px;
    letter-spacing: 0.1em;
    color: rgba(224, 224, 232, 0.5);
    text-transform: lowercase;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    transition: all 800ms ease;
    z-index: 3;
    position: relative;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-meta {
    display: flex;
    gap: 48px;
    margin-top: 64px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 800ms ease 200ms;
    z-index: 3;
    position: relative;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-meta.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-meta-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    font-family: var(--font-data);
}

.hero-meta-cell em {
    font-size: 10px;
    letter-spacing: 0.3em;
    color: rgba(224, 224, 232, 0.4);
    font-style: normal;
    text-transform: uppercase;
}

.hero-meta-cell b {
    font-size: 13px;
    letter-spacing: 0.15em;
    color: var(--rollup-cyan);
    font-weight: 400;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.35);
}

.hero-scroll-hint {
    position: absolute;
    bottom: -40vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    font-family: var(--font-data);
    font-size: 10px;
    letter-spacing: 0.3em;
    color: rgba(0, 240, 255, 0.65);
    opacity: 0;
    transition: opacity 800ms ease 600ms;
    text-transform: uppercase;
}

.hero-scroll-hint.visible { opacity: 1; }

.hero-scroll-arrow {
    width: 1px;
    height: 56px;
    background: linear-gradient(to bottom, var(--rollup-cyan), transparent);
    position: relative;
    animation: scrollArrow 2.4s ease-in-out infinite;
}

.hero-scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -3px;
    width: 7px;
    height: 7px;
    border-right: 1px solid var(--rollup-cyan);
    border-bottom: 1px solid var(--rollup-cyan);
    transform: rotate(45deg);
}

@keyframes scrollArrow {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* ---------- Info Cards ---------- */

.layer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

.layer-grid-two {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.info-card {
    position: relative;
    background: var(--panel-dark);
    border: 1px solid rgba(0, 240, 255, 0.18);
    padding: 24px 22px 28px;
    overflow: hidden;
    transition: all 350ms ease;
}

.info-card::before,
.info-card::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1px solid var(--rollup-cyan);
    opacity: 0.6;
    transition: opacity 250ms ease;
}

.info-card::before {
    top: 6px; left: 6px;
    border-right: 0;
    border-bottom: 0;
}

.info-card::after {
    bottom: 6px; right: 6px;
    border-left: 0;
    border-top: 0;
}

.info-card:hover {
    border-color: rgba(0, 240, 255, 0.55);
    box-shadow:
        0 0 4px rgba(0, 240, 255, 0.25),
        0 0 24px rgba(0, 240, 255, 0.15),
        0 0 48px rgba(0, 240, 255, 0.08);
    transform: translateY(-2px);
}

.info-card:hover::before,
.info-card:hover::after {
    opacity: 1;
}

.info-card-index {
    position: absolute;
    top: 16px;
    right: 22px;
    font-family: var(--font-data);
    font-size: 10px;
    letter-spacing: 0.3em;
    color: rgba(0, 240, 255, 0.55);
}

.info-card-tag {
    display: inline-block;
    font-family: var(--font-data);
    font-size: 10px;
    letter-spacing: 0.3em;
    margin-bottom: 14px;
    padding: 3px 8px;
    border: 1px solid currentColor;
    background: rgba(0, 240, 255, 0.04);
}

.info-card-tag.accent-cyan { border-color: var(--rollup-cyan); }
.info-card-tag.accent-purple { border-color: var(--proof-purple); background: rgba(123, 47, 247, 0.05); }
.info-card-tag.accent-red { border-color: var(--fault-red); background: rgba(255, 56, 100, 0.05); }
.info-card-tag.accent-green { border-color: var(--valid-green); background: rgba(57, 255, 20, 0.05); }

.info-card-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    color: var(--signal-white);
}

.info-card p {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(224, 224, 232, 0.78);
}

.bullet-list {
    list-style: none;
    margin-top: 14px;
    padding: 0;
    font-family: var(--font-data);
    font-size: 12px;
    color: rgba(224, 224, 232, 0.7);
    letter-spacing: 0.05em;
}

.bullet-list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
}

.bullet-list li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--rollup-cyan);
}

/* ---------- Term hover (interactive data flow) ---------- */

.term {
    color: var(--rollup-cyan);
    border-bottom: 1px dashed rgba(0, 240, 255, 0.5);
    cursor: help;
    padding: 0 2px;
    transition: all 200ms ease;
}

.term:hover {
    color: var(--signal-white);
    background: rgba(0, 240, 255, 0.12);
    border-bottom-color: var(--rollup-cyan);
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

.term-tooltip {
    position: fixed;
    z-index: 80;
    background: var(--panel-dark);
    border: 1px solid var(--rollup-cyan);
    color: var(--signal-white);
    padding: 10px 18px;
    font-family: var(--font-data);
    font-size: 12px;
    letter-spacing: 0.05em;
    line-height: 1.5;
    max-width: 280px;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 200ms ease;
    box-shadow:
        -2px 0 8px rgba(0, 240, 255, 0.3),
        0 0 12px rgba(0, 240, 255, 0.15);
}

.term-tooltip.visible {
    opacity: 1;
    transform: translateX(0);
}

.term-tooltip::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--rollup-cyan);
    box-shadow: 0 0 8px var(--rollup-cyan);
}

.term-tooltip-bracket {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid var(--rollup-cyan);
}

.term-tooltip-bracket-tl { top: 2px; left: 2px; border-right: 0; border-bottom: 0; }
.term-tooltip-bracket-tr { top: 2px; right: 2px; border-left: 0; border-bottom: 0; }
.term-tooltip-bracket-bl { bottom: 2px; left: 2px; border-right: 0; border-top: 0; }
.term-tooltip-bracket-br { bottom: 2px; right: 2px; border-left: 0; border-top: 0; }

/* ---------- Code blocks ---------- */

.code-block {
    font-family: var(--font-code);
    font-size: 13px;
    line-height: 1.7;
    background: var(--panel-dark);
    border-left: 2px solid var(--rollup-cyan);
    padding: 22px 24px;
    color: rgba(224, 224, 232, 0.88);
    overflow-x: auto;
    white-space: pre;
    position: relative;
    font-feature-settings: "liga" 1;
    margin-bottom: 24px;
}

.code-block::before {
    content: '// CONTRACT';
    position: absolute;
    top: 8px;
    right: 14px;
    font-family: var(--font-data);
    font-size: 9px;
    letter-spacing: 0.3em;
    color: rgba(0, 240, 255, 0.5);
}

.code-block .code-comment { color: rgba(224, 224, 232, 0.4); font-style: italic; }
.code-block .code-keyword { color: var(--proof-purple); }
.code-block .code-fn      { color: var(--rollup-cyan); }
.code-block .code-type    { color: var(--valid-green); }
.code-block .code-num     { color: var(--fault-red); }

/* ---------- Hex grid (Layer 2 deco) ---------- */

.hex-grid {
    margin: 40px 0 0;
    height: 96px;
    width: 100%;
    background-image:
        linear-gradient(60deg, transparent 25%, rgba(0, 240, 255, 0.08) 25%, rgba(0, 240, 255, 0.08) 26%, transparent 26%),
        linear-gradient(120deg, transparent 25%, rgba(0, 240, 255, 0.08) 25%, rgba(0, 240, 255, 0.08) 26%, transparent 26%);
    background-size: 20px 35px;
    position: relative;
    border-top: 1px solid rgba(0, 240, 255, 0.12);
    border-bottom: 1px solid rgba(0, 240, 255, 0.12);
    overflow: hidden;
}

.hex-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 50%, rgba(0, 240, 255, 0.18), transparent 40%),
        radial-gradient(circle at 75% 50%, rgba(123, 47, 247, 0.16), transparent 40%);
    animation: hexBreath 6s ease-in-out infinite alternate;
}

@keyframes hexBreath {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* ---------- Sequencer pipeline (Layer 3) ---------- */

.sequencer-pipeline {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 48px;
}

.pipeline-stage {
    background: var(--panel-dark);
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.pipeline-stage::before,
.pipeline-stage::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1px solid var(--rollup-cyan);
    opacity: 0.5;
}

.pipeline-stage::before {
    top: 4px; left: 4px;
    border-right: 0; border-bottom: 0;
}

.pipeline-stage::after {
    bottom: 4px; right: 4px;
    border-left: 0; border-top: 0;
}

.pipeline-stage-num {
    font-family: var(--font-data);
    font-size: 10px;
    letter-spacing: 0.3em;
    color: rgba(0, 240, 255, 0.55);
}

.pipeline-stage-label {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--signal-white);
}

.pipeline-stage-desc {
    font-family: var(--font-body);
    font-size: 12px;
    line-height: 1.55;
    color: rgba(224, 224, 232, 0.7);
}

.pipeline-arrow {
    align-self: center;
    width: 22px;
    height: 8px;
    position: relative;
}

.pipeline-arrow::before {
    content: '';
    position: absolute;
    inset: 50% 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--rollup-cyan), transparent);
    opacity: 0.7;
}

.pipeline-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 6px;
    height: 6px;
    border-top: 1px solid var(--rollup-cyan);
    border-right: 1px solid var(--rollup-cyan);
    transform: translate(0, -50%) rotate(45deg);
    opacity: 0.85;
}

/* ---------- Data meter ---------- */

.data-meter {
    background: var(--panel-dark);
    border: 1px solid rgba(0, 240, 255, 0.18);
    padding: 22px 26px;
    font-family: var(--font-data);
    position: relative;
}

.data-meter::before,
.data-meter::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1px solid var(--rollup-cyan);
    opacity: 0.55;
}

.data-meter::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.data-meter::after  { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.data-meter-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    letter-spacing: 0.25em;
    color: rgba(224, 224, 232, 0.6);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.data-meter-label > span:last-child {
    color: var(--rollup-cyan);
    font-weight: 600;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.data-meter-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 240, 255, 0.08);
    overflow: hidden;
    position: relative;
}

.data-meter-fill {
    display: block;
    height: 100%;
    background: linear-gradient(to right, var(--rollup-cyan), var(--proof-purple));
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
    width: 68%;
    transition: width 1.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.data-meter-foot {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: rgba(224, 224, 232, 0.55);
}

.data-meter-foot b {
    color: var(--rollup-cyan);
    font-weight: 500;
}

/* ---------- Proof diagram ---------- */

.proof-diagram {
    margin-bottom: 40px;
    width: 100%;
}

.proof-diagram svg {
    width: 100%;
    height: auto;
    display: block;
}

.proof-node {
    stroke-width: 1.5;
    transition: all 400ms ease;
}

.proof-node-pulse {
    animation: nodePulse 2s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { opacity: 1; r: 20; }
    50% { opacity: 0.7; r: 22; }
}

.proof-edge {
    stroke: rgba(0, 240, 255, 0.35);
    stroke-width: 1;
    stroke-dasharray: 3 4;
    fill: none;
    animation: edgeFlow 4s linear infinite;
}

@keyframes edgeFlow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -20; }
}

.proof-label {
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.2em;
    fill: rgba(224, 224, 232, 0.6);
    text-anchor: middle;
}

/* ---------- DA modes ---------- */

.da-modes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 48px;
}

.da-mode {
    background: var(--panel-dark);
    border: 1px solid rgba(123, 47, 247, 0.2);
    padding: 26px 22px 22px;
    position: relative;
    transition: all 300ms ease;
}

.da-mode::before,
.da-mode::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 1px solid var(--proof-purple);
    opacity: 0.55;
}

.da-mode::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.da-mode::after  { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.da-mode:hover {
    border-color: rgba(123, 47, 247, 0.55);
    box-shadow:
        0 0 8px rgba(123, 47, 247, 0.2),
        0 0 24px rgba(123, 47, 247, 0.1);
}

.da-mode-label {
    font-family: var(--font-data);
    font-size: 10px;
    letter-spacing: 0.3em;
    color: rgba(123, 47, 247, 0.85);
    margin-bottom: 14px;
    display: block;
}

.da-mode h4 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
    color: var(--signal-white);
}

.da-mode p {
    font-size: 13px;
    line-height: 1.65;
    color: rgba(224, 224, 232, 0.72);
    margin-bottom: 20px;
}

.da-mode-tier {
    display: inline-block;
    font-family: var(--font-data);
    font-size: 10px;
    letter-spacing: 0.3em;
    padding: 3px 10px;
    border: 1px solid currentColor;
}

/* ---------- Compression visualization ---------- */

.compression-viz {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
    background: var(--panel-dark);
    border: 1px solid rgba(0, 240, 255, 0.15);
    padding: 32px 28px;
}

.compression-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 3px;
    height: 120px;
}

.compression-cell {
    background: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 4px rgba(0, 240, 255, 0.4);
    animation: cellFlicker 3s ease-in-out infinite;
}

@keyframes cellFlicker {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 0.4; }
}

.compression-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.compression-arrow-label {
    font-family: var(--font-data);
    font-size: 10px;
    letter-spacing: 0.3em;
    color: var(--rollup-cyan);
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.compression-arrow-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--rollup-cyan), transparent);
    position: relative;
}

.compression-arrow-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 8px;
    height: 8px;
    border-top: 1px solid var(--rollup-cyan);
    border-right: 1px solid var(--rollup-cyan);
    transform: translate(0, -50%) rotate(45deg);
}

.compression-batch {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    height: 120px;
}

.compression-batch-cell {
    background: linear-gradient(135deg,
        rgba(123, 47, 247, 0.6),
        rgba(0, 240, 255, 0.4));
    box-shadow: 0 0 6px rgba(123, 47, 247, 0.4);
    animation: batchPulse 2.4s ease-in-out infinite;
}

@keyframes batchPulse {
    0%, 100% { opacity: 0.9; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(0.98); }
}

/* ---------- Payload card ---------- */

.payload-card {
    background: var(--panel-dark);
    border: 1px solid rgba(123, 47, 247, 0.4);
    padding: 32px 36px;
    margin-bottom: 48px;
    position: relative;
    box-shadow:
        0 0 6px rgba(123, 47, 247, 0.15),
        0 0 24px rgba(123, 47, 247, 0.08);
}

.payload-card::before,
.payload-card::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 1px solid var(--proof-purple);
    opacity: 0.7;
}

.payload-card::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.payload-card::after  { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.payload-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(123, 47, 247, 0.25);
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.2em;
}

.payload-card-status {
    color: var(--valid-green);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
}

.payload-card-dot {
    width: 7px;
    height: 7px;
    background: var(--valid-green);
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.7);
    animation: pulseDot 1.6s ease-in-out infinite;
}

.payload-card-meta {
    color: rgba(224, 224, 232, 0.55);
}

.payload-card-meta b {
    color: var(--rollup-cyan);
    font-weight: 500;
}

.payload-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 36px;
    font-family: var(--font-code);
    margin-bottom: 28px;
}

.payload-fields > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.payload-fields dt {
    font-family: var(--font-data);
    font-size: 10px;
    letter-spacing: 0.3em;
    color: rgba(224, 224, 232, 0.45);
    text-transform: uppercase;
}

.payload-fields dd {
    font-size: 13px;
    color: var(--signal-white);
    word-break: break-all;
}

.payload-fields dd em {
    font-style: normal;
    color: var(--valid-green);
    font-size: 11px;
    margin-left: 6px;
}

.payload-bytes {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(123, 47, 247, 0.25);
    font-family: var(--font-code);
    font-size: 12px;
    line-height: 1.85;
    color: rgba(0, 240, 255, 0.55);
    word-break: break-all;
    height: 110px;
    overflow: hidden;
    position: relative;
}

.payload-bytes::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, var(--panel-dark));
    pointer-events: none;
}

/* ---------- End marker + footer ---------- */

.end-marker {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 64px 0 32px;
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--rollup-cyan);
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.35);
    text-transform: uppercase;
}

.end-marker-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--rollup-cyan), transparent);
}

.site-footer {
    border-top: 1px solid rgba(0, 240, 255, 0.12);
    padding: 32px 0 0;
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.2em;
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    color: rgba(224, 224, 232, 0.7);
    margin-bottom: 12px;
}

.footer-row-faint {
    color: rgba(224, 224, 232, 0.35);
}

.footer-cell {
    text-transform: uppercase;
}

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

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Boundary flash overlay ---------- */

.boundary-flash {
    position: fixed;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: var(--rollup-cyan);
    box-shadow:
        0 0 8px var(--rollup-cyan),
        0 0 24px rgba(0, 240, 255, 0.6);
    transform: scaleX(0);
    opacity: 0;
    transform-origin: 50% 50%;
    pointer-events: none;
    z-index: 70;
    transition: transform 300ms cubic-bezier(0.5, 0, 0.5, 1), opacity 300ms ease;
}

.boundary-flash.firing {
    opacity: 1;
    transform: scaleX(1);
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
    .layer-grid,
    .da-modes {
        grid-template-columns: 1fr;
    }

    .layer-grid-two {
        grid-template-columns: 1fr;
    }

    .sequencer-pipeline {
        grid-template-columns: 1fr;
    }

    .pipeline-arrow {
        justify-self: center;
        transform: rotate(90deg);
        margin: 4px 0;
    }

    .compression-viz {
        grid-template-columns: 1fr;
    }

    .compression-arrow {
        flex-direction: row;
        justify-content: center;
    }

    .compression-arrow-line {
        transform: rotate(90deg);
    }

    .layer-content {
        transform: translateX(0);
        padding: 0 56px 0 64px;
    }

    .hero-stage {
        padding: 0 56px;
    }

    .payload-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .hex-ticker {
        width: 28px;
    }

    .layer-content {
        padding: 0 28px 0 44px;
    }

    .layer-watermark {
        font-size: 30vw;
    }

    .corner { width: 24px; height: 24px; }
    .corner-tl, .corner-tr { top: 14px; }
    .corner-bl, .corner-br { bottom: 14px; }
    .corner-tl, .corner-bl { left: 14px; }
    .corner-tr, .corner-br { right: 14px; }

    .hero-meta {
        gap: 24px;
    }

    .layer-nav {
        right: 12px;
    }

    .coordinate-readout {
        bottom: 18px;
        right: 18px;
        font-size: 10px;
    }

    .hud-status {
        right: 50px;
        top: 18px;
    }

    .hero-word {
        font-size: 14vw;
    }
}
