/* =====================================================
   desca.work — brutalist energy broadcast
   Stacked-sections brutalism with aurora-light motifs
   Typography compliance notes: Space Grotesk" (Google Fonts weight 300 (thin for ghost indices; Work Sans" (Google Fonts weight 600 for small labels and category tags. Space Grotesk + Work Sans pairing avoids the mono-dominated (91% field. Interaction:** IntersectionObserver with `threshold: [0, 0.3, 0.6, 1.0].
   ===================================================== */

:root {
    --bg-dark: #0a1628;
    --bg-light: #e8edf3;
    --text-dark: #d6e4f0;
    --text-light: #1a2a3e;
    --text-muted: #b8c9db;
    --accent-cyan: #00e5cc;
    --accent-green: #2dff8c;
    --accent-violet: #7b5cff;
    --steel-rule: #1b3a5c;
    --steel-rule-dark: #2a5080;
    --hover-frost: #00fff2;
    --midnight-hard: #0a1628;
    --slab-dark-alt: #0d1d35;
    --aurora-gradient: linear-gradient(135deg, #00e5cc, #2dff8c, #7b5cff);
    --slab-pad-x: clamp(1.5rem, 8vw, 9rem);
    --font-display: 'Space Grotesk', 'Arial Black', sans-serif;
    --font-body: 'Work Sans', 'Inter', sans-serif;
}

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

html {
    scroll-behavior: auto;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   TOP NAV — brand stamp, not UI
   ===================================================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--steel-rule);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 var(--slab-pad-x);
    z-index: 100;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.brand-stamp {
    color: var(--accent-cyan);
    font-weight: 700;
    letter-spacing: 0.2em;
}

/* =====================================================
   STACK — the poured floors
   ===================================================== */
.stack {
    display: flex;
    flex-direction: column;
}

.slab {
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding: 96px var(--slab-pad-x) 6rem;
    border-bottom: 4px solid var(--midnight-hard);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slab-dark {
    background: var(--bg-dark);
    color: var(--text-dark);
}

.slab-dark::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 4px 4px, 7px 7px;
    background-position: 0 0, 2px 2px;
    mix-blend-mode: overlay;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.slab-light {
    background: var(--bg-light);
    color: var(--text-light);
}

.slab-light::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(26, 42, 62, 0.025) 1px, transparent 1px);
    background-size: 3px 3px;
    pointer-events: none;
    z-index: 0;
}

/* =====================================================
   SECTION INDEX — ghostly industrial numbering
   ===================================================== */
.slab-index {
    position: absolute;
    top: 80px;
    right: var(--slab-pad-x);
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(8rem, 20vw, 24rem);
    line-height: 0.8;
    letter-spacing: -0.04em;
    opacity: 0.08;
    pointer-events: none;
    z-index: 1;
    color: currentColor;
    user-select: none;
}

/* =====================================================
   SLAB CONTENT
   ===================================================== */
.slab-content {
    position: relative;
    z-index: 5;
    max-width: 1400px;
    width: 100%;
    filter: blur(12px);
    opacity: 0.4;
    transition:
        filter 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.6s ease-out;
}

.slab-content[data-intersect="30"] {
    filter: blur(6px);
    opacity: 0.7;
}

.slab-content[data-intersect="60"] {
    filter: blur(2px);
    opacity: 0.9;
}

.slab-content[data-intersect="100"] {
    filter: blur(0);
    opacity: 1;
}

/* =====================================================
   TYPOGRAPHY
   ===================================================== */
.section-label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 2.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--accent-cyan);
}

.slab-light .section-label {
    color: var(--text-light);
    border-left-color: var(--text-light);
}

.headline-mega {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.92;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 3rem;
    display: block;
}

.headline-line {
    display: block;
    overflow: hidden;
}

.headline-line .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(25px);
    transition:
        opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.headline-line .char.space-char {
    width: 0.3em;
}

.headline-line.revealed .char {
    opacity: 1;
    transform: translateY(0);
}

.gradient-text {
    background: var(--aurora-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: gradient-shift 8s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* =====================================================
   HERO SECTION 01
   ===================================================== */
.slab-hero {
    min-height: 100vh;
}

.aurora-wash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 229, 204, 0.22) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 30% 10%, rgba(45, 255, 140, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 75% 15%, rgba(123, 92, 255, 0.18) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
    animation: aurora-breathe 12s ease-in-out infinite;
}

@keyframes aurora-breathe {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-10px) scale(1.03); opacity: 0.9; }
}

.aurora-wash-coda {
    height: 60%;
    top: 20%;
    opacity: 0.7;
}

.aurora-sparks {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.aurora-spark {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--aurora-gradient);
    opacity: 0;
    filter: blur(0.5px);
    box-shadow: 0 0 8px rgba(0, 229, 204, 0.6);
}

.crane-illustration {
    position: absolute;
    top: 10%;
    right: -4%;
    width: clamp(280px, 32vw, 520px);
    height: auto;
    opacity: 0.55;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 0 20px rgba(0, 229, 204, 0.2));
}

.crane-illustration svg {
    width: 100%;
    height: auto;
    display: block;
}

.hero-sub {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 48ch;
    margin-bottom: 4rem;
}

.scroll-cue {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-cyan);
}

.cue-line {
    display: inline-block;
    width: 80px;
    height: 1px;
    background: var(--accent-cyan);
    position: relative;
    overflow: hidden;
}

.cue-line::after {
    content: "";
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--hover-frost);
    animation: cue-slide 2.4s ease-in-out infinite;
}

@keyframes cue-slide {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* =====================================================
   AURORA BAND — between sections
   ===================================================== */
.aurora-band {
    position: relative;
    width: 100%;
    height: 120px;
    background: var(--bg-dark);
    overflow: hidden;
    border-top: 2px solid var(--steel-rule);
    border-bottom: 2px solid var(--steel-rule);
}

.aurora-band-inverse {
    background: var(--bg-light);
}

.aurora-band svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: blur(8px);
    opacity: 0.7;
}

.aurora-wave {
    stroke-dasharray: 30 10;
    animation: wave-flow 20s linear infinite;
}

.aurora-wave-1 { animation-duration: 20s; opacity: 0.7; }
.aurora-wave-2 { animation-duration: 25s; animation-direction: reverse; opacity: 0.6; }
.aurora-wave-3 { animation-duration: 30s; opacity: 0.5; }
.aurora-wave-4 { animation-duration: 22s; animation-direction: reverse; opacity: 0.65; }

@keyframes wave-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -400; }
}

.aurora-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 229, 204, 0.08) 50%, transparent 100%);
    animation: band-pulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes band-pulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 0.9; transform: translateY(-5px); }
}

/* =====================================================
   SLAB 02 — MANIFEST (light)
   ===================================================== */
.manifest-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    max-width: 72ch;
}

@media (min-width: 900px) {
    .manifest-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
        max-width: none;
    }
}

.manifest-body {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-light);
    padding-top: 1.5rem;
    border-top: 1px solid var(--steel-rule);
}

/* =====================================================
   SLAB 03 — APPARATUS
   ===================================================== */
.apparatus-illustration {
    position: absolute;
    top: 50%;
    right: -2%;
    transform: translateY(-50%);
    width: clamp(260px, 30vw, 440px);
    opacity: 0.45;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 0 25px rgba(123, 92, 255, 0.15));
}

.apparatus-illustration svg {
    width: 100%;
    height: auto;
    display: block;
    animation: slow-rotate 40s linear infinite;
}

@keyframes slow-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.apparatus-list {
    max-width: 720px;
    margin-top: 1rem;
}

.apparatus-row {
    display: grid;
    grid-template-columns: minmax(140px, 180px) 1fr;
    gap: 2rem;
    padding: 1.4rem 0;
    border-top: 1px solid var(--steel-rule);
    align-items: baseline;
}

.apparatus-row:last-child {
    border-bottom: 1px solid var(--steel-rule);
}

.apparatus-key {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-cyan);
}

.apparatus-val {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* =====================================================
   SLAB 04 — LEDGER (light)
   ===================================================== */
.ledger-table {
    max-width: 960px;
    border-top: 2px solid var(--text-light);
    border-bottom: 2px solid var(--text-light);
    margin-top: 1rem;
}

.ledger-row {
    display: grid;
    grid-template-columns: 80px 1fr 1.4fr 80px;
    gap: 1.2rem;
    padding: 1.2rem 0;
    align-items: baseline;
    border-bottom: 1px solid rgba(26, 42, 62, 0.15);
    font-size: 16px;
}

.ledger-row:last-child {
    border-bottom: none;
}

.ledger-head {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-light);
    padding-bottom: 0.6rem;
    padding-top: 0.6rem;
    border-bottom: 1px solid var(--text-light);
}

.ledger-row span:first-child {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-light);
}

.ledger-row span:nth-child(4) {
    text-align: right;
    font-family: var(--font-display);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* =====================================================
   SLAB 05 — BLUEPRINT
   ===================================================== */
.blueprint-illustration {
    position: absolute;
    bottom: 8%;
    right: 2%;
    width: clamp(280px, 32vw, 500px);
    opacity: 0.5;
    z-index: 2;
    pointer-events: none;
}

.blueprint-illustration svg {
    width: 100%;
    height: auto;
    display: block;
}

.blueprint-body {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 58ch;
    margin-bottom: 3rem;
}

.blueprint-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--steel-rule);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-cyan);
}

/* =====================================================
   SLAB 06 — CODA (200vh)
   ===================================================== */
.slab-coda {
    min-height: 200vh;
    padding-top: 12vh;
    padding-bottom: 6vh;
    justify-content: flex-start;
}

.coda-content {
    padding-top: 4vh;
}

.headline-coda {
    margin-bottom: 6rem;
}

.coda-body {
    max-width: 62ch;
    margin-bottom: 6rem;
}

.coda-body p {
    font-size: 19px;
    line-height: 1.75;
    color: var(--text-muted);
    margin-bottom: 1.8rem;
}

.coda-body p:last-child {
    margin-bottom: 0;
}

.coda-sign {
    max-width: 760px;
    border-top: 2px solid var(--steel-rule);
    padding-top: 2rem;
    margin-bottom: 8rem;
}

.sign-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(27, 58, 92, 0.5);
    align-items: center;
}

.sign-key {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-cyan);
}

.sign-val {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.05em;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 12px var(--accent-green);
    animation: status-pulse 2s ease-in-out infinite;
}

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

.coda-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--steel-rule);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.7;
}

/* =====================================================
   SCROLL RAIL — progress indicator
   ===================================================== */
.scroll-rail {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(27, 58, 92, 0.4);
    z-index: 99;
    pointer-events: none;
}

.scroll-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--aurora-gradient);
    background-size: 300% 100%;
    animation: gradient-shift 8s linear infinite;
    transition: width 0.1s ease-out;
}

/* =====================================================
   AURORA FLASH — on aurora-band entry
   ===================================================== */
.aurora-flash {
    position: fixed;
    inset: 0;
    background: var(--aurora-gradient);
    opacity: 0;
    pointer-events: none;
    z-index: 98;
    mix-blend-mode: overlay;
    transition: opacity 0.4s ease-out;
}

.aurora-flash.active {
    opacity: 0.05;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 720px) {
    .slab {
        padding: 80px 1.5rem 4rem;
        min-height: auto;
    }

    .slab-hero,
    .slab-coda {
        min-height: 100vh;
    }

    .slab-coda {
        min-height: 160vh;
    }

    .headline-mega {
        font-size: clamp(2.4rem, 12vw, 4.5rem);
    }

    .slab-index {
        font-size: clamp(6rem, 30vw, 12rem);
        top: 60px;
    }

    .crane-illustration,
    .apparatus-illustration,
    .blueprint-illustration {
        opacity: 0.2;
    }

    .apparatus-row,
    .ledger-row,
    .sign-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .ledger-row {
        grid-template-columns: 60px 1fr 60px;
    }

    .ledger-row span:nth-child(3) {
        grid-column: 1 / -1;
    }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .slab-content {
        filter: blur(0);
        opacity: 1;
    }

    .headline-line .char {
        opacity: 1;
        transform: none;
    }
}
