/* 
  vage.blog - Cinematic Multi-Environment Parallax Styling
  Tailored for TRAIN_NIGHT, WAITING_ROOM, and GAS_STATION backdrops.
*/

@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&family=Outfit:wght@300;400;600;800&display=swap');

/* --- Base & Scroll System --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

:root {
  --theme-transition: background-color 0.8s cubic-bezier(0.25, 1, 0.5, 1), 
                      color 0.6s ease;
  --terminal-color: #00f0ff;
  --terminal-border: rgba(0, 240, 255, 0.25);
  --terminal-glow: rgba(0, 240, 255, 0.15);
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --shadow-color: rgba(0, 0, 0, 0.6);
}

html, body {
  background-color: #050508;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  
  /* ALLOW NATURAL SCROLLING ON WINDOW */
  overflow-y: auto; 
  overflow-x: hidden;
  height: auto;
  min-height: 100vh;
  transition: var(--theme-transition);
}

.page-wrapper {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Natural height driving standard window ScrollTrigger */
.scroll-spacer {
  position: relative;
  width: 100%;
  height: 500vh; 
  pointer-events: none;
  z-index: 5;
}

/* --- 3D World Viewport --- */
.world-viewport {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.scenic-container {
  position: relative;
  width: 1920px;
  height: 1080px;
  transform-style: preserve-3d;
  transform: translateZ(-200px);
  will-change: transform;
}

.dust-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* --- HUD & Headers --- */
.hud-layer {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  padding: 25px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 150;
  pointer-events: auto;
}

.hud-brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  text-transform: lowercase;
  cursor: pointer;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.hud-meta {
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hud-meta strong {
  color: var(--terminal-color);
  text-shadow: 0 0 5px var(--terminal-border);
}

.meta-sep {
  margin: 0 8px;
  color: rgba(255, 255, 255, 0.15);
}

.hud-clock {
  font-family: 'Courier Prime', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 20px;
}

.hud-btn {
  background: transparent;
  border: 1px solid var(--text-secondary);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hud-btn:hover {
  background: var(--text-primary);
  color: #050508;
}

/* --- Scenic Environments Layout --- */
.env-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: opacity, transform;
}

.env-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 5;
}

/* --- Environment 1: Train Night Elements --- */
.train-window-viewport {
  position: absolute;
  top: 310px;
  left: 175px;
  width: 250px;
  height: 380px;
  overflow: hidden;
  z-index: 2;
  border-radius: 12px 12px 0 0;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
  transform: skewY(-2.5deg);
}

.train-window-landscape {
  position: absolute;
  top: 0;
  left: 0;
  width: 800px;
  height: 100%;
  background-image: url('night_scenery.png');
  background-size: cover;
  will-change: transform;
}

.train-rain-overlay {
  position: absolute;
  top: 310px;
  left: 175px;
  width: 250px;
  height: 380px;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(circle, transparent, rgba(0,0,0,0.4));
  transform: skewY(-2.5deg);
}

.rain-overlay-drop {
  position: absolute;
  width: 1.5px;
  height: 12px;
  background: rgba(255, 0, 127, 0.4);
  animation: rainStream 2.5s linear infinite;
}

@keyframes rainStream {
  0% { transform: translateY(-20px) rotate(8deg); opacity: 0; }
  20% { opacity: 0.7; }
  100% { transform: translateY(400px) rotate(8deg); opacity: 0.1; }
}

/* --- Bounding Screen Targets (3D projections) --- */
.screen-target-wrapper {
  position: absolute;
  transform-style: preserve-3d;
  will-change: transform, scale;
  z-index: 10;
}

/* TRAIN TARGET SCREEN: High-res open laptop screen display */
#trainScreenTarget {
  top: 330px;
  left: 480px;
  width: 960px;
  height: 563px;
  transform: perspective(1000px) rotateX(0deg) scale(0.4333);
  border: none;
  border-radius: 4px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

/* WAITING TARGET SCREEN: High-res tablet screen on the green plastic chair */
#waitingScreenTarget {
  top: 602px;
  left: 343px;
  width: 960px;
  height: 640px;
  transform: perspective(800px) rotateX(66.3deg) rotateY(-49.9deg) rotateZ(8.4deg) scale(0.1833);
  border: none;
  border-radius: 4px;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}

/* GAS STATION TARGET SCREEN: High-res tablet screen on the plastic table */
#gasScreenTarget {
  top: 322px;
  left: 408px;
  width: 960px;
  height: 640px;
  transform: perspective(800px) rotateX(82.1deg) rotateY(-47.7deg) rotateZ(3.7deg) scale(0.276);
  border: none;
  border-radius: 4px;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}

/* --- Upright Screen Display (Phosphor styling) --- */
.screen-display {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #030305;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.95);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tablet-display {
  background-color: #040806;
}

.gas-display {
  background-color: #060503; 
}

/* Phosphor overlays and scanning grids */
.crt-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle, transparent 65%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
  z-index: 10;
}

.crt-scanlines {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.18) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 11;
}

.crt-flicker {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(18, 16, 16, 0.04);
  opacity: 0;
  pointer-events: none;
  z-index: 12;
  animation: crtFlickerAnim 0.15s infinite;
}

@keyframes crtFlickerAnim {
  0% { opacity: 0.15; }
  50% { opacity: 0.05; }
  100% { opacity: 0.1; }
}

/* --- Environment 2: Waiting Room Elements --- */
.waiting-wall-counter {
  position: absolute;
  top: 175px;
  left: 875px;
  background: #121010;
  border: 4px solid #2d2626;
  border-radius: 6px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 20px rgba(0,0,0,0.8), inset 0 0 10px #000;
  z-index: 6;
  transform: skewY(1deg);
}

.waiting-wall-counter::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle, transparent 60%, rgba(255, 0, 0, 0.15));
  pointer-events: none;
}

.counter-label {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  color: #574c4c;
  letter-spacing: 2px;
  margin-bottom: 2px;
}

.counter-num {
  font-family: 'Courier Prime', monospace;
  font-size: 32px;
  font-weight: bold;
  color: #ff3333;
  text-shadow: 0 0 8px #ff3333, 0 0 18px #990000;
  letter-spacing: 1px;
  animation: tlFlicker 4s infinite ease-in-out;
}

@keyframes tlFlicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.4; }
  94% { opacity: 0.9; }
  95% { opacity: 0.2; }
  96% { opacity: 1; }
}

/* --- Blog Post Render System (inside displays) --- */
.screen-scroll-container {
  width: 100%;
  height: 100%;
  
  /* HIDE VERTICAL SCROLLBARS FOR UNIFIED MAIN SCROLL FEEL */
  overflow-y: hidden; 
  position: relative;
  z-index: 2;
  padding: 40px;
}

.blog-post-content {
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Custom Phosphor Colors for each room */
#envTrain .post-title {
  color: #00f0ff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

#envWaiting .post-title {
  color: #39ff14;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

#envGasStation .post-title {
  color: #ff9900; 
  text-shadow: 0 0 10px rgba(255, 153, 0, 0.3);
}

#envTrain .post-category {
  color: rgba(0, 240, 255, 0.6);
}

#envWaiting .post-category {
  color: rgba(57, 255, 20, 0.6);
}

#envGasStation .post-category {
  color: rgba(255, 153, 0, 0.6);
}

.post-header {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.post-category {
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.post-title {
  font-size: 32px; /* Increased for big screen targets */
  font-weight: 800;
  margin-top: 5px;
  line-height: 1.3;
}

.post-date {
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  color: var(--text-secondary);
}

.post-body {
  font-size: 18px; /* Increased for beautiful screen fill on laptop */
  line-height: 1.7;
  color: var(--text-secondary);
}

.post-footer {
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  padding-top: 25px;
  margin-top: 15px;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
}

/* --- Floating Scroll Indicator --- */
.scroll-indicator {
  position: fixed; 
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  z-index: 120;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.scroll-indicator-arrow {
  width: 15px;
  height: 15px;
  border-bottom: 2px solid var(--text-secondary);
  border-right: 2px solid var(--text-secondary);
  transform: rotate(45deg);
  animation: bounceArrow 1.5s infinite alternate;
}

@keyframes bounceArrow {
  0% { transform: translateY(0) rotate(45deg); opacity: 0.3; }
  100% { transform: translateY(8px) rotate(45deg); opacity: 1; }
}

/* Setup backdrops with generated images */
#trainBackdrop {
  background-image: url('train_cabin_bg.png');
}

#waitingBackdrop {
  background-image: url('waiting_room_bg.png');
}

#gasBackdrop {
  background-image: url('gas_station_bg.png');
}

/* --- Responsive Media Viewport Scaling --- */
@media (max-width: 1440px) {
  .scenic-container {
    transform: translateZ(-200px) scale(0.75);
  }
}

@media (max-width: 1024px) {
  .scenic-container {
    transform: translateZ(-250px) scale(0.55);
  }
}

@media (max-width: 768px) {
  .scenic-container {
    transform: translateZ(-300px) scale(0.40);
  }
  .hud-meta {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   IMPECCABLE POLISH LAYER
   Brand: melancholische, liminale nacht. Lezen is heilig.
   Neon getemperd naar filmische fosfor; prose in literaire serif.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Getemperde, filmische fosfor i.p.v. candy-neon */
  --terminal-color: #6fcdd6;
  --terminal-border: rgba(111, 205, 214, 0.22);
  --terminal-glow: rgba(111, 205, 214, 0.12);
  /* Warme perkament-inkt voor de blogtekst (contrast + ziel) */
  --ink-warm: #e7ddcd;
  --ink-soft: #c3baa9;
}

/* --- Leeservaring: literaire serif, juiste regellengte, warme inkt --- */
.blog-post-content {
  font-family: 'Newsreader', Georgia, serif;
  max-width: 600px;            /* ~62-68ch regellengte */
  margin: 0 auto;
  gap: 20px;
}

.post-title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 500;
  font-size: 33px;
  line-height: 1.18;
  letter-spacing: -0.012em;
  margin-top: 6px;
}

.post-body {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.78;
  color: var(--ink-warm);
  letter-spacing: 0.004em;
}

.post-body i, .post-body em { font-style: italic; }
.post-body strong { color: #f2ead9; font-weight: 600; }

/* Systeem-metadata blijft mono — dat is de "device chrome" laag */
.post-category, .post-date, .post-footer {
  font-family: 'Courier Prime', monospace;
  color: var(--ink-soft);
  opacity: 0.7;
}
.post-header { border-bottom-color: rgba(231, 221, 205, 0.12); }
.post-footer { border-top-color: rgba(231, 221, 205, 0.08); letter-spacing: 0.12em; }

/* Getemperde fosfor-gloed per ruimte (minder neon, meer film) */
#envTrain .post-title       { color: #86d6dc; text-shadow: 0 0 16px rgba(111,205,214,0.22); }
#envWaiting .post-title     { color: #93dca6; text-shadow: 0 0 16px rgba(125,210,150,0.20); }
#envGasStation .post-title  { color: #efb877; text-shadow: 0 0 16px rgba(235,170,95,0.20); }
#envTrain .post-category    { color: rgba(134,214,220,0.65); }
#envWaiting .post-category  { color: rgba(147,220,166,0.65); }
#envGasStation .post-category { color: rgba(239,184,119,0.65); }

/* Koude, melancholische regen i.p.v. felroze cyberpunk */
.rain-overlay-drop { background: rgba(186, 210, 226, 0.4); }

/* --- HUD: stiller, cinematischer, minder pill-candy --- */
.hud-brand {
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow: 0 0 18px rgba(111,205,214,0.3);
}
.hud-meta {
  border-radius: 2px;
  background: rgba(8, 9, 13, 0.55);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(231, 221, 205, 0.07);
  font-size: 10.5px;
  letter-spacing: 1.6px;
}
.hud-clock { font-size: 12px; letter-spacing: 1px; }
.hud-btn {
  border-radius: 2px;
  border: 1px solid rgba(231, 221, 205, 0.3);
  letter-spacing: 0.5px;
  transition: background-color 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.hud-btn:hover { background: rgba(231, 221, 205, 0.92); color: #08080c; }

/* --- Toegankelijkheid: zichtbare focus (was er niet) --- */
.hud-btn:focus-visible,
.hud-brand:focus-visible {
  outline: 2px solid var(--terminal-color);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Zachtere pijl-easing */
@keyframes bounceArrow {
  0%   { transform: translateY(0) rotate(45deg); opacity: 0.25; }
  100% { transform: translateY(7px) rotate(45deg); opacity: 0.9; }
}

/* --- Respecteer prefers-reduced-motion: kalmeer de rusteloosheid --- */
@media (prefers-reduced-motion: reduce) {
  .crt-flicker,
  .scroll-indicator-arrow,
  .counter-num { animation: none !important; }
  .rain-overlay-drop { animation-duration: 5s !important; }
}

/* Mobiel: iets royalere leesmaat binnen het scherm */
@media (max-width: 768px) {
  .post-body { font-size: 19px; }
  .blog-post-content { max-width: 92%; }
}

/* ═══════════════════════════════════════════════════════════
   DELIGHT LAYER — signatuur-details, on-brand
   ═══════════════════════════════════════════════════════════ */

/* Knipperende schrijfcursor aan het eind van elke post.
   Victor: "de cursor knippert op het ritme van de rails" — letterlijk gemaakt. */
.post-body::after {
  content: '';
  display: inline-block;
  width: 0.46em;
  height: 1.02em;
  margin-left: 3px;
  background: var(--ink-warm);
  opacity: 0.85;
  vertical-align: -0.14em;
  animation: caretBlink 1.15s steps(1) infinite;
}
@keyframes caretBlink {
  0%, 50%      { opacity: 0.85; }
  50.01%, 100% { opacity: 0; }
}

/* Signaal-acquisitie: de wereld komt bij het laden op uit het donker
   (alsof je inschakelt op een uitzending). Eenmalig, raakt de GSAP-laag niet. */
.world-viewport {
  animation: bootFade 1.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes bootFade {
  0%   { opacity: 0; filter: brightness(0.25) blur(5px); }
  60%  { opacity: 1; }
  100% { opacity: 1; filter: brightness(1) blur(0); }
}

/* Merk-titel ademt heel licht — als een zwak baken */
.hud-brand { animation: brandPulse 6s ease-in-out infinite; }
@keyframes brandPulse {
  0%, 100% { text-shadow: 0 0 14px rgba(111,205,214,0.22); }
  50%      { text-shadow: 0 0 22px rgba(111,205,214,0.42); }
}

/* Scroll-hint: zachtere, tragere cadans (minder "app", meer sfeer) */
.scroll-indicator { opacity: 0.7; }
.scroll-indicator-text { opacity: 0.8; }

@media (prefers-reduced-motion: reduce) {
  .post-body::after { animation: none !important; opacity: 0.6; }
  .world-viewport { animation: none !important; }
  .hud-brand { animation: none !important; }
}
