/* ===================================
   sora.quest - Cyberpunk Terminal Quest
   =================================== */

/* --- CSS Variables --- */
:root {
    --void-black: #0a0e14;
    --neon-green: #4ae868;
    --neon-pink: #e84a8a;
    --dark-panel: #141e2a;
    --phosphor-white: #d0e8d4;
    --city-blue: #2a4a6a;
    --fade-gray: #5a6a7a;

    --font-terminal: 'Fira Code', monospace;
    --font-body: 'Inter', sans-serif;
    --font-display: 'Orbitron', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void-black);
    color: var(--phosphor-white);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--void-black);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
}

.terminal-prompt {
    font-family: var(--font-terminal);
    font-size: clamp(18px, 2.5vw, 32px);
    font-weight: 400;
    color: var(--neon-green);
    margin-bottom: 40px;
    text-shadow: 0 0 10px rgba(74, 232, 104, 0.5), 0 0 20px rgba(74, 232, 104, 0.3);
}

.prompt-prefix {
    color: var(--neon-green);
}

.cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: var(--neon-green);
}

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

.display-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(28px, 5vw, 56px);
    color: var(--phosphor-white);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    text-shadow: 0 0 30px rgba(74, 232, 104, 0.2);
}

.display-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.display-subtitle {
    font-family: var(--font-terminal);
    font-size: clamp(14px, 1.5vw, 20px);
    color: var(--fade-gray);
    margin-top: 16px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.display-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Skyline --- */
.skyline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 1;
}

#hero-skyline {
    background-color: transparent;
    height: 150px;
}

#hero-skyline::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background-color: var(--dark-panel);
    clip-path: polygon(
        0% 100%,
        0% 60%,
        2% 60%,
        2% 40%,
        4% 40%,
        4% 55%,
        6% 55%,
        6% 30%,
        8% 30%,
        8% 50%,
        10% 50%,
        10% 25%,
        12% 25%,
        12% 45%,
        14% 45%,
        14% 35%,
        16% 35%,
        16% 20%,
        18% 20%,
        18% 50%,
        20% 50%,
        20% 15%,
        22% 15%,
        22% 40%,
        24% 40%,
        24% 55%,
        26% 55%,
        26% 30%,
        28% 30%,
        28% 45%,
        30% 45%,
        30% 10%,
        32% 10%,
        32% 35%,
        34% 35%,
        34% 50%,
        36% 50%,
        36% 25%,
        38% 25%,
        38% 45%,
        40% 45%,
        40% 20%,
        42% 20%,
        42% 40%,
        44% 40%,
        44% 30%,
        46% 30%,
        46% 15%,
        48% 15%,
        48% 45%,
        50% 45%,
        50% 10%,
        52% 10%,
        52% 35%,
        54% 35%,
        54% 55%,
        56% 55%,
        56% 25%,
        58% 25%,
        58% 40%,
        60% 40%,
        60% 20%,
        62% 20%,
        62% 50%,
        64% 50%,
        64% 30%,
        66% 30%,
        66% 15%,
        68% 15%,
        68% 45%,
        70% 45%,
        70% 35%,
        72% 35%,
        72% 55%,
        74% 55%,
        74% 25%,
        76% 25%,
        76% 40%,
        78% 40%,
        78% 20%,
        80% 20%,
        80% 50%,
        82% 50%,
        82% 30%,
        84% 30%,
        84% 10%,
        86% 10%,
        86% 45%,
        88% 45%,
        88% 35%,
        90% 35%,
        90% 55%,
        92% 55%,
        92% 25%,
        94% 25%,
        94% 40%,
        96% 40%,
        96% 50%,
        98% 50%,
        98% 60%,
        100% 60%,
        100% 100%
    );
}

.skyline-mid {
    height: 80px;
}

.skyline-mid::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: var(--dark-panel);
    clip-path: polygon(
        0% 100%,
        0% 70%,
        5% 70%,
        5% 40%,
        8% 40%,
        8% 60%,
        12% 60%,
        12% 30%,
        15% 30%,
        15% 55%,
        20% 55%,
        20% 45%,
        25% 45%,
        25% 25%,
        28% 25%,
        28% 50%,
        35% 50%,
        35% 35%,
        40% 35%,
        40% 60%,
        45% 60%,
        45% 40%,
        50% 40%,
        50% 55%,
        55% 55%,
        55% 30%,
        60% 30%,
        60% 50%,
        65% 50%,
        65% 45%,
        70% 45%,
        70% 25%,
        75% 25%,
        75% 55%,
        80% 55%,
        80% 40%,
        85% 40%,
        85% 60%,
        90% 60%,
        90% 50%,
        95% 50%,
        95% 65%,
        100% 65%,
        100% 100%
    );
}

.skyline-bottom {
    height: 100px;
}

.skyline-bottom::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background-color: var(--city-blue);
    opacity: 0.3;
    clip-path: polygon(
        0% 100%,
        0% 50%,
        3% 50%,
        3% 30%,
        7% 30%,
        7% 55%,
        10% 55%,
        10% 20%,
        14% 20%,
        14% 45%,
        18% 45%,
        18% 35%,
        22% 35%,
        22% 15%,
        26% 15%,
        26% 50%,
        30% 50%,
        30% 40%,
        34% 40%,
        34% 60%,
        38% 60%,
        38% 25%,
        42% 25%,
        42% 50%,
        46% 50%,
        46% 35%,
        50% 35%,
        50% 55%,
        54% 55%,
        54% 20%,
        58% 20%,
        58% 45%,
        62% 45%,
        62% 30%,
        66% 30%,
        66% 50%,
        70% 50%,
        70% 15%,
        74% 15%,
        74% 40%,
        78% 40%,
        78% 55%,
        82% 55%,
        82% 35%,
        86% 35%,
        86% 50%,
        90% 50%,
        90% 45%,
        94% 45%,
        94% 60%,
        100% 60%,
        100% 100%
    );
}

.skyline-final {
    height: 120px;
}

.skyline-final::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to top, var(--dark-panel), transparent);
}

/* --- Z-Section Layout --- */
.z-section {
    position: relative;
    padding: 100px 5vw;
    overflow: hidden;
}

.z-row {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
}

.z-row-reverse {
    flex-direction: row-reverse;
}

.terminal-block,
.narrative-block {
    flex: 1;
    min-width: 0;
}

/* --- Glass Panel --- */
.glass-panel {
    background: rgba(20, 30, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(74, 232, 104, 0.2);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.glass-panel:hover {
    border-color: rgba(232, 74, 138, 0.4);
}

/* --- Panel Header (Terminal Window) --- */
.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(10, 14, 20, 0.6);
    border-bottom: 1px solid rgba(74, 232, 104, 0.1);
}

.panel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red {
    background-color: #e84a4a;
}

.dot-yellow {
    background-color: #e8c84a;
}

.dot-green {
    background-color: var(--neon-green);
}

.panel-title {
    font-family: var(--font-terminal);
    font-size: 13px;
    color: var(--fade-gray);
    margin-left: 8px;
}

/* --- Panel Body --- */
.panel-body {
    padding: 20px;
    flex: 1;
}

.terminal-line {
    font-family: var(--font-terminal);
    font-size: clamp(13px, 1.2vw, 16px);
    color: var(--phosphor-white);
    margin-bottom: 4px;
    line-height: 1.8;
}

.terminal-output {
    font-family: var(--font-terminal);
    font-size: clamp(12px, 1.1vw, 15px);
    color: var(--fade-gray);
    margin-bottom: 12px;
    padding-left: 20px;
    line-height: 1.6;
}

.terminal-ascii {
    font-family: var(--font-terminal);
    font-size: clamp(11px, 1vw, 14px);
    color: var(--neon-green);
    line-height: 1.4;
    margin: 12px 0;
    text-shadow: 0 0 8px rgba(74, 232, 104, 0.3);
}

.prompt-green {
    color: var(--neon-green);
}

.prompt-pink {
    color: var(--neon-pink);
}

.text-pink {
    color: var(--neon-pink);
}

/* --- Narrative Panel --- */
.narrative-panel {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.narrative-panel .panel-body {
    padding: 0;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(22px, 3vw, 36px);
    color: var(--phosphor-white);
    margin-bottom: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.body-text {
    font-family: var(--font-body);
    font-size: clamp(15px, 1.5vw, 18px);
    color: var(--phosphor-white);
    line-height: 1.75;
    margin-bottom: 16px;
}

.body-text:last-child {
    margin-bottom: 0;
}

.highlight-green {
    color: var(--neon-green);
    text-shadow: 0 0 8px rgba(74, 232, 104, 0.4);
}

.highlight-pink {
    color: var(--neon-pink);
    text-shadow: 0 0 8px rgba(232, 74, 138, 0.4);
}

/* --- Status Section --- */
.section-status {
    padding: 120px 5vw;
    text-align: center;
}

.status-container {
    max-width: 700px;
    margin: 0 auto;
}

.status-panel {
    padding: 40px;
    text-align: center;
}

.display-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(24px, 4vw, 42px);
    color: var(--phosphor-white);
    margin-bottom: 32px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: rgba(10, 14, 20, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(74, 232, 104, 0.1);
}

.status-label {
    font-family: var(--font-terminal);
    font-size: 12px;
    color: var(--fade-gray);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.status-value {
    font-family: var(--font-terminal);
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 700;
    color: var(--phosphor-white);
}

.status-prompt {
    margin-top: 24px;
    text-align: left;
    padding: 16px;
    background: rgba(10, 14, 20, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(74, 232, 104, 0.1);
}

/* --- Fade Reveal Animation --- */
.fade-reveal {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Neon Border Pulse on Hover --- */
.glass-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    box-shadow: 0 0 15px rgba(74, 232, 104, 0.15), inset 0 0 15px rgba(74, 232, 104, 0.05);
}

.glass-panel {
    position: relative;
}

.glass-panel:hover::after {
    opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .z-row,
    .z-row-reverse {
        flex-direction: column;
    }

    .z-section {
        padding: 60px 4vw;
    }

    .hero {
        height: 100svh;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .narrative-panel {
        padding: 24px;
    }

    .terminal-ascii {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .terminal-prompt {
        font-size: 16px;
    }

    .section-heading {
        font-size: 20px;
    }

    .display-heading {
        font-size: 22px;
    }
}
