/* gunsul.quest - The Build */

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

:root {
    --foundation-dark: #1A1612;
    --concrete-gray: #4A4540;
    --rebar-rust: #8B4E2A;
    --blueprint-cyan: #5BB8D4;
    --crane-gold: #D4A03C;
    --scaffold-silver: #9EA8A0;
    --concrete-white: #E8E0D4;
    --safety-orange: #E85D26;
    --oxidized-green: #7A8B6F;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    background-color: var(--foundation-dark);
    color: var(--concrete-white);
    overflow-x: hidden;
    line-height: 1.72;
}

/* Blueprint Grid Background */
#blueprint-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.5s ease;
    background-image:
        linear-gradient(60deg, rgba(91,184,212,0.08) 1px, transparent 1px),
        linear-gradient(-60deg, rgba(91,184,212,0.08) 1px, transparent 1px),
        linear-gradient(rgba(91,184,212,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91,184,212,0.04) 1px, transparent 1px);
    background-size: 48px 84px, 48px 84px, 24px 24px, 24px 24px;
}

#blueprint-grid.visible {
    opacity: 1;
}

/* Elevator Sidebar */
.elevator-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 56px;
    height: 100vh;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 22, 18, 0.9);
    border-right: 1px solid var(--concrete-gray);
}

.elevator-track {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.floor-marker {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--concrete-gray);
    transition: border-color 0.3s ease, color 0.3s ease;
}

.floor-marker span {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: var(--scaffold-silver);
    transition: color 0.3s ease;
}

.floor-marker.active {
    border-color: var(--crane-gold);
    animation: floorPulse 2s ease-in-out infinite;
}

.floor-marker.active span {
    color: var(--crane-gold);
}

@keyframes floorPulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 8px rgba(212, 160, 60, 0.3); }
}

/* Building Progress Indicator */
.building-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 50;
    opacity: 0.7;
}

.bldg-floor {
    transition: opacity 0.6s ease;
}

/* Floor Slab Dividers */
.floor-slab {
    position: relative;
    width: 100%;
    padding: 12px 80px;
    border-top: 4px solid var(--crane-gold);
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.floor-slab::before,
.floor-slab::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--crane-gold);
    position: absolute;
    top: 0;
}

.floor-slab::before { left: 20%; }
.floor-slab::after { right: 20%; }

.floor-number {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    color: var(--crane-gold);
    letter-spacing: 0.08em;
}

.floor-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    color: var(--scaffold-silver);
    letter-spacing: 0.15em;
}

/* ==================== HERO / EXCAVATION ==================== */
.phase {
    position: relative;
    min-height: 100vh;
    padding: 40px 80px;
    z-index: 2;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: 0.08em;
    color: var(--concrete-white);
    text-transform: uppercase;
    text-align: center;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
}

.hero-title .letter.revealed {
    animation: slideReveal 0.5s ease-out forwards;
}

@keyframes slideReveal {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hero-subtitle {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 1.5rem;
    color: var(--scaffold-silver);
    margin-top: 16px;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--crane-gold);
    width: 0;
}

.hero-subtitle.typing {
    animation: typing 1s steps(2) forwards, blinkCaret 0.7s step-end 4;
}

@keyframes typing {
    0% { width: 0; opacity: 1; }
    100% { width: 2.2em; opacity: 1; }
}

@keyframes blinkCaret {
    50% { border-color: transparent; }
}

/* ==================== CONTENT MODULES ==================== */
.module-row {
    display: flex;
    padding: 20px 0;
}

.content-module {
    background: rgba(74, 69, 64, 0.3);
    border: 2px solid var(--oxidized-green);
    padding: 32px;
    max-width: 520px;
    position: relative;
    opacity: 0;
    transform: translateY(-40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
}

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

.module-left {
    margin-right: auto;
}

.module-right {
    margin-left: auto;
}

.module-center {
    margin: 0 auto;
    max-width: 600px;
}

.module-tall {
    min-height: 220px;
}

.module-hook {
    position: absolute;
    top: -8px;
    left: 12px;
}

.module-code {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: var(--crane-gold);
    display: block;
    margin-bottom: 8px;
}

.module-header {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.08em;
    color: var(--concrete-white);
    margin-bottom: 12px;
}

.module-body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.72;
    color: var(--concrete-white);
    opacity: 0.85;
}

/* Border animate effect */
.border-animate {
    border-color: transparent;
}

.border-animate.visible {
    animation: borderDraw 1s ease forwards;
}

@keyframes borderDraw {
    0% { border-color: transparent; }
    25% { border-top-color: var(--oxidized-green); }
    50% { border-top-color: var(--oxidized-green); border-right-color: var(--oxidized-green); }
    75% { border-top-color: var(--oxidized-green); border-right-color: var(--oxidized-green); border-bottom-color: var(--oxidized-green); }
    100% { border-color: var(--oxidized-green); }
}

/* Phase-specific styling */
.phase-structure {
    background: linear-gradient(180deg, var(--foundation-dark) 0%, rgba(139,78,42,0.05) 100%);
}

.phase-envelope {
    position: relative;
}

.scaffolding-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(90deg, rgba(158,168,160,0.1) 0px, rgba(158,168,160,0.1) 1px, transparent 1px, transparent 48px),
        repeating-linear-gradient(0deg, rgba(158,168,160,0.1) 0px, rgba(158,168,160,0.1) 1px, transparent 1px, transparent 48px);
    opacity: 0.3;
    transition: opacity 0.5s ease;
    z-index: 0;
}

/* Material Strip */
.material-strip {
    width: 100%;
    height: 8px;
    margin: 40px 0;
}

.rebar-mesh {
    background-image:
        repeating-linear-gradient(45deg, var(--rebar-rust) 0px, var(--rebar-rust) 1px, transparent 1px, transparent 6px),
        repeating-linear-gradient(-45deg, var(--rebar-rust) 0px, var(--rebar-rust) 1px, transparent 1px, transparent 6px);
    opacity: 0.5;
}

/* Floor Counter */
.floor-counter {
    position: sticky;
    top: 20px;
    margin-left: 80px;
    margin-bottom: 30px;
    z-index: 5;
}

.counter-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: var(--blueprint-cyan);
}

.counter-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.5rem;
    color: var(--crane-gold);
    margin-left: 8px;
}

/* ==================== TOPPING OUT ==================== */
.phase-topping {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.topping-bloom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,160,60,0.15) 0%, transparent 70%);
    transition: width 2s ease, height 2s ease;
    pointer-events: none;
    z-index: 0;
}

.topping-bloom.active {
    width: 120vw;
    height: 120vw;
}

.topping-content {
    position: relative;
    z-index: 2;
}

.topping-date {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--crane-gold);
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.topping-message {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--scaffold-silver);
    letter-spacing: 0.2em;
    margin-bottom: 24px;
}

.final-mark {
    margin-top: 80px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.mark-text {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--crane-gold);
    display: block;
}

.mark-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: var(--scaffold-silver);
    display: block;
    margin-top: 4px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .elevator-sidebar {
        width: 4px;
        background: var(--concrete-gray);
        border: none;
    }

    .elevator-track {
        display: none;
    }

    .phase {
        padding: 40px 20px;
    }

    .floor-slab {
        padding: 12px 20px;
    }

    .module-left,
    .module-right {
        margin: 0 auto;
        max-width: 100%;
    }

    .floor-counter {
        margin-left: 20px;
    }

    .building-indicator {
        display: none;
    }
}
