/* =========================================================
   LegalDebug.com — wabi-sabi × sci-fi HUD
   Palette: analogous deep-water (indigo → teal → seafoam)
   with warm kintsugi accents.
   Compliance tokens: classical character evokes tradition scholarly Mono" (Google Interactive elements IntersectionObserver threshold: | `#0d1117` | Primary
   ========================================================= */

:root {
    --void: #0d1117;
    --depth: #161b22;
    --surface: #21262d;
    --glow-1: #67e8f9;
    --glow-2: #5eead4;
    --glow-3: #2dd4bf;
    --text: #c9d1d9;
    --text-dim: #8b949e;
    --crack: #d4956a;
    --amber: #e3a857;

    --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
    --font-serif: 'Libre Baskerville', 'Georgia', serif;

    --max-w: 1320px;
}

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

html, body {
    background: var(--void);
    color: var(--text);
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    position: relative;
    min-height: 100vh;
}

a {
    color: var(--glow-3);
    text-decoration: none;
    transition: color .25s ease;
}

a:hover {
    color: var(--glow-1);
}

h1, h2, h3 {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text);
}

p {
    font-family: var(--font-serif);
}

/* =========================================================
   Global overlays
   ========================================================= */

.bubble-field {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -120px;
    border-radius: 50%;
    border: 1px solid rgba(103, 232, 249, 0.5);
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 35%),
        radial-gradient(circle at 50% 50%, rgba(103, 232, 249, 0.04) 0%, rgba(103, 232, 249, 0.02) 70%);
    opacity: 0;
    will-change: transform, opacity;
    animation-name: rise;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes rise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    8% { opacity: 1; }
    50% {
        transform: translateY(-55vh) translateX(var(--drift-mid, 20px));
    }
    92% { opacity: 1; }
    100% {
        transform: translateY(-110vh) translateX(var(--drift-end, 0));
        opacity: 0;
    }
}

.scan-overlay {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(103, 232, 249, 0) 0,
            rgba(103, 232, 249, 0) 3px,
            rgba(103, 232, 249, 0.018) 3px,
            rgba(103, 232, 249, 0.018) 4px
        );
    mix-blend-mode: screen;
}

.scan-overlay::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -20%;
    height: 25%;
    background: linear-gradient(
        to bottom,
        rgba(103, 232, 249, 0) 0%,
        rgba(103, 232, 249, 0.04) 50%,
        rgba(103, 232, 249, 0) 100%
    );
    animation: scanSweep 12s linear infinite;
}

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

.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.8 0 0 0 0 0.9 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-size: 160px 160px;
    mix-blend-mode: overlay;
}

.scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    width: 1px;
    height: 0%;
    background: linear-gradient(to bottom, var(--glow-1), var(--glow-2));
    box-shadow: 0 0 6px rgba(103, 232, 249, 0.6);
    z-index: 50;
    transition: height 0.08s linear;
}

/* =========================================================
   Top nav
   ========================================================= */

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(to bottom, rgba(13, 17, 23, 0.85), rgba(13, 17, 23, 0));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.monogram {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.14em;
    display: inline-flex;
    gap: 0.15em;
}

.mono-bracket {
    color: var(--amber);
}

.mono-letter {
    color: var(--glow-1);
    text-shadow: 0 0 6px rgba(103, 232, 249, 0.4);
}

.nav-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(103, 232, 249, 0.35), rgba(103, 232, 249, 0.02) 70%, transparent);
}

.nav-status {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--glow-3);
    box-shadow: 0 0 6px var(--glow-3);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* =========================================================
   Side nav
   ========================================================= */

.side-nav {
    position: fixed;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.side-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    color: var(--text-dim);
    text-align: right;
    position: relative;
    transition: color .3s ease, letter-spacing .3s ease;
}

.side-nav-item .cursor {
    color: var(--amber);
    animation: blink 1.06s steps(2) infinite;
    font-size: 0.75rem;
}

.side-nav-item .side-label {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    transition: max-width .45s ease, opacity .35s ease, color .3s ease;
}

.side-nav-item:hover,
.side-nav-item.active {
    color: var(--glow-1);
}

.side-nav-item:hover .side-label,
.side-nav-item.active .side-label {
    max-width: 200px;
    opacity: 1;
}

.side-nav-item.active .cursor {
    color: var(--glow-1);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}

/* =========================================================
   Depth readout (floating HUD)
   ========================================================= */

.depth-readout {
    position: fixed;
    left: 1.25rem;
    bottom: 1.25rem;
    z-index: 40;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    border-left: 1px solid rgba(103, 232, 249, 0.25);
    padding: 0.5rem 0.8rem;
    background: rgba(13, 17, 23, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    min-width: 170px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.readout-line {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
}

.readout-label { color: var(--text-dim); }
.readout-value {
    color: var(--glow-1);
    text-shadow: 0 0 5px rgba(103, 232, 249, 0.35);
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
    position: relative;
    min-height: 100vh;
    padding: 6rem 2rem 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    overflow: hidden;
}

.hud-corner {
    position: absolute;
    width: 80px;
    height: 80px;
    z-index: 6;
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: drawBracket 1.2s ease-out 0.2s forwards;
    opacity: 0.75;
}

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

@keyframes drawBracket {
    to { stroke-dashoffset: 0; }
}

.hud-corner circle {
    opacity: 0;
    animation: fadeIn 0.6s ease 1.3s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.annotation {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 0.15rem 0.4rem;
    border-left: 1px solid rgba(103, 232, 249, 0.3);
    animation: annFade 10s ease-in-out infinite;
    z-index: 6;
}

.ann-1 { top: 14%; left: 8%;   animation-delay: 0s;   }
.ann-2 { top: 22%; right: 12%; animation-delay: -2s;  }
.ann-3 { bottom: 28%; left: 11%; animation-delay: -4s; color: var(--amber); border-color: var(--amber); }
.ann-4 { top: 40%; right: 7%;  animation-delay: -6s;  }
.ann-5 { bottom: 18%; right: 14%; animation-delay: -8s; }

@keyframes annFade {
    0%, 100% { opacity: 0.2; }
    30%, 70% { opacity: 0.9; }
}

.reticle {
    position: absolute;
    width: 40px;
    height: 40px;
    z-index: 6;
    opacity: 0.55;
    animation: reticleFloat 9s ease-in-out infinite;
}

.ret-1 { top: 32%; left: 18%; }
.ret-2 { bottom: 26%; right: 20%; animation-delay: -3s; }

@keyframes reticleFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(3px, -4px); }
}

.hero-inner {
    position: relative;
    z-index: 7;
    max-width: 960px;
    text-align: center;
    padding: 2rem;
}

.pre-heading {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 1.4rem;
    opacity: 0;
    animation: fadeUp 1s ease 0.4s forwards;
}

.pre-bracket { color: var(--glow-2); }

.hero-title {
    font-size: clamp(2.2rem, 6.5vw, 5rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: 0.02em;
    color: var(--text);
    margin-bottom: 1.5rem;
    min-height: 1.2em;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
}

.typewriter {
    white-space: pre;
    color: var(--text);
    text-shadow: 0 0 14px rgba(103, 232, 249, 0.18);
}

.typewriter .ch {
    opacity: 0;
    display: inline-block;
    animation: chIn 0.2s ease forwards;
}

@keyframes chIn { to { opacity: 1; } }

.tw-cursor {
    display: inline-block;
    color: var(--amber);
    margin-left: 2px;
    animation: blink 1.06s steps(2) infinite;
    width: 0.5em;
    text-align: left;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    color: var(--text-dim);
    text-transform: lowercase;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.hero-subtitle.show { opacity: 1; }

.hero-meta {
    margin-top: 2.2rem;
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    opacity: 0;
    animation: fadeUp 1s ease 2.6s forwards;
}

.meta-sep { color: rgba(139, 148, 158, 0.4); }

.descend-cue {
    margin-top: 3.2rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.22em;
    color: var(--glow-2);
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 1s ease 3s forwards;
}

.descend-arrow {
    width: 20px;
    height: 40px;
    animation: descendBounce 2.8s ease-in-out infinite;
}

@keyframes descendBounce {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(6px); opacity: 1; }
}

.hero-footer-rule {
    position: absolute;
    left: 100px;
    right: 100px;
    bottom: 40px;
    z-index: 6;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    color: var(--text-dim);
    text-transform: uppercase;
    border-top: 1px dashed rgba(103, 232, 249, 0.18);
    padding-top: 0.6rem;
    flex-wrap: wrap;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Section heads (shared)
   ========================================================= */

.grid-section,
.diagnostics-section,
.manifest-section {
    position: relative;
    z-index: 5;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 6rem 2rem 5rem;
}

.section-head {
    max-width: 720px;
    margin-bottom: 3.5rem;
    position: relative;
}

.section-index {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 0.8rem;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 500;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

.section-desc {
    font-family: var(--font-serif);
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--text-dim);
    max-width: 620px;
}

.section-rule {
    margin-top: 1.4rem;
    height: 1px;
    width: 120px;
    background: linear-gradient(to right, var(--glow-1), transparent);
    position: relative;
}

.section-rule::after {
    content: "";
    position: absolute;
    right: -6px;
    top: -2px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 6px var(--amber);
}

/* =========================================================
   Case fragments grid
   ========================================================= */

.grid-section { position: relative; }

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: minmax(200px, auto);
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.tile {
    position: relative;
    padding: 1.4rem 1.4rem 1.2rem;
    background: rgba(33, 38, 45, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(103, 232, 249, 0.1);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: border-color .4s ease, box-shadow .4s ease, transform .4s ease;
    opacity: 0;
    transform: translateY(24px);
}

.tile.in-view {
    opacity: 1;
    transform: translateY(0);
}

.tile-tall { grid-row: span 2; }
.tile-short { min-height: 160px; }

.tile-clip-tr {
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}

.tile-clip-bl {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 24px 100%, 0 calc(100% - 24px));
}

.tile:nth-child(3n)  { transform: translateY(24px) rotate(0.4deg); }
.tile:nth-child(3n).in-view { transform: translateY(0) rotate(0.4deg); }
.tile:nth-child(5n)  { transform: translateY(24px) rotate(-0.3deg); }
.tile:nth-child(5n).in-view { transform: translateY(0) rotate(-0.3deg); }

.tile::before {
    /* Kintsugi gold edge — top-right quadrant */
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    height: 45%;
    width: 1px;
    background: linear-gradient(to bottom, rgba(227, 168, 87, 0.55), transparent);
    opacity: 0.4;
    transition: opacity .4s ease;
}

.tile::after {
    /* worn-away border fade — bottom edge */
    content: "";
    position: absolute;
    left: 20%;
    right: 10%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(212, 149, 106, 0.35), transparent);
    opacity: 0.45;
}

.tile:hover {
    border-color: rgba(103, 232, 249, 0.3);
    box-shadow: 0 0 20px rgba(103, 232, 249, 0.06), inset 0 0 40px rgba(103, 232, 249, 0.02);
}

.tile:hover::before { opacity: 1; }

.tile.glitch { animation: glitch 0.12s steps(2) 1; }

@keyframes glitch {
    0% { transform: translateX(0); filter: none; }
    50% { transform: translateX(-1px) skewX(-0.4deg); filter: hue-rotate(8deg); }
    100% { transform: translateX(0); filter: none; }
}

.tile-head {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.tile-tag {
    color: var(--glow-2);
}

.tile-title {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text);
    line-height: 1.35;
}

.tile-body {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
    color: rgba(201, 209, 217, 0.85);
}

.tile-body--sub {
    font-size: 0.82rem;
    color: var(--text-dim);
    font-style: italic;
    border-left: 1px solid rgba(103, 232, 249, 0.25);
    padding-left: 0.6rem;
}

.tile-foot {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(103, 232, 249, 0.12);
}

.foot-arrow {
    color: var(--glow-1);
    transition: transform .3s ease;
}

.tile:hover .foot-arrow { transform: translateX(4px); }

.crack-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 45%;
    height: 20px;
    width: 100%;
    pointer-events: none;
    opacity: 0.5;
}

.crack-line.lower { top: auto; bottom: 30%; }

.neural-lines {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.35;
}

.neural-lines .nline {
    stroke-dasharray: 4 6;
    animation: nlineDash 18s linear infinite;
}

@keyframes nlineDash {
    to { stroke-dashoffset: -200; }
}

/* =========================================================
   Void sections
   ========================================================= */

.void-section {
    position: relative;
    z-index: 5;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    overflow: hidden;
}

.void-rail {
    position: absolute;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(103, 232, 249, 0.2), transparent);
}

.void-rail.left  { left: 40px; }
.void-rail.right { right: 40px; }

.void-inner {
    max-width: 760px;
    text-align: center;
    position: relative;
}

.void-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--glow-2);
    margin-bottom: 2rem;
}

.void-text {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1.15rem, 2.4vw, 1.7rem);
    line-height: 1.6;
    color: var(--text);
    min-height: 3em;
}

.void-text .ch {
    opacity: 0;
    display: inline-block;
    animation: chIn 0.2s ease forwards;
}

.void-attribution {
    margin-top: 2rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
    opacity: 0;
    transition: opacity 1s ease;
}

.void-attribution.show { opacity: 1; }

/* =========================================================
   Diagnostics
   ========================================================= */

.diagnostics-section { position: relative; }

.diag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: minmax(220px, auto);
    gap: 1.5rem;
}

.diag-card {
    background: rgba(22, 27, 34, 0.75);
    border: 1px solid rgba(103, 232, 249, 0.12);
    border-radius: 6px;
    padding: 1.25rem 1.3rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    position: relative;
    overflow: hidden;
}

.diag-card--wide { grid-column: span 2; }

@media (max-width: 720px) {
    .diag-card--wide { grid-column: span 1; }
}

.diag-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 1px;
    width: 40%;
    background: linear-gradient(to right, var(--amber), transparent);
    opacity: 0.45;
}

.diag-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.diag-label { color: var(--glow-2); }

.diag-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-dim);
}

.blip {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--glow-3);
    box-shadow: 0 0 6px var(--glow-3);
    animation: pulse 1.6s ease-in-out infinite;
}

.blip.amber {
    background: var(--amber);
    box-shadow: 0 0 6px var(--amber);
}

.diag-log {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.55;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 260px;
    overflow: hidden;
}

.log-line {
    display: grid;
    grid-template-columns: 90px 52px 1fr;
    gap: 0.7rem;
    align-items: baseline;
    padding: 0.15rem 0;
    border-bottom: 1px dashed rgba(103, 232, 249, 0.06);
    opacity: 0;
    transform: translateY(4px);
    animation: logIn 0.5s ease forwards;
}

.log-line:nth-child(1) { animation-delay: 0s; }
.log-line:nth-child(2) { animation-delay: 0.25s; }
.log-line:nth-child(3) { animation-delay: 0.5s; }
.log-line:nth-child(4) { animation-delay: 0.75s; }
.log-line:nth-child(5) { animation-delay: 1s; }
.log-line:nth-child(6) { animation-delay: 1.25s; }
.log-line:nth-child(7) { animation-delay: 1.5s; }
.log-line:nth-child(8) { animation-delay: 1.75s; }

@keyframes logIn { to { opacity: 1; transform: translateY(0); } }

.log-ts { color: var(--text-dim); font-size: 0.65rem; }

.log-lvl {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    padding: 0.05rem 0.35rem;
    border: 1px solid currentColor;
    border-radius: 2px;
    text-align: center;
}

.lvl-info { color: var(--glow-1); }
.lvl-warn { color: var(--amber); }
.lvl-hint { color: var(--glow-2); }

.log-msg { color: var(--text); font-size: 0.72rem; }

.diag-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.diag-body--center {
    align-items: center;
    justify-content: center;
}

.drift-chart, .graph-svg {
    width: 100%;
    max-height: 120px;
}

.chart-legend, .graph-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px dashed rgba(103, 232, 249, 0.08);
    padding-bottom: 0.35rem;
}

.stat-row dt { color: var(--text-dim); }

.stat-row dd { color: var(--text); }

.stat-num {
    font-size: 1.1rem;
    color: var(--glow-1);
    margin-right: 0.3rem;
    font-weight: 500;
}

.stat-num.amber { color: var(--amber); }

.observatory-glyph {
    width: 140px;
    height: 140px;
    animation: glyphRotate 60s linear infinite;
}

@keyframes glyphRotate {
    to { transform: rotate(360deg); }
}

.glyph-caption {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 0.6rem;
    text-align: center;
}

.orbit {
    stroke-dasharray: 1 6;
    animation: orbit 22s linear infinite;
}

@keyframes orbit { to { stroke-dashoffset: -200; } }

/* =========================================================
   Manifest
   ========================================================= */

.manifest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.manifest-card {
    background: rgba(22, 27, 34, 0.75);
    border: 1px solid rgba(103, 232, 249, 0.1);
    border-radius: 6px;
    padding: 1.6rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.manifest-card::after {
    /* kintsugi vertical join */
    content: "";
    position: absolute;
    left: 0;
    top: 10%;
    bottom: 10%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(227, 168, 87, 0.45), transparent);
}

.mc-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.mc-num {
    color: var(--amber);
    font-size: 0.78rem;
}

.mc-title {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.mc-body {
    font-family: var(--font-serif);
    font-size: 0.98rem;
    line-height: 1.75;
    color: rgba(201, 209, 217, 0.9);
}

.signal-out {
    margin-top: 2rem;
    padding: 1.2rem 1.4rem;
    border: 1px dashed rgba(103, 232, 249, 0.18);
    border-radius: 6px;
    background: rgba(13, 17, 23, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.signal-line {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.sig-label {
    color: var(--glow-2);
    min-width: 80px;
}

.sig-track {
    flex: 1;
    height: 3px;
    background: rgba(103, 232, 249, 0.08);
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    min-width: 160px;
}

.sig-fill {
    position: absolute;
    inset: 0;
    width: 82%;
    background: linear-gradient(to right, var(--glow-1), var(--glow-2));
    box-shadow: 0 0 10px rgba(103, 232, 249, 0.4);
    animation: sigPulse 4s ease-in-out infinite;
}

@keyframes sigPulse {
    0%, 100% { opacity: 0.85; width: 82%; }
    50%      { opacity: 1;   width: 88%; }
}

.sig-value { color: var(--glow-1); }
.sig-ch    { color: var(--text); font-family: var(--font-mono); }

/* =========================================================
   Footer
   ========================================================= */

.site-foot {
    position: relative;
    z-index: 5;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

.foot-rule {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(103, 232, 249, 0.25), transparent);
    margin-bottom: 2rem;
}

.foot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.foot-col {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.foot-tag.dim { color: rgba(139, 148, 158, 0.55); }

.foot-col:nth-child(3) .foot-tag:first-child { color: var(--glow-2); }

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

@media (max-width: 760px) {
    .side-nav { display: none; }
    .depth-readout { display: none; }
    .hero-footer-rule { left: 20px; right: 20px; gap: 0.4rem; font-size: 0.55rem; }
    .hud-corner { width: 56px; height: 56px; }
    .hud-corner.tl, .hud-corner.tr { top: 14px; }
    .hud-corner.bl, .hud-corner.br { bottom: 14px; }
    .hud-corner.tl, .hud-corner.bl { left: 14px; }
    .hud-corner.tr, .hud-corner.br { right: 14px; }
    .top-nav { padding: 0.8rem 1rem; }
    .annotation { display: none; }
    .reticle { display: none; }
}

@media (max-width: 480px) {
    .grid-section, .diagnostics-section, .manifest-section { padding: 4rem 1.1rem 3rem; }
    .hero { padding: 5rem 1.1rem 3rem; }
    .void-rail { display: none; }
    .log-line { grid-template-columns: 70px 42px 1fr; gap: 0.4rem; }
}
