/* ─────────────────────────────────────────────────────────────────────────
   Gedeelde stijl voor de missiepagina's (mission-001 t/m mission-004).

   Bevat de chrome (scanlines, pixelregen, topbar, hero, footer) en de
   componenten die meerdere missies gebruiken: secties, obstakels,
   principes, inzichten, tijdlijn, cijfers, screenshots en de lightbox.

   Wat alleen op één pagina voorkomt staat in die pagina zelf, net als
   --thumb: die kleur verschilt per missie.
   ───────────────────────────────────────────────────────────────────────── */


:root {
    --bg:        #0d0d0f;
    --bg2:       #13131a;
    --panel:     #1a1a26;
    --border:    #2a2a3d;
    --orange:    #ff7a1a;
    --orange-dim:#7a3800;
    --blue:      #3a8fff;
    --blue-dim:  #0e2a55;
    --green:     #3dffa0;
    --green-dim: #0a3320;
    --text:      #c8c8d4;
    --text-dim:  #8a8ab0;
    --white:     #e8e8f0;
    --scanline:  rgba(0,0,0,0.045);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'VT323', monospace;
    font-size: 20px;
    min-height: 100vh;
    overflow-x: hidden;
    image-rendering: pixelated;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        var(--scanline) 0px,
        var(--scanline) 1px,
        transparent 1px,
        transparent 3px
    );
    animation: scanRoll 30s linear infinite;
}

@keyframes scanRoll {
    0%   { background-position-y: 0; }
    100% { background-position-y: 100px; }
}

@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
}

.pixel-bg {
    position: fixed; inset: 0; z-index: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 32px 32px; opacity: 0.18;
}

.pixel-rain {
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none; overflow: hidden;
}

.px {
    position: absolute; width: 4px; height: 4px;
    animation: pixelFall linear infinite;
}

@keyframes pixelFall {
    0%   { transform: translateY(-10px); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 0.6; }
    100% { transform: translateY(110vh); opacity: 0; }
}

.xp-bar-wrap {
    height: 4px; background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
}
.xp-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--orange), var(--blue));
    transition: width 0.1s;
}

main {
    position: relative; z-index: 1;
    max-width: 900px; margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

/* ── TOPBAR ── */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    border: 2px solid var(--border); background: var(--panel);
    padding: 0.6rem 1.2rem; margin-bottom: 2rem;
    box-shadow: 4px 4px 0 var(--border);
}
.topbar-brand {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.55rem; color: var(--orange); letter-spacing: 0.05em;
}
.topbar-status {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem; color: var(--text-dim);
}
.lang-switch {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: 0.6rem;
}
.lang-switch span, .lang-switch a {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem; padding: 3px 6px;
}
.lang-current { color: var(--white); border: 1px solid var(--text-dim); }
.lang-sep { color: var(--text-dim); padding: 0 !important; }
.lang-link {
    color: var(--text-dim); text-decoration: none;
    border: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s;
}
.lang-link:hover { color: var(--orange); border-color: var(--orange); }
.status-dot {
    width: 8px; height: 8px; background: #3dffa0;
    display: inline-block; animation: blink 1.2s step-end infinite;
    box-shadow: 0 0 6px #3dffa0;
}
@keyframes blink {
    0%, 100% { opacity: 1; } 50% { opacity: 0; }
}

/* ── BUTTONS ── */
.btn {
    display: inline-block; font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem; padding: 0.6rem 1rem; border: 2px solid;
    cursor: pointer; text-decoration: none;
    transition: box-shadow 0.05s, transform 0.05s;
    background: var(--panel);
}
.btn-blue { color: var(--blue); border-color: var(--blue); box-shadow: 3px 3px 0 var(--blue-dim); }
.btn-blue:hover { box-shadow: none; transform: translate(3px,3px); background: var(--blue-dim); }

/* ── MISSION HERO ── */
.mission-hero {
    border: 2px solid var(--border);
    margin-bottom: 2rem;
    box-shadow: 6px 6px 0 var(--orange-dim);
    overflow: hidden;
}

.hero-thumb {
    background: var(--thumb);
    height: 200px;
    display: flex; align-items: center; justify-content: center;
    font-size: 5rem;
    position: relative;
    overflow: hidden;
}

.hero-thumb::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.2) 1px, transparent 1px);
    background-size: 16px 16px;
}

.hero-thumb-icon { position: relative; z-index: 1; filter: drop-shadow(0 0 20px rgba(0,0,0,0.8)); }

/* Banner-variant: eigen artwork i.p.v. emoji + raster */
.hero-thumb--image {
    height: auto;
    aspect-ratio: 2060 / 680;
    background: #0a1526;
}

.hero-thumb--image::after { content: none; }

.hero-thumb--image img {
    display: block;
    width: 100%; height: 100%;
    object-fit: cover;
    image-rendering: auto;
}

.hero-info {
    background: var(--bg2);
    padding: 1.2rem 1.5rem;
    border-top: 2px solid var(--border);
}

.hero-meta {
    display: flex; align-items: center; gap: 0.8rem;
    flex-wrap: wrap; margin-bottom: 0.6rem;
}

.hero-number {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.4rem; color: var(--text-dim);
}

.badge-done {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.35rem; color: var(--green);
    border: 1px solid var(--green);
    padding: 2px 6px;
}

.badge-stars {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.35rem; color: var(--orange);
    border: 1px solid var(--orange-dim);
    padding: 2px 6px;
}

.badge-xp {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.38rem; color: var(--orange);
    margin-left: auto;
}

.hero-title {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.6rem, 2.2vw, 0.85rem);
    color: var(--white); line-height: 1.7;
    margin-bottom: 0.8rem;
}

.hero-sub {
    font-size: 1.1rem; color: var(--text);
    line-height: 1.6; max-width: 60ch;
}

/* ── QUICK STATS ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    border: 2px solid var(--border);
    background: var(--panel);
    box-shadow: 3px 3px 0 var(--border);
    padding: 0.8rem 1rem;
}

.stat-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.32rem; color: var(--text-dim);
    margin-bottom: 0.5rem; letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1rem; color: var(--white); line-height: 1.5;
}

/* ── CONTENT SECTIONS ── */
.section {
    border: 2px solid var(--border);
    background: var(--panel);
    box-shadow: 4px 4px 0 var(--border);
    margin-bottom: 1.5rem;
}

.section-header {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.45rem;
    color: var(--orange);
    padding: 0.6rem 1.2rem;
    border-bottom: 2px solid var(--border);
    background: var(--bg2);
    letter-spacing: 0.05em;
}

.section-header.blue { color: var(--blue); }
.section-header.green { color: var(--green); }

.section-body {
    padding: 1.2rem 1.5rem;
}

.section-body h3 {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem; color: var(--white);
    line-height: 1.6; margin-bottom: 0.8rem;
}

.section-lede {
    font-size: 1.15rem; color: var(--white);
    line-height: 1.7; margin-bottom: 1rem;
}

.section-text {
    font-size: 1.05rem; color: var(--text); line-height: 1.7;
    margin-bottom: 1rem;
}
.section-text:last-child { margin-bottom: 0; }

/* ── PRINCIPLES ── */
.principles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.2rem;
}

.principle {
    border: 2px solid var(--border);
    border-left: 3px solid var(--green);
    background: var(--bg);
    padding: 1rem;
    box-shadow: 3px 3px 0 var(--green-dim);
}

.principle-num {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.32rem;
    color: var(--green);
    margin-bottom: 0.6rem;
    letter-spacing: 0.05em;
}

.principle-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem;
    color: var(--white);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.principle-text {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.6;
}

/* ── CHALLENGES ── */
.challenges { display: flex; flex-direction: column; gap: 0.8rem; }

.challenge {
    border: 1px solid var(--orange-dim);
    border-left: 3px solid var(--orange);
    padding: 0.9rem 1.1rem;
    background: var(--bg);
}

.challenge-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.42rem; color: var(--orange);
    margin-bottom: 0.5rem; line-height: 1.5;
}

.challenge-title::before { content: '⚠ '; }

.challenge-text {
    font-size: 1.05rem; color: var(--text); line-height: 1.6;
}

/* ── ACHIEVEMENT CALLOUT ── */
.achievement {
    border: 2px solid var(--orange);
    background: linear-gradient(180deg, rgba(255,122,26,0.08), transparent);
    padding: 1.2rem 1.4rem;
    margin: 1.2rem 0;
    box-shadow: 4px 4px 0 var(--orange-dim);
}

.achievement-tag {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.38rem;
    color: var(--orange);
    letter-spacing: 0.05em;
    margin-bottom: 0.7rem;
}
.achievement-tag::before { content: '★ '; }

.achievement-quote {
    font-size: 1.15rem;
    color: var(--white);
    font-style: italic;
    line-height: 1.6;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    align-items: start;
}

/* ── SCREENSHOTS ── */
.shot {
    display: block;
    text-decoration: none;
    color: inherit;
}

.shot-frame {
    display: block;
    border: 2px solid var(--border);
    background: var(--bg);
    box-shadow: 3px 3px 0 var(--border);
    overflow: hidden;
    transition: box-shadow 0.12s steps(2), transform 0.12s steps(2);
}

.shot:hover .shot-frame,
.shot:focus-visible .shot-frame {
    border-color: var(--blue);
    box-shadow: 5px 5px 0 var(--blue-dim);
    transform: translate(-2px, -2px);
}

/* height:auto is nodig, anders wint het height-attribuut van de
   img van de aspect-ratio */
.shot-frame img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: top center;
    image-rendering: auto;
}

.shot-caption {
    display: block;
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}
.shot-caption::before { content: '> '; color: var(--green); }
.shot:hover .shot-caption { color: var(--text); }

.shot-hint {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 1.2rem;
}

/* ── LIGHTBOX ── */
.lb {
    position: fixed; inset: 0; z-index: 10000;
    display: none;
    background: #06060a;
    padding: 3.5rem 1rem 1rem;
}
.lb.open { display: flex; flex-direction: column; }

.lb-stage {
    flex: 1; min-height: 0;
    display: flex; align-items: center; justify-content: center;
    gap: 1rem;
}

.lb-scroll {
    flex: 1 1 auto;
    min-width: 0;
    align-self: stretch;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-img {
    max-width: 100%; max-height: 100%;
    border: 2px solid var(--border);
    box-shadow: 6px 6px 0 var(--blue-dim);
    image-rendering: auto;
}

.lb-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    padding: 0.9rem 0.2rem 0.2rem;
}

.lb-caption { font-size: 1rem; color: var(--text); }
.lb-caption::before { content: '> '; color: var(--green); }

.lb-meta {
    display: flex; align-items: center; gap: 1.2rem;
    flex-shrink: 0;
}

.lb-count {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.45rem; color: var(--text-dim);
    white-space: nowrap;
}

.lb-orig {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.45rem; color: var(--blue);
    text-decoration: none; white-space: nowrap;
}
.lb-orig:hover { color: var(--orange); }

/* Bewust géén Press Start 2P: die font bevat de pijl- en kruisjes-
   tekens niet, waardoor ze op een piepkleine fallback uitkwamen. */
.lb-btn {
    font-size: 1rem;
    line-height: 1;
    color: var(--text); background: var(--bg2);
    border: 2px solid var(--border);
    width: 2.4rem; height: 3rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.1s, border-color 0.1s, background 0.1s;
}
.lb-btn:hover {
    color: var(--orange);
    border-color: var(--orange);
    background: var(--panel);
}

.lb-close {
    position: absolute; top: 0.9rem; right: 1rem;
    width: 2.4rem; height: 2.4rem;
    font-size: 0.95rem;
}

.lb-hint {
    position: absolute; top: 1.3rem; left: 1rem;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.5rem; color: var(--text-dim);
}

/* ── LIGHTBOX OP MOBIEL ── */
@media (max-width: 600px) {
    .lb-hint { display: none; }

    .lb { padding: 3.2rem 0.6rem 4.4rem; }
    .lb-close { top: 0.6rem; right: 0.6rem; }

    .lb-stage { gap: 0; }
    .lb-nav {
        position: absolute;
        bottom: 0.7rem;
        height: 2.6rem;
        z-index: 3;
    }
    .lb-nav-prev { left: 0.7rem; }
    .lb-nav-next { right: 0.7rem; }

    .lb-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
    }
}

/* ── TIMELINE ── */
.timeline {
    display: flex;
    flex-direction: column;
    padding-left: 1.6rem;
    position: relative;
}

.tl-item {
    position: relative;
    padding-bottom: 1.4rem;
    padding-left: 0.4rem;
}
.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 8px;
    bottom: -0.5rem;
    width: 2px;
    background: var(--border);
}
.tl-item:last-child::before { display: none; }

.tl-dot {
    position: absolute;
    left: -1.4rem;
    top: 4px;
    width: 10px;
    height: 10px;
    background: var(--bg);
    border: 2px solid var(--text-dim);
    z-index: 1;
}
.tl-dot.done { background: var(--green); border-color: var(--green); }
.tl-dot.active {
    background: var(--blue);
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(58,143,255,0.2);
    animation: blink 1.4s step-end infinite;
}

.tl-when {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.35rem;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
}

.tl-what {
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.5;
}

/* ── METRICS ── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.metric-box {
    border: 2px solid var(--orange-dim);
    background: var(--bg);
    padding: 1rem;
    text-align: center;
    box-shadow: 3px 3px 0 var(--orange-dim);
}

.metric-value {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.55rem, 1.8vw, 0.8rem);
    color: var(--orange);
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.metric-label {
    font-size: 1rem; color: var(--text); line-height: 1.5;
}

/* ── INSIGHTS ── */
.insights { display: flex; flex-direction: column; gap: 0.9rem; }

.insight {
    border: 1px solid var(--green-dim);
    border-left: 3px solid var(--green);
    padding: 0.9rem 1.1rem;
    background: var(--bg);
}

.insight-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.42rem;
    color: var(--green);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}
.insight-title::before { content: '✦ '; }

.insight-text {
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.6;
}

/* ── MISSION NAV ── */
.mission-nav {
    display: flex; justify-content: space-between; align-items: center;
    border: 2px solid var(--border); background: var(--panel);
    padding: 0.8rem 1.2rem; margin-bottom: 1.5rem;
    box-shadow: 4px 4px 0 var(--border);
}

.nav-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.42rem; color: var(--text-dim);
    text-decoration: none;
    transition: color 0.1s;
}

.nav-btn:hover { color: var(--orange); }
.nav-btn.disabled { opacity: 0.3; pointer-events: none; }

.nav-center {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.38rem; color: var(--text-dim);
}

/* ── FOOTER ── */
footer {
    border: 2px solid var(--border); background: var(--bg2);
    padding: 0.8rem 1.2rem; display: flex;
    justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 0.5rem;
    box-shadow: 4px 4px 0 var(--border);
}

footer .foot-left {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.45rem; color: var(--text-dim);
}

footer .foot-right { font-size: 0.9rem; color: var(--text-dim); }

/* ── RESPONSIVE ── */
@media (max-width: 800px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .metrics-grid { grid-template-columns: 1fr; }
    .principles { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 450px) {
    .stats-row { grid-template-columns: 1fr; }
}

/* ── Lange screenshot in de lightbox (missie 2) ─────────────────────────── */
/* "safe center" centreert zolang hij past en gaat pas naar boven uitlijnen
   zodra hij echt overloopt — anders plakt hij op smalle schermen hoog. */
.lb.is-long .lb-scroll {
    overflow-y: auto;
    align-items: safe center;
}
.lb.is-long .lb-img {
    width: 100%; max-height: none;
}

.lb-hint-long { display: none; }
.lb.is-long .lb-hint-long { display: inline; color: var(--green); }

/* ── Badge voor een missie die nog loopt ────────────────────────────────── */
.badge-wip {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.35rem; color: var(--blue);
    border: 1px solid var(--blue);
    padding: 2px 6px;
    animation: blink 1.4s step-end infinite;
}
