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

html {
    scroll-behavior: smooth;
}

body {
    background: #0a0e1a;
    color: #a8b4c8;
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    overflow-x: hidden;
}

/* === SCAN LINE OVERLAY === */
#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2.5px,
        rgba(138, 148, 166, 0.06) 2.5px,
        rgba(138, 148, 166, 0.06) 3px
    );
    will-change: transform;
}

/* === NAVIGATION === */
#channel-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(10, 14, 26, 0.7);
    backdrop-filter: blur(8px);
}

.channel-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #8a94a6;
    background: transparent;
    color: #a8b4c8;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.channel-btn.active,
.channel-btn:hover {
    border-color: #ff9ec6;
    box-shadow: 0 0 12px rgba(255, 158, 198, 0.3);
    color: #ff9ec6;
}

/* === TYPOGRAPHY === */
.display-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(2.4rem, 6vw, 5.5rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 1.1;
    text-transform: uppercase;
    color: #a8b4c8;
    transition: letter-spacing 600ms ease, text-shadow 600ms ease, opacity 600ms ease;
}

.display-title:hover {
    letter-spacing: 0.18em;
    opacity: 0.85;
    text-shadow: 0 0 30px rgba(255, 158, 200, 0.3);
}

.mono-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    color: #c0a8d4;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* === HERO / LOBBY === */
.section-lobby {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #2a3048 0%, #0a0e1a 50%, #1a1228 100%);
    animation: heroBreathing 60s ease-in-out infinite;
}

@keyframes heroBreathing {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(10deg); }
}

.torus-hero {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 30% 30%, rgba(168, 180, 200, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 70%, rgba(192, 168, 212, 0.1) 0%, transparent 50%);
    opacity: 0.15;
    animation: torusRotate 20s linear infinite;
}

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

#site-title {
    opacity: 0;
    animation: fadeInTitle 3s ease forwards;
}

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

.lobby-subtitle {
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeInTitle 3s ease 1.5s forwards;
}

/* === SECTION BREAKS === */
.scan-break {
    width: 100%;
    height: 12px;
    position: relative;
    overflow: hidden;
}

.scan-break::before,
.scan-break::after {
    content: '';
    position: absolute;
    left: 0;
    width: 200%;
    height: 1px;
    background: linear-gradient(to right, transparent, #8a94a6, transparent);
    animation: scanSlide 8s linear infinite;
}

.scan-break::before { top: 2px; opacity: 0.6; }
.scan-break::after { top: 6px; opacity: 0.3; }

@keyframes scanSlide {
    from { transform: translateX(-50%); }
    to { transform: translateX(0); }
}

/* === GRID SECTIONS === */
.section-grid {
    padding: 4rem 2rem;
    background: #0a0e1a;
}

.grid-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2px;
}

/* === CARDS === */
.card {
    background: linear-gradient(135deg, #141b2d, #0a0e1a);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5), 0 2px 10px rgba(10, 14, 26, 0.8);
    transition: transform 600ms ease-out, box-shadow 600ms ease-out, background 600ms ease-out;
    opacity: 0;
    transform: translateY(30px);
}

.card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    transform: scale(1.02);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), 0 4px 30px rgba(255, 158, 198, 0.15);
    background: linear-gradient(135deg, #141b2d, #1a1228);
}

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

.card-svg {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8b4c8;
    margin-bottom: 0.5rem;
}

.card-desc {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    color: #c0a8d4;
    letter-spacing: 0.05em;
}

/* === INTERSTITIAL === */
.section-interstitial {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
    background: linear-gradient(135deg, #2a3048 0%, #0a0e1a 50%, #1a1228 100%);
}

.interstitial-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin-bottom: 3rem;
}

.interstitial-text {
    max-width: 600px;
    text-align: center;
    font-style: italic;
    color: #a8b4c8;
    line-height: 1.8;
}

.torus-medium {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 30% 30%, rgba(168, 180, 200, 0.3) 0%, transparent 50%);
    opacity: 0.3;
    top: 10%;
    right: 10%;
    animation: torusRotate 15s linear infinite;
}

/* === DEPARTURE === */
.section-departure {
    height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #0a0e1a;
}

.departure-title {
    opacity: 0.3;
}

#departure-timestamp {
    margin-top: 2rem;
}

/* === SVG ANIMATIONS === */
.reel-left, .reel-right {
    animation: reelSpin 8s linear infinite;
    transform-origin: center;
}

.reel-right {
    animation-direction: reverse;
}

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

.crt-screen {
    animation: crtFlicker 3s ease-in-out infinite;
}

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

.globe {
    stroke-dasharray: 240;
    animation: globeRotate 12s linear infinite;
}

@keyframes globeRotate {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: 240; }
}

/* === GLITCH === */
@keyframes glitch {
    0% { transform: translate(0, 0); text-shadow: none; }
    25% { transform: translate(2px, 0); text-shadow: -1px 0 cyan, 1px 0 magenta; }
    50% { transform: translate(-1px, 0); text-shadow: 1px 0 cyan, -1px 0 magenta; }
    100% { transform: translate(0, 0); text-shadow: none; }
}

body.glitch-active {
    animation: glitch 150ms linear;
}

/* === MOBILE CARD AMBIENT === */
@media (hover: none) {
    .card {
        animation: ambientGradient 20s ease infinite;
        background-size: 200% 200%;
    }

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

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .card-span-2 {
        grid-column: span 1;
    }

    .torus-hero {
        width: 280px;
        height: 280px;
    }
}
