/* === CSS Custom Properties === */
:root {
    /* Star Wars Yellow */
    --sw-yellow: #FFE81F;

    /* Tatooine Sunset Palette */
    --orange-warm: #E86A33;
    --orange-light: #FF9F45;
    --orange-glow: #FFB366;
    --purple-dusty: #C4A7B8;
    --purple-deep: #7A5980;
    --sand-light: #F5E6D3;
    --sand-medium: #DCC9B6;
    --sand-dark: #B8A088;
    --space-dark: #1A1A2E;
    --space-blue: #16213E;
    --space-mid: #0F3460;

    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Space Mono', monospace;

    /* Spacing */
    --section-padding: 80px 20px;
    --content-max-width: 700px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.8;
    color: var(--sand-light);
    background-color: #000;
    overflow-x: hidden;
}

/* === Typography === */
h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sw-yellow);
    margin-bottom: 40px;
    text-shadow: 0 0 30px rgba(255, 232, 31, 0.3);
}

h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

p {
    margin-bottom: 1.5em;
}

p:last-child {
    margin-bottom: 0;
}

em {
    font-style: italic;
    color: var(--orange-light);
}

/* === Text Variants === */
.highlight {
    color: var(--orange-warm);
    font-weight: 700;
    font-size: 1.1em;
}

.emphasis {
    font-size: 1.3em;
    color: var(--sw-yellow);
    font-style: italic;
    text-align: center;
    margin-top: 2em;
    text-shadow: 0 0 20px rgba(255, 232, 31, 0.3);
}

.aside {
    color: var(--sand-dark);
    font-size: 0.95em;
    font-style: italic;
}

.quote {
    font-size: 1.2em;
    font-style: italic;
    color: var(--purple-dusty);
    border-left: 3px solid var(--orange-warm);
    padding-left: 20px;
    margin-bottom: 2em;
}

.intro {
    font-size: 1.1em;
    color: var(--sand-medium);
    margin-bottom: 2em;
}

.signature {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--orange-light);
    margin-top: 40px;
    letter-spacing: 0.1em;
}

/* ========================================
   SECTION 1: THE CRAWL
   ======================================== */
.crawl-section {
    position: relative;
    height: 200vh; /* Scroll room for crawl */
    background: #000;
    overflow: hidden;
}

/* Starfield */
.crawl-section::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 20% 50%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 30% 30%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 60% 60%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 80% 80%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 90% 20%, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 15% 85%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 25% 15%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 35% 95%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 45% 45%, rgba(255,255,255,0.5), transparent),
        radial-gradient(2px 2px at 55% 25%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 65% 75%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 75% 5%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 85% 55%, rgba(255,255,255,0.5), transparent),
        radial-gradient(2px 2px at 95% 35%, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
    z-index: 0;
}

/* "A long time ago..." intro */
.crawl-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.crawl-intro.hidden {
    opacity: 0;
}

.intro-text {
    font-family: var(--font-body);
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #4fd5ff;
    letter-spacing: 0.05em;
}

/* The crawl container */
.crawl-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    perspective: 400px;
    perspective-origin: 50% 0;
    overflow: hidden;
    z-index: 1;
}

.crawl-content {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 80%;
    max-width: 800px;
    transform: translateX(-50%) rotateX(20deg);
    transform-origin: 50% 0;
    text-align: justify;
}

.crawl-text {
    font-family: var(--font-body);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 700;
    color: var(--sw-yellow);
    line-height: 1.8;
    margin-bottom: 1.5em;
    text-shadow: 0 0 5px rgba(255, 232, 31, 0.5);
}

.crawl-emphasis {
    font-size: clamp(1.4rem, 4vw, 2rem);
    margin-top: 2em;
}

/* Scroll indicator for crawl */
.crawl-section .scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    text-align: center;
    font-size: 0.85rem;
    color: var(--sand-dark);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: opacity 0.5s ease;
}

.crawl-section .scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--sand-dark);
    border-bottom: 2px solid var(--sand-dark);
    transform: rotate(45deg);
    margin: 15px auto 0;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: rotate(45deg) translateY(0); }
    40% { transform: rotate(45deg) translateY(10px); }
    60% { transform: rotate(45deg) translateY(5px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========================================
   FULL-BLEED SECTIONS (2-9)
   ======================================== */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--section-padding);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        rgba(0, 0, 0, 0.85) 100%
    );
    z-index: 1;
}

.section-content {
    position: relative;
    z-index: 2;
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto;
}

/* ========================================
   SECTION 8: CARGO HOLD (CARDS)
   ======================================== */
.cargo-options {
    display: grid;
    gap: 25px;
    margin-top: 30px;
}

.cargo-card {
    background: linear-gradient(
        135deg,
        rgba(15, 52, 96, 0.6) 0%,
        rgba(26, 26, 46, 0.8) 100%
    );
    border: 1px solid var(--space-mid);
    border-top: 3px solid var(--orange-warm);
    padding: 30px;
    border-radius: 0 0 8px 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.cargo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(232, 106, 51, 0.25);
    border-color: var(--orange-warm);
}

.cargo-card h3 {
    font-size: 1.1rem;
    color: var(--orange-light);
    margin-bottom: 15px;
    letter-spacing: 0.1em;
}

.cargo-card p {
    color: var(--sand-medium);
    margin-bottom: 0;
    line-height: 1.7;
}

/* ========================================
   FADE IN ANIMATIONS
   ======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px 20px;
        --content-max-width: 100%;
    }

    body {
        font-size: 15px;
    }

    h2 {
        margin-bottom: 30px;
    }

    .crawl-text {
        line-height: 1.6;
    }

    .section {
        min-height: auto;
        padding-top: 100px;
        padding-bottom: 100px;
    }

    .cargo-card {
        padding: 25px 20px;
    }

    .quote {
        font-size: 1.1em;
        padding-left: 15px;
    }

    .emphasis {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .crawl-content {
        width: 95%;
    }

    .intro-text {
        font-size: 0.9rem;
    }

    .crawl-section .scroll-indicator {
        bottom: 20px;
    }

    .highlight {
        font-size: 1em;
    }
}

/* ========================================
   SECTION-SPECIFIC OVERLAYS
   ======================================== */

/* The Hologram - slightly blue tint */
#hologram .section-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 20, 40, 0.5) 0%,
        rgba(0, 10, 30, 0.75) 50%,
        rgba(0, 0, 0, 0.9) 100%
    );
}

/* No Turning Back - darker, more dramatic */
#no-turning-back .section-overlay {
    background: linear-gradient(
        to bottom,
        rgba(20, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.8) 50%,
        rgba(0, 0, 0, 0.95) 100%
    );
}

/* The Jump - let hyperspace show through more */
#jump .section-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

#jump h2 {
    text-align: center;
}

#jump .section-content {
    text-align: center;
}

/* ========================================
   SECTION 12: P.S.
   ======================================== */
.ps-section {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 1) 0%,
        rgba(26, 26, 46, 0.95) 50%,
        rgba(0, 0, 0, 1) 100%
    );
    text-align: center;
    padding-top: 80px;
    padding-bottom: 100px;
}

.ps-section h2 {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    margin-bottom: 30px;
}

.willis-gif {
    max-width: 300px;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.ps-section p {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    color: var(--sand-medium);
}

.ps-section strong {
    color: var(--orange-light);
}
