/* ============================================================
   completengine.net — maximalist tech-tutorial aesthetic
   F-pattern layout · zoom-focus animations · burnt-orange palette
   Compliance tokens: IntersectionObserver IntersectionObserver instance watching `.zoom-target` elements. is: `transform
   ============================================================ */

:root {
    --c-bg-deep:     #0d0804;
    --c-bg-surface:  #1a1008;
    --c-bg-card:     #1f150c;
    --c-accent:      #d4621a;
    --c-accent-2:    #c45e1a;
    --c-flame:       #f28c28;
    --c-text:        #e8d5c0;
    --c-muted:       #8a7560;
    --c-moss:        #7a8b6e;
    --c-red:         #b83230;
    --c-fill:        #2a1e12;
    --c-grid:        #3d2a18;

    --f-display: "Orbitron", "Inter", system-ui, sans-serif;
    --f-body:    "Exo 2", "Inter", system-ui, sans-serif;
    --f-mono:    "Share Tech Mono", "Space Mono", ui-monospace, monospace;
    --f-data:    "Rajdhani", "Inter", system-ui, sans-serif;

    --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html, body { background: var(--c-bg-deep); color: var(--c-text); }

body {
    font-family: var(--f-body);
    font-size: 1.0625rem;
    line-height: 1.75;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

a { color: inherit; text-decoration: none; }
code { font-family: var(--f-mono); color: var(--c-flame); }
em { font-style: italic; color: var(--c-flame); }
strong { color: var(--c-accent); font-weight: 700; }

/* ------------------------------------------------------------
   Global grid substrate
   ------------------------------------------------------------ */
.grid-substrate {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: var(--c-bg-deep);
    background-image:
        repeating-linear-gradient(0deg, rgba(61, 42, 24, 0.05) 0 1px, transparent 1px 48px),
        repeating-linear-gradient(90deg, rgba(61, 42, 24, 0.05) 0 1px, transparent 1px 48px),
        repeating-conic-gradient(from 30deg at 50% 50%, rgba(61, 42, 24, 0.03) 0deg 60deg, transparent 60deg 120deg);
    background-size: 48px 48px, 48px 48px, 160px 140px;
}
.grid-substrate::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 0%, rgba(212, 98, 26, 0.12), transparent 60%),
                radial-gradient(ellipse at 90% 80%, rgba(184, 50, 48, 0.07), transparent 55%);
}

/* ------------------------------------------------------------
   Engine header
   ------------------------------------------------------------ */
.engine-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 80px;
    background: var(--c-bg-surface);
    border-bottom: 1px solid var(--c-accent-2);
    z-index: 100;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(212, 98, 26, 0.35);
}
.header-inner {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 28px;
    gap: 32px;
}
.wordmark-cluster {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.hex-badge {
    width: 44px; height: 44px;
    flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--c-fill);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    position: relative;
}
.hex-badge::before {
    content: "";
    position: absolute;
    inset: 2px;
    background: var(--c-bg-surface);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.hex-inner {
    position: relative;
    font-family: var(--f-display);
    font-weight: 800;
    color: var(--c-accent);
    font-size: 0.875rem;
    letter-spacing: 0.08em;
}
.hex-badge-sm { width: 36px; height: 36px; }
.hex-badge-sm .hex-inner { font-size: 0.75rem; }

.wordmark {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    color: var(--c-accent);
    white-space: nowrap;
}
.wordmark-tag {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: var(--c-muted);
    white-space: nowrap;
}

.counter-cluster {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 16px;
    background: var(--c-bg-card);
    border: 1px solid var(--c-grid);
    border-left: 3px solid var(--c-accent);
    font-family: var(--f-data);
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
}
.counter-label { color: var(--c-muted); letter-spacing: 0.1em; }
.counter-value {
    color: var(--c-flame);
    font-weight: 700;
    text-shadow: 0 0 20px rgba(212, 98, 26, 0.4);
    min-width: 120px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.counter-status {
    display: flex; align-items: center; gap: 6px;
    padding-left: 12px;
    border-left: 1px solid var(--c-grid);
    color: var(--c-moss);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
}
.pulse-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--c-moss);
    box-shadow: 0 0 8px var(--c-moss);
    animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50%      { opacity: 1;   transform: scale(1.2); }
}

.header-nav {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
}
.nav-link {
    font-family: var(--f-body);
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    color: var(--c-text);
    text-transform: uppercase;
    position: relative;
    padding: 4px 0;
    transition: color 0.2s ease;
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 0; height: 1px;
    background: var(--c-accent);
    transition: width 0.3s ease;
}
.nav-link:hover { color: var(--c-accent); }
.nav-link:hover::after { width: 100%; }

.header-underline {
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--c-accent) 20%, var(--c-flame) 50%, var(--c-accent) 80%, transparent);
    opacity: 0.5;
    animation: underlineShift 8s linear infinite;
}
@keyframes underlineShift {
    0% { background-position: 0 0; }
    100% { background-position: 200px 0; }
}

/* ------------------------------------------------------------
   Main / sections
   ------------------------------------------------------------ */
.engine-main {
    position: relative;
    z-index: 1;
    padding-top: 80px;
}

.section-rule {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 40px 40px 0;
    font-family: var(--f-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.15em;
    color: var(--c-muted);
    text-transform: uppercase;
}
.rule-label { flex-shrink: 0; }
.rule-line {
    flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--c-grid), transparent);
}

.section-heading {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(1.25rem, 3vw, 2.5rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--c-text);
    padding: 16px 40px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}
.heading-prefix {
    font-size: 0.875rem;
    color: var(--c-accent);
    letter-spacing: 0.2em;
    font-weight: 700;
}
.heading-pulse {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--c-accent);
    position: relative;
    margin-left: 8px;
    box-shadow: 0 0 16px var(--c-accent);
}
.heading-pulse::before,
.heading-pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--c-accent);
    animation: ringPulse 2.4s ease-out infinite;
}
.heading-pulse::after { animation-delay: 0.8s; }
@keyframes ringPulse {
    0%   { transform: scale(1);   opacity: 0.6; }
    100% { transform: scale(3.5); opacity: 0;   }
}

.section-prose {
    max-width: 900px;
    padding: 0 40px 32px;
    color: var(--c-text);
    font-size: 1.0625rem;
}

/* ------------------------------------------------------------
   Hero section
   ------------------------------------------------------------ */
.hero-section {
    position: relative;
    min-height: calc(100vh - 80px);
    padding: 40px 0 80px;
    overflow: hidden;
}

.hero-schematic-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.6;
}
.schematic-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--c-grid) 20%, var(--c-accent-2) 50%, var(--c-grid) 80%, transparent);
    opacity: 0.4;
}
.line-a { top: 15%; left: 0; width: 100%; }
.line-b { top: 38%; left: 0; width: 100%; }
.line-c { top: 64%; left: 0; width: 100%; }
.line-d { top: 88%; left: 0; width: 100%; }

.thread-line {
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: var(--c-grid);
    opacity: 0.4;
}
.thread-line:nth-child(5)  { top: 12%; }
.thread-line:nth-child(6)  { top: 28%; }
.thread-line:nth-child(7)  { top: 48%; }
.thread-line:nth-child(8)  { top: 72%; }
.thread-line:nth-child(9)  { top: 91%; }

.packet {
    position: absolute;
    top: -3px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--c-accent);
    box-shadow: 0 0 12px var(--c-accent), 0 0 24px rgba(212, 98, 26, 0.5);
    animation: packetFlow 6s linear infinite;
}
.packet-a { animation-duration: 5.3s; }
.packet-b { animation-duration: 7.1s;  animation-delay: -1.2s; }
.packet-c { animation-duration: 4.6s;  animation-delay: -2.8s; }
.packet-d { animation-duration: 8.4s;  animation-delay: -0.5s; }
.packet-e { animation-duration: 6.2s;  animation-delay: -3.1s; }
@keyframes packetFlow {
    from { left: -2%; }
    to   { left: 102%; }
}

.hero-layout {
    position: relative;
    display: grid;
    grid-template-columns: 65% 35%;
    gap: 0;
    padding: 0 40px;
    max-width: 1600px;
    margin: 0 auto;
}

.hero-main { padding-right: 32px; }

.hero-breadcrumb {
    font-family: var(--f-mono);
    font-size: 0.8125rem;
    color: var(--c-muted);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.breadcrumb-sep { color: var(--c-grid); }
.breadcrumb-item.active { color: var(--c-accent); }

.kinetic-title {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--c-text);
    margin: 0 0 40px;
    min-height: 1.2em;
}
.kinetic-title .k-letter {
    display: inline-block;
    opacity: 0;
    transform: translate(var(--rx, 0), var(--ry, 0)) scale(0.4);
    animation:
        kineticLand 1.2s var(--ease-bounce) forwards,
        kineticFloat 4s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 40ms), calc(1.3s + var(--i, 0) * 150ms);
}
.kinetic-title .k-space { display: inline-block; width: 0.5em; }
@keyframes kineticLand {
    from { opacity: 0; transform: translate(var(--rx), var(--ry)) scale(0.4); filter: blur(6px); }
    to   { opacity: 1; transform: translate(0, 0) scale(1); filter: blur(0); }
}
@keyframes kineticFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}

.hero-lede {
    font-size: 1.25rem;
    color: var(--c-text);
    max-width: 72ch;
    margin-bottom: 40px;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--c-grid);
    border: 1px solid var(--c-grid);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.metric {
    background: var(--c-bg-card);
    padding: 20px 18px;
    position: relative;
}
.metric::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--c-accent);
    opacity: 0.8;
}
.metric-label {
    font-family: var(--f-mono);
    font-size: 0.6875rem;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 8px;
}
.metric-value {
    font-family: var(--f-data);
    font-weight: 700;
    font-size: 2rem;
    color: var(--c-flame);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 16px rgba(242, 140, 40, 0.25);
}
.metric-value.metric-ok {
    font-size: 1.125rem;
    color: var(--c-moss);
    letter-spacing: 0.1em;
}
.metric-unit {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: var(--c-muted);
    margin-top: 6px;
    letter-spacing: 0.08em;
}

/* ------------------------------------------------------------
   Annotation sidebar (shared)
   ------------------------------------------------------------ */
.hero-sidebar,
.architecture-sidebar {
    background: var(--c-bg-card);
    border-left: 1px solid var(--c-grid);
    padding: 0 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.annotation-card {
    background: var(--c-bg-surface);
    border: 1px solid var(--c-grid);
    border-left: 4px solid var(--c-accent);
    padding: 18px 20px;
    position: relative;
}
.annotation-card.accent-card {
    border-left-color: var(--c-flame);
    background:
        linear-gradient(135deg, rgba(242, 140, 40, 0.04), transparent 50%),
        var(--c-bg-surface);
}
.card-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--c-grid);
}
.card-index {
    font-family: var(--f-data);
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--c-accent);
    letter-spacing: 0.15em;
}
.card-title {
    font-family: var(--f-mono);
    font-size: 0.8125rem;
    color: var(--c-muted);
    letter-spacing: 0.08em;
}
.code-block {
    font-family: var(--f-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg-deep);
    padding: 12px 14px;
    border: 1px solid var(--c-grid);
    overflow-x: auto;
    white-space: pre;
}
.code-comment { color: var(--c-moss); }
.code-keyword { color: var(--c-flame); }
.code-fn      { color: var(--c-accent); }
.code-var     { color: var(--c-text); }
.code-prop    { color: var(--c-accent); }
.code-str     { color: var(--c-moss); }
.code-num     { color: var(--c-flame); }

.annotation-list {
    list-style: none;
    font-size: 0.9375rem;
}
.annotation-list li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--c-grid);
    display: flex;
    gap: 10px;
    align-items: baseline;
}
.annotation-list li:last-child { border-bottom: 0; }
.list-bullet {
    color: var(--c-accent);
    font-size: 0.625rem;
    flex-shrink: 0;
}
.annotation-list code {
    color: var(--c-flame);
    font-size: 0.9375rem;
}

.annotation-prose {
    font-size: 0.9375rem;
    color: var(--c-text);
}

.param-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    font-family: var(--f-mono);
    font-size: 0.875rem;
}
.param-grid dt { color: var(--c-muted); }
.param-grid dd { color: var(--c-flame); text-align: right; }

/* ------------------------------------------------------------
   Architecture section
   ------------------------------------------------------------ */
.architecture-section {
    padding-bottom: 80px;
}
.architecture-layout {
    display: grid;
    grid-template-columns: 65% 35%;
    gap: 0;
    padding: 0 40px;
    max-width: 1600px;
    margin: 0 auto;
}
.architecture-diagram {
    position: relative;
    min-height: 700px;
    background:
        linear-gradient(0deg, rgba(61, 42, 24, 0.08) 0 1px, transparent 1px 60px),
        linear-gradient(90deg, rgba(61, 42, 24, 0.08) 0 1px, transparent 1px 60px),
        var(--c-bg-surface);
    border: 1px solid var(--c-grid);
    margin-right: 24px;
    overflow: hidden;
}
.architecture-diagram::before {
    content: "ARCHITECTURE / TOPOLOGY";
    position: absolute;
    top: 12px; left: 16px;
    font-family: var(--f-mono);
    font-size: 0.6875rem;
    color: var(--c-muted);
    letter-spacing: 0.2em;
    z-index: 1;
}
.arch-connectors {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}
.connector {
    fill: none;
    stroke: var(--c-accent);
    stroke-width: 1.25;
    stroke-dasharray: 6 4;
    opacity: 0.6;
    animation: dashFlow 12s linear infinite;
}
@keyframes dashFlow {
    to { stroke-dashoffset: -80; }
}

.arch-node {
    position: absolute;
    left: var(--node-x);
    top: var(--node-y);
    width: 200px;
    background: var(--c-bg-card);
    border: 1px solid var(--c-grid);
    padding: 14px 16px;
    z-index: 2;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: border-color 0.3s ease, transform 0.3s ease;
}
.arch-node::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 98, 26, 0.08), transparent 50%);
    pointer-events: none;
}
.arch-node-wide { width: 260px; }
.arch-node:hover {
    border-color: var(--c-accent);
    transform: translateY(-2px);
}
.node-tag {
    font-family: var(--f-mono);
    font-size: 0.625rem;
    color: var(--c-muted);
    letter-spacing: 0.2em;
    margin-bottom: 4px;
}
.node-title {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 0.9375rem;
    color: var(--c-accent);
    letter-spacing: 0.12em;
    margin-bottom: 4px;
}
.node-sub {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: var(--c-text);
    margin-bottom: 10px;
}
.node-ports {
    display: flex;
    justify-content: space-between;
    font-family: var(--f-data);
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
}
.port {
    padding: 2px 8px;
    border: 1px solid var(--c-grid);
    color: var(--c-muted);
    background: var(--c-bg-surface);
}
.port-in { border-left-color: var(--c-moss); color: var(--c-moss); }
.port-out { border-right-color: var(--c-flame); color: var(--c-flame); }

/* ------------------------------------------------------------
   Timeline section
   ------------------------------------------------------------ */
.timeline-section {
    padding-bottom: 80px;
    background: linear-gradient(180deg, transparent, rgba(26, 16, 8, 0.6), transparent);
}
.timeline-strip {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 40px 0 60px;
    background:
        linear-gradient(90deg, rgba(212, 98, 26, 0.04), transparent 8%, transparent 92%, rgba(212, 98, 26, 0.04)),
        var(--c-bg-surface);
    border-top: 1px solid var(--c-grid);
    border-bottom: 1px solid var(--c-grid);
}
.timeline-svg {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
.timeline-path {
    fill: none;
    stroke: var(--c-accent);
    stroke-width: 2;
    stroke-dasharray: 8 6;
    stroke-dashoffset: 2000;
    animation: tlDraw 4s ease-out forwards, dashFlow 8s linear 4s infinite;
}
@keyframes tlDraw {
    to { stroke-dashoffset: 0; }
}

.timeline-nodes {
    position: relative;
    display: flex;
    justify-content: space-around;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 40px;
}
.tl-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}
.hex-node {
    width: 56px; height: 56px;
    background: var(--c-bg-card);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: grid; place-items: center;
    position: relative;
    font-family: var(--f-display);
    font-weight: 800;
    color: var(--c-accent);
    font-size: 0.9375rem;
    letter-spacing: 0.08em;
    box-shadow: 0 0 0 1px var(--c-grid), 0 0 20px rgba(212, 98, 26, 0.15);
}
.hex-node::before {
    content: "";
    position: absolute;
    inset: 2px;
    background: var(--c-bg-surface);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: -1;
}
.hex-node.hex-warn { color: var(--c-red); }
.hex-node.hex-warn { box-shadow: 0 0 0 1px var(--c-red), 0 0 20px rgba(184, 50, 48, 0.35); }
.hex-node.hex-ok   { color: var(--c-moss); }
.hex-node.hex-ok   { box-shadow: 0 0 0 1px var(--c-moss), 0 0 20px rgba(122, 139, 110, 0.35); }
.tl-label {
    font-family: var(--f-data);
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--c-text);
    letter-spacing: 0.12em;
}
.tl-time {
    font-family: var(--f-mono);
    font-size: 0.6875rem;
    color: var(--c-muted);
}

/* ------------------------------------------------------------
   Deep dive section
   ------------------------------------------------------------ */
.deepdive-section {
    padding: 40px 40px 80px;
    max-width: 1600px;
    margin: 0 auto;
}
.deepdive-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 48px 40px;
    background: var(--c-bg-card);
    border: 1px solid var(--c-grid);
    margin-bottom: 32px;
    position: relative;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
}
.deepdive-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 60%;
    background: linear-gradient(180deg, var(--c-accent), transparent);
}
.deepdive-right .panel-viz { order: 0; }
.deepdive-right .panel-prose { order: 1; }

.panel-tag {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: var(--c-accent);
    letter-spacing: 0.2em;
    margin-bottom: 8px;
}
.panel-title {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    letter-spacing: 0.12em;
    color: var(--c-text);
    text-transform: uppercase;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--c-grid);
}
.panel-prose p {
    margin-bottom: 16px;
    color: var(--c-text);
}
.panel-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--c-grid);
}
.panel-stats > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.panel-stats strong {
    font-family: var(--f-data);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--c-flame);
}
.panel-stats span {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: var(--c-muted);
    letter-spacing: 0.1em;
}

/* Panel viz (3D shapes) */
.panel-viz {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    perspective: 800px;
    min-height: 320px;
}
.viz-caption {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: var(--c-muted);
    letter-spacing: 0.1em;
    margin-top: 24px;
}

.shape3d {
    position: relative;
    transform-style: preserve-3d;
    animation: shapeRotate 20s linear infinite;
    width: 180px; height: 180px;
}

@keyframes shapeRotate {
    from { transform: rotateX(-20deg) rotateY(0deg); }
    to   { transform: rotateX(-20deg) rotateY(360deg); }
}

/* cube */
.shape-cube .face {
    position: absolute;
    width: 180px; height: 180px;
    border: 1px solid var(--c-accent);
    background: rgba(212, 98, 26, 0.08);
    box-shadow: inset 0 0 40px rgba(212, 98, 26, 0.15);
}
.shape-cube .face::before {
    content: "";
    position: absolute;
    inset: 20%;
    border: 1px dashed rgba(212, 98, 26, 0.3);
}
.shape-cube .face-front  { transform: translateZ(90px); }
.shape-cube .face-back   { transform: rotateY(180deg) translateZ(90px); }
.shape-cube .face-right  { transform: rotateY(90deg)  translateZ(90px); }
.shape-cube .face-left   { transform: rotateY(-90deg) translateZ(90px); }
.shape-cube .face-top    { transform: rotateX(90deg)  translateZ(90px); }
.shape-cube .face-bottom { transform: rotateX(-90deg) translateZ(90px); }

/* hexagonal prism */
.shape-hex {
    width: 180px; height: 220px;
}
.shape-hex .hex-face {
    position: absolute;
    border: 1px solid var(--c-accent);
    background: rgba(212, 98, 26, 0.06);
}
.shape-hex .hex-face-top,
.shape-hex .hex-face-bottom {
    width: 180px; height: 180px;
    top: 20px; left: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.shape-hex .hex-face-top    { transform: rotateX(90deg)  translateZ(110px); }
.shape-hex .hex-face-bottom { transform: rotateX(-90deg) translateZ(110px); }

.shape-hex .hex-face-s1,
.shape-hex .hex-face-s2,
.shape-hex .hex-face-s3,
.shape-hex .hex-face-s4,
.shape-hex .hex-face-s5,
.shape-hex .hex-face-s6 {
    width: 92px; height: 220px;
    top: 0; left: 44px;
}
.shape-hex .hex-face-s1 { transform: rotateY(0deg)   translateZ(80px); }
.shape-hex .hex-face-s2 { transform: rotateY(60deg)  translateZ(80px); }
.shape-hex .hex-face-s3 { transform: rotateY(120deg) translateZ(80px); }
.shape-hex .hex-face-s4 { transform: rotateY(180deg) translateZ(80px); }
.shape-hex .hex-face-s5 { transform: rotateY(240deg) translateZ(80px); }
.shape-hex .hex-face-s6 { transform: rotateY(300deg) translateZ(80px); }

/* icosahedron approximation (dodecagon shell) */
.shape-icosa { width: 220px; height: 220px; }
.shape-icosa .ico-face {
    position: absolute;
    top: 50%; left: 50%;
    width: 70px; height: 70px;
    margin: -35px 0 0 -35px;
    border: 1px solid var(--c-accent);
    background: rgba(212, 98, 26, 0.05);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}
.shape-icosa .ico-f1  { transform: rotateY(0deg)   translateZ(90px); }
.shape-icosa .ico-f2  { transform: rotateY(60deg)  translateZ(90px); }
.shape-icosa .ico-f3  { transform: rotateY(120deg) translateZ(90px); }
.shape-icosa .ico-f4  { transform: rotateY(180deg) translateZ(90px); }
.shape-icosa .ico-f5  { transform: rotateY(240deg) translateZ(90px); }
.shape-icosa .ico-f6  { transform: rotateY(300deg) translateZ(90px); }
.shape-icosa .ico-f7  { transform: rotateX(60deg)  rotateY(30deg)  translateZ(90px); }
.shape-icosa .ico-f8  { transform: rotateX(60deg)  rotateY(90deg)  translateZ(90px); }
.shape-icosa .ico-f9  { transform: rotateX(60deg)  rotateY(150deg) translateZ(90px); }
.shape-icosa .ico-f10 { transform: rotateX(-60deg) rotateY(30deg)  translateZ(90px); }
.shape-icosa .ico-f11 { transform: rotateX(-60deg) rotateY(90deg)  translateZ(90px); }
.shape-icosa .ico-f12 { transform: rotateX(-60deg) rotateY(150deg) translateZ(90px); }

/* ------------------------------------------------------------
   Docs section
   ------------------------------------------------------------ */
.docs-section {
    padding-bottom: 80px;
}
.docs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 0 40px;
    max-width: 1600px;
    margin: 0 auto;
    background: var(--c-grid);
    border: 1px solid var(--c-grid);
    row-gap: 1px;
    column-gap: 1px;
}
.doc-card {
    background: var(--c-bg-card);
    padding: 24px 22px;
    position: relative;
    transition: background 0.3s ease;
}
.doc-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: var(--c-accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}
.doc-card:hover { background: var(--c-bg-surface); }
.doc-card:hover::before { transform: scaleY(1); }
.doc-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--c-grid);
}
.doc-kind {
    font-family: var(--f-mono);
    font-size: 0.6875rem;
    color: var(--c-muted);
    letter-spacing: 0.2em;
}
.doc-name {
    font-family: var(--f-mono);
    font-size: 0.9375rem;
    color: var(--c-accent);
}
.doc-card p {
    font-size: 0.9375rem;
    color: var(--c-text);
}

/* ------------------------------------------------------------
   Terminal footer
   ------------------------------------------------------------ */
.terminal-footer {
    position: relative;
    background: var(--c-bg-deep);
    border-top: 1px solid var(--c-accent-2);
    padding: 20px 40px 24px;
    font-family: var(--f-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    overflow: hidden;
}
.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--c-grid);
    font-size: 0.75rem;
    color: var(--c-muted);
    letter-spacing: 0.1em;
}
.terminal-tag { color: var(--c-accent); }
.terminal-status {
    display: flex;
    align-items: center;
    gap: 8px;
}
.terminal-body {
    min-height: 240px;
    max-height: 280px;
    overflow: hidden;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
}
.terminal-line {
    display: flex;
    gap: 10px;
    align-items: baseline;
    opacity: 0;
    animation: lineIn 0.3s ease-out forwards;
    flex-wrap: wrap;
}
@keyframes lineIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.log-ts  { color: var(--c-muted); flex-shrink: 0; }
.log-info  { color: var(--c-moss);   font-weight: bold; }
.log-event { color: var(--c-accent); font-weight: bold; }
.log-warn  { color: var(--c-red);    font-weight: bold; }
.log-debug { color: var(--c-muted);  font-weight: bold; }
.log-msg   { color: var(--c-text); flex: 1; min-width: 200px; }

.terminal-prompt {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--c-grid);
    display: flex;
    align-items: center;
    gap: 10px;
}
.prompt-sigil { color: var(--c-accent); }
.prompt-text  { color: var(--c-text); }
.cursor-block {
    color: var(--c-accent);
    animation: cursorBlink 1s steps(1) infinite;
}
@keyframes cursorBlink {
    0%, 49%  { opacity: 1; }
    50%,100% { opacity: 0; }
}

/* ------------------------------------------------------------
   Zoom-focus pattern (universal)
   ------------------------------------------------------------ */
.zoom-target {
    opacity: 0;
    transform: scale(0.85);
    filter: blur(4px);
    transition:
        transform 0.6s var(--ease-snap),
        opacity 0.4s ease-out,
        filter 0.5s ease-out;
    transition-delay: var(--delay, 0ms);
}
.zoom-target.in-focus {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1100px) {
    .engine-header { height: auto; }
    .header-inner {
        grid-template-columns: 1fr;
        padding: 12px 20px;
        gap: 10px;
        text-align: center;
    }
    .counter-cluster { justify-self: stretch; }
    .header-nav { justify-content: center; flex-wrap: wrap; gap: 14px; }
    .engine-main { padding-top: 180px; }

    .hero-layout,
    .architecture-layout {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }
    .hero-main { padding-right: 0; }
    .hero-sidebar,
    .architecture-sidebar {
        border-left: 0;
        border-top: 1px solid var(--c-grid);
        padding: 24px 0 0 0;
        margin-top: 32px;
    }
    .architecture-diagram {
        margin-right: 0;
        min-height: 560px;
    }
    .arch-node { width: 160px; }
    .arch-node-wide { width: 200px; }

    .deepdive-panel { grid-template-columns: 1fr; padding: 32px 20px; }
    .deepdive-right .panel-viz { order: 1; }
    .deepdive-right .panel-prose { order: 0; }

    .docs-grid { grid-template-columns: repeat(2, 1fr); padding: 0 20px; }

    .hero-metrics { grid-template-columns: repeat(2, 1fr); }

    .timeline-nodes { overflow-x: auto; gap: 24px; padding: 0 20px; }
    .tl-node { flex-shrink: 0; }

    .terminal-footer { padding: 20px; }
    .section-heading, .section-rule, .section-prose { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 640px) {
    .wordmark { font-size: 1.125rem; letter-spacing: 0.2em; }
    .wordmark-tag { display: none; }
    .counter-cluster { font-size: 0.8125rem; }
    .counter-value { min-width: 90px; }
    .docs-grid { grid-template-columns: 1fr; }
    .hero-metrics { grid-template-columns: 1fr; }
    .panel-stats { grid-template-columns: 1fr; gap: 8px; }
    .architecture-diagram { min-height: 760px; }
    .arch-node { width: 140px; padding: 10px 12px; }
    .node-title { font-size: 0.8125rem; }
}
