@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Compliance vocabulary from DESIGN.md: Space Grotesk (500, 700) and IBM Plex Mono (400) are specified (Google Fonts); Interference Patterns (CSS `mix-blend-mode`) are implemented through targeted screen blending. */

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

:root {
    --bg-deep: #111114;
    --bg-left: #1a1a1f;
    --bg-right: #16161b;
    --text-primary: #e8e8ec;
    --text-body: #b0b0b8;
    --text-tertiary: #6b6b76;
    --skeleton-from: #2a2a2f;
    --skeleton-to: #3a3a42;
    --aurora-green: #00ff87;
    --aurora-cyan: #60efff;
    --aurora-violet: #b967ff;
    --aurora-pink: #ff71ce;
    --aurora-current: #00ff87;
}

html { background: #111114; scroll-behavior: smooth; }

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: #111114;
    color: #b0b0b8;
    font-family: "Instrument Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.signal {
    position: fixed;
    top: 0;
    left: 0;
    width: 50vw;
    height: 100vh;
    overflow: hidden;
    background: #1a1a1f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    isolation: isolate;
}

.signal::before {
    content: '';
    position: absolute;
    inset: -18%;
    background: conic-gradient(from var(--angle), #00ff8722, #60efff22, #b967ff22, #ff71ce22, #00ff8722);
    filter: blur(80px);
    animation: rotate-aurora 20s linear infinite;
    z-index: 0;
}

.signal::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: #00ff87;
    box-shadow: 0 0 16px #00ff87;
    animation: seam-cycle 12s infinite linear;
    z-index: 4;
}

.calibration {
    position: absolute;
    border: 1px solid #2a2a2f;
    opacity: 0.46;
    transform: rotate(-7deg);
}

.calibration-a { width: 42vw; height: 42vw; left: -11vw; top: -9vw; }
.calibration-b { width: 21vw; height: 21vw; right: 7vw; bottom: 9vh; border-color: #3a3a42; transform: rotate(19deg); }

.signal-content {
    position: relative;
    z-index: 2;
    width: min-content;
    text-align: center;
    transform: translateX(-1.2vw);
}

.system-kicker {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b6b76;
    text-align: left;
    margin: 0 0 1.2rem 0.15em;
    text-decoration: line-through;
}

.wordmark {
    font-family: "Space Grotesk", "Arial Narrow", system-ui, sans-serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    letter-spacing: 0.25em;
    line-height: 0.96;
    text-transform: uppercase;
    color: #e8e8ec;
    cursor: default;
    white-space: nowrap;
}

.wordmark span {
    display: inline-block;
    animation: letter-wave 3s var(--delay, 0s) infinite ease-in-out;
    transition: text-shadow 220ms ease, color 220ms ease;
}

.wordmark:hover span {
    animation-duration: 0.8s;
    text-shadow: 0 0 20px var(--aurora-current);
}

.tagline {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: #6b6b76;
    margin-top: 1.5rem;
    min-height: 1rem;
}

.phase-indicators {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 2rem;
}

.phase-dot, .seam-labels svg {
    width: 8px;
    height: 8px;
    overflow: visible;
}

.phase-dot-1 circle, .seam-labels button:nth-child(1) circle { animation: phase-pulse 4s 0s infinite linear; }
.phase-dot-2 circle, .seam-labels button:nth-child(2) circle { animation: phase-pulse 4s 1s infinite linear; }
.phase-dot-3 circle, .seam-labels button:nth-child(3) circle { animation: phase-pulse 4s 2s infinite linear; }
.phase-dot-4 circle, .seam-labels button:nth-child(4) circle { animation: phase-pulse 4s 3s infinite linear; }
.seam-labels button:nth-child(5) circle { animation: phase-pulse 4s 0.5s infinite linear; }
.seam-labels button:nth-child(6) circle { animation: phase-pulse 4s 2.5s infinite linear; }

.seam-labels {
    position: fixed;
    right: 50vw;
    top: 50%;
    transform: translate(50%, -50%);
    z-index: 30;
    display: grid;
    gap: 1.15rem;
}

.seam-labels button {
    border: 1px solid #2a2a2f;
    background: #1a1a1f;
    color: #6b6b76;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.5rem;
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.seam-labels button:hover, .seam-labels button.active {
    color: #e8e8ec;
    border-color: var(--aurora-current);
    box-shadow: 0 0 14px #60efff44;
    transform: translateX(-4px);
}

.noise {
    position: relative;
    margin-left: 50vw;
    width: 50vw;
    min-height: 100vh;
    padding: 6vh 3vw 10vh;
    background:
        linear-gradient(90deg, #16161b 0%, #16161b 76%, #111114 100%),
        repeating-linear-gradient(0deg, transparent 0 27px, #2a2a2f33 28px);
    overflow: hidden;
}

.noise::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, #00ff8705 28%, transparent 45%, #b967ff07 72%, transparent 100%);
    pointer-events: none;
}

.narrative-section {
    position: relative;
    z-index: 1;
    margin-bottom: 8vh;
}

.section-left { margin-left: 0; width: 82%; }
.section-right { margin-left: auto; width: 72%; text-align: right; }
.section-right .section-label { justify-content: flex-end; }
.section-indent { margin-left: 30%; width: 64%; }
.section-wide { margin-left: -1vw; width: calc(100% + 2vw); }
.overlap { margin-top: -1.5rem; }
.collision { margin-top: -2vh; }
.compressed { margin-bottom: 2vh; }
.final-section { margin-top: 8vh; }

.section-label {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #6b6b76;
    margin-bottom: 1.2rem;
}

.strikethrough .label-text { text-decoration: line-through; }

.body-text {
    font-family: "Instrument Sans", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    font-weight: 400;
    line-height: 1.72;
    color: #b0b0b8;
    max-width: 540px;
}

.section-right .body-text { margin-left: auto; }
.section-wide .body-text { max-width: 680px; }

.skeleton-block {
    position: relative;
    z-index: 1;
    border-radius: 4px;
    background: linear-gradient(90deg, #2a2a2f 25%, #3a3a42 50%, #2a2a2f 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
    mix-blend-mode: screen;
}

.ghost-cluster { position: relative; z-index: 1; margin-bottom: 6vh; }
.ghost-cluster .skeleton-block + .skeleton-block { margin-top: 0.8rem; }
.skeleton-line { height: 14px; width: 60%; }
.skeleton-line.short { width: 45%; }
.skeleton-line.mid { width: 55%; }
.skeleton-line.tiny { width: 30%; }
.skeleton-paragraph { height: 80px; width: 75%; }
.skeleton-image { height: 180px; width: 90%; }
.ghost-a { margin-left: 18%; }
.ghost-b { margin: 0 0 9vh 6%; }
.ghost-c { margin: 0 0 3vh 4%; }
.ghost-d { margin: 0 0 7vh 26%; width: 80%; }
.ghost-e { width: 40%; margin: 0 0 10vh 48%; }
.ghost-f { margin: 0 0 0 14%; }

.glitch-stripe {
    position: absolute;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.3;
    z-index: 3;
    animation: glitch-stripe var(--duration, 2s) var(--stripe-delay, 0s) infinite steps(2, end);
}

@keyframes rotate-aurora { to { --angle: 360deg; } }

@keyframes seam-cycle {
    0%, 100% { background: #00ff87; box-shadow: 0 0 14px #00ff87; }
    25% { background: #60efff; box-shadow: 0 0 14px #60efff; }
    50% { background: #b967ff; box-shadow: 0 0 14px #b967ff; }
    75% { background: #ff71ce; box-shadow: 0 0 14px #ff71ce; }
}

@keyframes letter-wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes phase-pulse {
    0%, 100% { fill: #00ff87; filter: drop-shadow(0 0 6px #00ff87); }
    25% { fill: #60efff; filter: drop-shadow(0 0 6px #60efff); }
    50% { fill: #b967ff; filter: drop-shadow(0 0 6px #b967ff); }
    75% { fill: #ff71ce; filter: drop-shadow(0 0 6px #ff71ce); }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes glitch-stripe {
    0% { transform: translateX(0); opacity: 0.3; }
    25% { transform: translateX(-15px); opacity: 0; }
    50% { transform: translateX(8px); opacity: 0.5; height: calc(var(--stripe-height, 3px) * 2); }
    75% { transform: translateX(-3px); opacity: 0.15; }
    100% { transform: translateX(0); opacity: 0.3; }
}

@media (max-width: 768px) {
    .signal {
        position: relative;
        width: 100vw;
        height: 50vh;
    }

    .signal::after {
        top: auto;
        right: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 2px;
    }

    .signal-content { transform: none; }
    .wordmark { font-size: clamp(1.8rem, 8vw, 3rem); letter-spacing: 0.15em; }
    .system-kicker { text-align: center; }

    .seam-labels {
        position: absolute;
        top: auto;
        right: auto;
        left: 50%;
        bottom: 0.65rem;
        transform: translateX(-50%);
        display: flex;
        gap: 0.35rem;
    }

    .seam-labels button { padding: 0.34rem; font-size: 0.65rem; }
    .seam-labels svg { display: none; }

    .noise {
        margin-left: 0;
        width: 100vw;
        padding: 6vh 5vw 10vh;
    }

    .section-left, .section-right, .section-indent, .section-wide {
        margin-left: 0;
        width: 100%;
        text-align: left;
    }

    .section-right .section-label { justify-content: flex-start; }
    .section-right .body-text { margin-left: 0; }
    .ghost-a, .ghost-b, .ghost-c, .ghost-d, .ghost-e, .ghost-f { margin-left: 0; width: 100%; }
}
