/* Palette: #0a0614 #12091e #23c4a0 #a8a0b8 #c423a0 #f0e8d8 #f5a623 */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #0a0614;
    color: #a8a0b8;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    overflow-x: hidden;
}

/* ===== SCANLINE OVERLAY ===== */
#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(255,255,255,0.015) 2px,
        rgba(255,255,255,0.015) 4px
    );
    z-index: 9999;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* ===== LENS FLARE ===== */
#lens-flare {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%,
        rgba(245, 166, 35, 0.6) 0%,
        rgba(196, 35, 160, 0.2) 40%,
        transparent 70%
    );
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transform: scale(1);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#lens-flare.active {
    opacity: 1;
    transform: scale(1.5);
}

/* ===== HUD OVERLAY ===== */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}

.hud-bracket {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.6;
}

.hud-bracket path {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: hudDraw 2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.top-left { top: 20px; left: 20px; }
.top-right { top: 20px; right: 20px; }
.bottom-left { bottom: 20px; left: 20px; }
.bottom-right { bottom: 20px; right: 20px; }

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

.hud-rule {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(245, 166, 35, 0.15);
}

.hud-rule-top { top: 10%; }
.hud-rule-bottom { top: 90%; }

.hud-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #f5a623;
    opacity: 0.7;
}

#hud-status {
    position: absolute;
    bottom: 30px;
    left: 70px;
}

#hud-section {
    position: absolute;
    top: 30px;
    right: 70px;
}

/* ===== BLOBS ===== */
#blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    filter: blur(60px);
    mix-blend-mode: screen;
    opacity: 0.5;
    will-change: transform;
}

.blob-amber {
    top: 10%;
    left: 15%;
    background: radial-gradient(ellipse, rgba(245, 166, 35, 0.6), transparent 70%);
    clip-path: polygon(30% 0%, 70% 5%, 95% 25%, 100% 55%, 85% 80%, 60% 100%, 25% 95%, 5% 70%, 0% 40%, 10% 15%);
    animation: blobDrift1 25s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.blob-teal {
    top: 30%;
    right: 10%;
    background: radial-gradient(ellipse, rgba(35, 196, 160, 0.6), transparent 70%);
    clip-path: polygon(25% 5%, 65% 0%, 90% 15%, 100% 45%, 95% 75%, 70% 95%, 35% 100%, 10% 80%, 0% 50%, 5% 20%);
    animation: blobDrift2 30s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

.blob-magenta {
    bottom: 10%;
    left: 30%;
    background: radial-gradient(ellipse, rgba(196, 35, 160, 0.5), transparent 70%);
    clip-path: polygon(20% 0%, 55% 5%, 85% 15%, 100% 40%, 95% 70%, 75% 95%, 45% 100%, 15% 90%, 0% 60%, 5% 25%);
    animation: blobDrift3 22s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
}

@keyframes blobDrift1 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, -25px); }
}

@keyframes blobDrift2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-25px, 30px); }
}

@keyframes blobDrift3 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

/* ===== CONTENT WRAPPER ===== */
#content-wrapper {
    position: relative;
    z-index: 1;
}

/* ===== SECTIONS ===== */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ===== BOOT SEQUENCE ===== */
#boot {
    flex-direction: column;
}

#boot-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    color: #f5a623;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.9;
}

/* ===== HERO ===== */
#hero-content {
    text-align: center;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#hero-content.visible {
    opacity: 1;
}

.hero-title {
    font-family: 'Architects Daughter', cursive;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 400;
    color: #f5a623;
    line-height: 1.15;
    letter-spacing: 0.03em;
    text-shadow: 0 0 60px rgba(245, 166, 35, 0.4), 0 0 120px rgba(245, 166, 35, 0.15);
}

.hero-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    color: #a8a0b8;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 1.5rem;
}

/* ===== MANIFESTO ===== */
#manifesto {
    height: 80px;
    background: #12091ed9;
    border-top: 1px solid rgba(245, 166, 35, 0.3);
    border-bottom: 1px solid rgba(245, 166, 35, 0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.manifesto-track {
    display: flex;
    white-space: nowrap;
    animation: marquee 25s linear infinite;
}

.manifesto-text {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    font-weight: 400;
    color: #f0e8d8;
    padding: 0 3rem;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===== PIECES (THREE SECTIONS) ===== */
.piece {
    min-height: 80vh;
    padding: 8rem 5vw;
    position: relative;
    overflow: hidden;
}

.piece-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    filter: blur(70px);
    opacity: 0.3;
    z-index: 0;
}

.piece-blob-1 {
    top: 10%;
    right: -5%;
    background: radial-gradient(ellipse, rgba(245, 166, 35, 0.5), transparent 70%);
    clip-path: polygon(30% 0%, 70% 5%, 95% 30%, 100% 60%, 80% 90%, 50% 100%, 20% 85%, 0% 55%, 5% 20%);
}

.piece-blob-2 {
    top: 15%;
    left: -5%;
    background: radial-gradient(ellipse, rgba(35, 196, 160, 0.5), transparent 70%);
    clip-path: polygon(25% 5%, 60% 0%, 90% 20%, 100% 50%, 90% 80%, 60% 100%, 25% 90%, 5% 65%, 0% 30%);
}

.piece-blob-3 {
    bottom: 5%;
    right: -5%;
    background: radial-gradient(ellipse, rgba(196, 35, 160, 0.5), transparent 70%);
    clip-path: polygon(20% 0%, 55% 5%, 85% 20%, 100% 45%, 95% 75%, 70% 100%, 35% 95%, 10% 75%, 0% 40%);
}

.piece-content {
    display: flex;
    gap: 4rem;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.piece-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.piece-main {
    flex: 6;
}

.piece-illustration {
    flex: 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.piece-heading {
    font-family: 'Architects Daughter', cursive;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    color: #f0e8d8;
    line-height: 1.15;
    letter-spacing: 0.03em;
    margin-bottom: 1.5rem;
}

.piece-body {
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    font-weight: 300;
    line-height: 1.75;
    color: #a8a0b8;
    margin-bottom: 1.2rem;
}

/* Puzzle SVGs */
.puzzle-svg {
    width: 100%;
    max-width: 200px;
}

.puzzle-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0.5;
}

.puzzle-path.drawn {
    stroke-dashoffset: 0;
}

/* ===== FLARE TRIGGERS ===== */
.flare-trigger {
    height: 1px;
    position: relative;
    z-index: 1;
}

/* ===== SIGNAL (FOOTER) ===== */
#signal {
    min-height: 60vh;
    flex-direction: column;
    background: linear-gradient(to bottom, #0a0614 0%, #000000 100%);
}

#signal-content {
    text-align: center;
}

.signal-title {
    font-family: 'Architects Daughter', cursive;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    color: #f0e8d8;
    line-height: 1.15;
    letter-spacing: 0.03em;
}

.signal-cursor {
    font-family: 'Share Tech Mono', monospace;
    font-size: 2rem;
    color: #f5a623;
    animation: cursorBlink 1s step-end infinite;
}

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

.signal-links {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a8a0b8;
    margin-top: 3rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.signal-sep {
    color: rgba(245, 166, 35, 0.4);
}

/* ===== SIGNAL FLICKER ===== */
#signal .signal-title,
#signal .signal-links {
    animation: hudFlicker 4s ease-in-out infinite;
}

@keyframes hudFlicker {
    0%, 92%, 94%, 96%, 100% { opacity: 1; transform: translateX(0); }
    93% { opacity: 0.6; transform: translateX(-1px); }
    95% { opacity: 0.8; transform: translateX(1px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .piece-content {
        flex-direction: column;
        gap: 2rem;
    }

    .piece-illustration {
        order: -1;
    }

    .blob {
        width: 350px;
        height: 350px;
    }
}
