/* sora.quest — terminal cyberpunk quest */

:root {
    --void: #0a0e14;
    --panel: #141e2a;
    --neon: #4ae868;
    --pink: #e84a8a;
    --phos: #d0e8d4;
    --city: #2a4a6a;
    --fade: #5a6a7a;
}

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

html, body {
    background: var(--void);
    color: var(--phos);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

body {
    position: relative;
    background:
        radial-gradient(ellipse at 18% 22%, rgba(74, 232, 104, 0.06), transparent 55%),
        radial-gradient(ellipse at 82% 78%, rgba(232, 74, 138, 0.06), transparent 50%),
        var(--void);
}

/* CRT scanlines */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(
        to bottom,
        rgba(74, 232, 104, 0.03) 0,
        rgba(74, 232, 104, 0.03) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: screen;
    opacity: 0.6;
}

/* City skyline silhouette */
.city-skyline {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: -1;
    background: var(--panel);
    clip-path: polygon(
        0 100%,
        0 60%,
        4% 60%, 4% 30%, 8% 30%, 8% 55%,
        12% 55%, 12% 18%, 17% 18%, 17% 50%,
        22% 50%, 22% 38%, 27% 38%, 27% 22%, 31% 22%, 31% 48%,
        36% 48%, 36% 12%, 41% 12%, 41% 30%, 46% 30%, 46% 52%,
        52% 52%, 52% 24%, 57% 24%, 57% 42%, 62% 42%, 62% 18%,
        67% 18%, 67% 50%, 72% 50%, 72% 32%, 77% 32%, 77% 56%,
        82% 56%, 82% 28%, 87% 28%, 87% 46%, 92% 46%, 92% 60%,
        96% 60%, 96% 38%, 100% 38%, 100% 100%
    );
    opacity: 0.7;
}

.city-skyline::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 80%, rgba(74, 232, 104, 0.18), transparent 35%),
                radial-gradient(circle at 70% 75%, rgba(232, 74, 138, 0.15), transparent 30%);
    mix-blend-mode: screen;
}

/* HERO ============================================ */
.hero {
    min-height: 100vh;
    padding: clamp(28px, 5vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(24px, 4vw, 48px);
    position: relative;
}

/* Terminal shell window */
.terminal-shell {
    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;
    max-width: 640px;
    box-shadow: 0 0 0 1px rgba(74, 232, 104, 0.08), 0 0 32px rgba(74, 232, 104, 0.10);
    overflow: hidden;
    transition: border-color 240ms ease, box-shadow 240ms ease;
}

.terminal-shell:hover {
    border-color: rgba(232, 74, 138, 0.3);
    box-shadow: 0 0 0 1px rgba(232, 74, 138, 0.18), 0 0 32px rgba(232, 74, 138, 0.15);
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(10, 14, 20, 0.6);
    border-bottom: 1px solid rgba(74, 232, 104, 0.12);
}

.term-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}
.dot-r { background: #ff5f56; }
.dot-y { background: #ffbd2e; }
.dot-g { background: var(--neon); }

.term-name {
    margin-left: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: var(--fade);
    letter-spacing: 0.04em;
}

.term-body {
    padding: 18px 22px 22px;
    font-family: 'Fira Code', monospace;
    font-size: clamp(14px, 1.4vw, 16px);
    line-height: 1.7;
}

.term-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--phos);
}

.term-line.out {
    color: var(--fade);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.term-line.out.show {
    opacity: 1;
    transform: translateY(0);
}

.prompt {
    color: var(--neon);
    font-weight: 500;
}

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

.cursor {
    display: inline-block;
    color: var(--neon);
    animation: blink 1s steps(2) infinite;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Hero display title */
.hero-display {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 5vw, 56px);
    letter-spacing: 0.06em;
    color: var(--phos);
    text-shadow: 0 0 16px rgba(74, 232, 104, 0.45), 0 0 40px rgba(74, 232, 104, 0.18);
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 700ms ease 1.6s, transform 700ms ease 1.6s;
}

.hero-display.show {
    opacity: 1;
    transform: translateY(0);
}

.hero-tagline {
    font-family: 'Fira Code', monospace;
    font-size: clamp(14px, 1.4vw, 17px);
    color: var(--fade);
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 600ms ease 1.9s;
}

.hero-tagline.show { opacity: 1; }

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    opacity: 0;
    transition: opacity 600ms ease 2.1s;
}

.hero-meta.show { opacity: 1; }

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(20, 30, 42, 0.7);
    border: 1px solid rgba(74, 232, 104, 0.2);
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
}

.meta-key {
    color: var(--fade);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.meta-val {
    color: var(--neon);
    font-weight: 500;
}

.meta-val.pulse {
    color: var(--pink);
    animation: pulse 1.6s ease-in-out infinite;
}

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

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

/* Z-PATTERN sections =============================== */
main {
    padding: clamp(40px, 6vw, 96px) clamp(20px, 4vw, 72px);
    display: flex;
    flex-direction: column;
    gap: clamp(60px, 8vw, 120px);
}

.z-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 60px);
    align-items: stretch;
}

.z-section.z-right {
    direction: rtl;
}

.z-section.z-right > .z-block {
    direction: ltr;
}

.z-block {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.z-block.show {
    opacity: 1;
    transform: translateY(0);
}

.block-tag {
    display: inline-block;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--neon);
    margin-bottom: 14px;
}

.block-tag.pink { color: var(--pink); }

/* Terminal-aesthetic block (left side) */
.term-block {
    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: 6px;
    padding: clamp(20px, 2.4vw, 36px);
    transition: border-color 240ms ease;
}

.term-block:hover {
    border-color: rgba(232, 74, 138, 0.3);
}

.term-out {
    font-family: 'Fira Code', monospace;
    font-size: clamp(12px, 1.2vw, 14px);
    color: var(--phos);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Narrative panel (right side) */
.narrative-panel {
    background: rgba(20, 30, 42, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(232, 74, 138, 0.25);
    border-radius: 6px;
    padding: clamp(24px, 2.8vw, 44px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: border-color 240ms ease;
}

.narrative-panel:hover {
    border-color: rgba(74, 232, 104, 0.3);
}

.z-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: clamp(20px, 2.4vw, 32px);
    line-height: 1.2;
    color: var(--phos);
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.narrative-panel p {
    color: var(--phos);
    opacity: 0.9;
    margin-bottom: 12px;
}

.quest-list {
    list-style: none;
    margin-top: 8px;
}

.quest-list li {
    display: flex;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(74, 232, 104, 0.15);
    color: var(--phos);
}

.quest-list li:last-child { border-bottom: 0; }

.q-num {
    font-family: 'Fira Code', monospace;
    color: var(--neon);
    font-size: 13px;
    min-width: 30px;
}

/* Exit panel */
.exit-panel {
    display: flex;
    justify-content: center;
}

.exit-card {
    max-width: 720px;
    width: 100%;
    border-color: rgba(232, 74, 138, 0.3);
}

/* FOOTER =========================================== */
.footer {
    padding: 32px clamp(20px, 4vw, 72px) 28px;
    border-top: 1px solid rgba(74, 232, 104, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    background: rgba(10, 14, 20, 0.85);
    position: relative;
    z-index: 2;
}

.footer-left {
    display: flex;
    flex-direction: column;
}

.foot-mark {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    letter-spacing: 0.08em;
    color: var(--neon);
}

.foot-line {
    color: var(--fade);
    margin-top: 4px;
}

.footer-right {
    display: flex;
    gap: 14px;
    align-items: baseline;
}

.foot-cmd {
    color: var(--pink);
}

.foot-up {
    color: var(--phos);
}

/* Responsive ======================================= */
@media (max-width: 800px) {
    .z-section {
        grid-template-columns: 1fr;
    }
    .z-section.z-right { direction: ltr; }
    .hero-display { font-size: clamp(28px, 9vw, 48px); }
}
