/* =============================================
   MINJUNG PARK — GAMIFIED PORTFOLIO
   Soft Pixel Village Aesthetic
   ============================================= */

/* Google Fonts are linked from each page <head> (faster than @import). */

/* --- CSS Custom Properties --- */
:root {
  /* Backgrounds — soft warm green village */
  --bg-primary: #ebf2ee;       /* Soft minty cream */
  --bg-secondary: #cbd6cf;     /* Muted stone path green */
  --bg-card: #f4f8f6;          /* Pale sage white paper */
  --bg-card-hover: #e6efe9;    /* Moss green card hover */

  /* Pixel Village Palette (Greenish/Pine thematic accents) */
  --neon-cyan: #2e6155;        /* Deep sea glass pine */
  --neon-magenta: #529971;     /* Leafy moss green */
  --neon-green: #629e79;       /* Foliage green */
  --neon-yellow: #82ab8f;      /* Soft emerald highlight */
  --neon-purple: #4d755f;      /* Dusk forest shadow */
  --neon-orange: #72a184;      /* Jade green highlights */

  /* Text */
  --text-primary: #182c25;     /* Deep forest ink */
  --text-secondary: #3b5247;   /* Medium moss ink */
  --text-dim: rgba(24, 44, 37, 0.18);

  /* Fonts */
  --pixel-font: 'Silkscreen', monospace;
  --body-font: 'Space Grotesk', sans-serif;
  --serif-font: 'Cormorant Garamond', Georgia, serif;
  --title-font: 'Pixelify Sans', 'Silkscreen', monospace;

  /* Spacing */
  --header-h: 52px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Soft warm grid + earthy aura gradients */
  background-image:
    radial-gradient(ellipse at 20% 60%, rgba(61, 122, 111, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 15%, rgba(192, 102, 110, 0.04) 0%, transparent 50%),
    linear-gradient(rgba(61, 122, 111, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 122, 111, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--neon-cyan);
  color: var(--bg-primary);
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-green);
}

/* =========================================
   XP BAR (injected by JS)
   ========================================= */
#xp-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green), var(--neon-magenta));
  z-index: 10001;
  transition: width 0.1s linear;
  box-shadow: 0 0 6px var(--neon-cyan), 0 0 12px rgba(0, 240, 255, 0.3);
  pointer-events: none;
}

/* =========================================
   SCANLINE OVERLAY (injected by JS)
   ========================================= */
#scanline-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.012) 2px,
    rgba(0, 0, 0, 0.012) 4px
  );
}

/* =========================================
   CURSOR TRAIL PARTICLES (injected by JS)
   ========================================= */
.cursor-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  width: 4px;
  height: 4px;
  background: var(--neon-cyan);
  box-shadow: 0 0 6px var(--neon-cyan);
  opacity: 1;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.cursor-particle.fade {
  opacity: 0;
  transform: scale(0) translateY(-20px);
}

/* =========================================
   CLICK SPARKLE (injected by JS)
   ========================================= */
.click-sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 9997;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 1;
  animation: sparkle-fly 0.6s ease-out forwards;
}

@keyframes sparkle-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* =========================================
   HEADER — GAME HUD
   ========================================= */
#header {
  position: fixed;
  top: 3px; /* below XP bar */
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: var(--header-h);
  background: rgba(244, 248, 246, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(46, 97, 85, 0.12);
}

.header-left {
  display: flex;
  gap: 1.8rem;
}

.header-left a {
  font-family: var(--pixel-font);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  transition: all 0.3s;
  text-decoration: none;
  text-transform: uppercase;
  padding: 6px 0;
  position: relative;
}

.header-left a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--neon-cyan);
  box-shadow: 0 0 6px var(--neon-cyan);
  transition: width 0.3s ease;
}

.header-left a:hover {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.header-left a:hover::after {
  width: 100%;
}

.header-name {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--pixel-font);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.3s;
}

.header-name:hover {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.header-right {
  display: flex;
  align-items: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--neon-cyan);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: all 0.3s;
}

.nav-toggle:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* =========================================
   HERO — PRESS START
   ========================================= */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 15, 0.5) 0%,
    rgba(10, 10, 15, 0.2) 40%,
    rgba(10, 10, 15, 0.5) 75%,
    rgba(10, 10, 15, 0.95) 100%
  );
  pointer-events: none;
}

.hero-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  z-index: 2;
  gap: 1.5rem;
}

/* Glitch text */
.hero-glitch {
  font-family: var(--pixel-font);
  font-size: clamp(0.9rem, 2.8vw, 1.6rem);
  color: var(--text-primary);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-glitch::before,
.hero-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-glitch::before {
  color: var(--neon-cyan);
  z-index: -1;
  animation: glitch-shift-1 4s infinite linear;
}

.hero-glitch::after {
  color: var(--neon-magenta);
  z-index: -2;
  animation: glitch-shift-2 4s infinite linear;
}

.hero-dialog {
  max-width: 600px;
}

.hero-dialog p {
  font-family: var(--body-font);
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  letter-spacing: 0.02em;
}

.press-start {
  font-family: var(--pixel-font);
  font-size: 0.65rem;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  animation: blink-text 1.5s step-end infinite;
  margin-top: 1rem;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  display: inline-block;
  padding: 12px 28px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  transition: all 0.3s;
}

.press-start:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.3), 0 0 50px rgba(0, 240, 255, 0.1);
  animation: none;
}

/* =========================================
   FOOTER — GAME STYLED
   ========================================= */
#footer {
  background: rgba(10, 10, 15, 0.95);
  border-top: 1px solid rgba(0, 240, 255, 0.08);
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.4rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left span {
  font-family: var(--pixel-font);
  font-size: 0.42rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.footer-right {
  display: flex;
  gap: 1.5rem;
}

.footer-right a {
  font-family: var(--pixel-font);
  font-size: 0.42rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s;
  letter-spacing: 0.03em;
}

.footer-right a:hover {
  color: var(--neon-cyan);
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

/* =========================================
   MOBILE NAV OVERLAY
   ========================================= */
.mobile-nav {
  position: fixed;
  top: calc(var(--header-h) + 3px);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.98);
  z-index: 99;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-family: var(--pixel-font);
  font-size: 0.75rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s;
  padding: 10px 24px;
  border: 1px solid transparent;
}

.mobile-nav a:hover {
  color: var(--neon-cyan);
  border-color: rgba(0, 240, 255, 0.3);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

/* =========================================
   PROJECT DETAIL PAGES
   ========================================= */
.project-hero {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 3rem) 2rem 2rem;
}

.project-back {
  display: inline-block;
  font-family: var(--pixel-font);
  font-size: 0.45rem;
  color: var(--neon-cyan);
  margin-bottom: 2rem;
  transition: all 0.3s;
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-back:hover {
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  color: var(--neon-green);
}

.project-hero .hero-title {
  font-family: var(--pixel-font);
  font-size: clamp(0.7rem, 2.2vw, 1.1rem);
  font-weight: 400;
  line-height: 2;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
  text-transform: uppercase;
}

.project-hero .hero-sub {
  font-family: var(--body-font);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 2px;
}

.meta-item h4 {
  font-family: var(--pixel-font);
  font-size: 0.38rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  margin-bottom: 0.4rem;
}

.meta-item p {
  font-family: var(--body-font);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.project-gallery {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 4px;
}

.project-gallery img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid rgba(0, 240, 255, 0.04);
}

.project-gallery img:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.project-description {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.project-description p {
  font-family: var(--body-font);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* Override old animation classes on detail pages */
.anim-fade-up,
.anim-reveal {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes blink-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes glitch-shift-1 {
  0%, 100% { clip-path: inset(0 0 97% 0); transform: translate(0); }
  8% { clip-path: inset(15% 0 65% 0); transform: translate(-2px, 0); }
  16% { clip-path: inset(0 0 97% 0); transform: translate(0); }
  24% { clip-path: inset(55% 0 15% 0); transform: translate(2px, 0); }
  32%, 100% { clip-path: inset(0 0 97% 0); transform: translate(0); }
}

@keyframes glitch-shift-2 {
  0%, 100% { clip-path: inset(97% 0 0 0); transform: translate(0); }
  12% { clip-path: inset(35% 0 35% 0); transform: translate(3px, 0); }
  20% { clip-path: inset(97% 0 0 0); transform: translate(0); }
  28% { clip-path: inset(10% 0 70% 0); transform: translate(-3px, 0); }
  36%, 100% { clip-path: inset(97% 0 0 0); transform: translate(0); }
}

@keyframes float-particle {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
  25% { transform: translateY(-20px) translateX(8px); opacity: 0.5; }
  50% { transform: translateY(-8px) translateX(-5px); opacity: 0.3; }
  75% { transform: translateY(-25px) translateX(12px); opacity: 0.4; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 0, 170, 0.15); }
  50% { box-shadow: 0 0 12px rgba(255, 0, 170, 0.3), 0 0 24px rgba(255, 0, 170, 0.1); }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
  .header-left {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .header-name {
    left: 50%;
  }

  .project-gallery {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }

  .hero-glitch {
    font-size: clamp(0.6rem, 4vw, 0.9rem);
    letter-spacing: 0.06em;
  }

  .press-start {
    font-size: 0.5rem;
    padding: 10px 20px;
  }

  .project-meta {
    gap: 1rem;
  }

  .project-hero .hero-title {
    font-size: clamp(0.6rem, 3vw, 0.85rem);
  }
}

/* =========================================
   RPG GAMEPLAY INTERACTIVE ELEMENTS
   ========================================= */

/* --- Playable Character Sprite (1.5x Enlarger for Thicker Road) --- */
#player-sprite {
  position: absolute;
  width: 48px;
  height: 57px;
  background: var(--neon-cyan);
  border-radius: 6px;
  box-shadow: 0 0 14px var(--neon-cyan), inset 0 0 6px #000;
  z-index: 999;
  pointer-events: none;
  transition: transform 0.1s linear;
  display: none; /* initialized by script if mode selected */
}

/* Cute face on the sprite using pseudo elements */
#player-sprite::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 9px;
  width: 6px;
  height: 6px;
  background: #000;
  box-shadow: 24px 0 0 #000; /* second eye */
  transition: transform 0.1s ease;
}

#player-sprite::after {
  content: '';
  position: absolute;
  bottom: 12px;
  left: 9px;
  right: 9px;
  height: 6px;
}

/* Sleeping animation state for resting in shelter bed */
#player-sprite.sleeping {
  background: #5c6c64 !important; /* Muted sleeping slate-green */
  box-shadow: 0 0 10px rgba(92,108,100, 0.4), inset 0 0 6px #000 !important;
  transform: rotate(-90deg) scale(0.92);
  transition: transform 0.6s ease, background 0.6s ease;
}

#player-sprite.sleeping::before {
  /* Eyes closed (flat lines) */
  height: 2px !important;
  top: 14px !important;
  background: rgba(0, 0, 0, 0.7);
  box-shadow: 24px 0 0 rgba(0, 0, 0, 0.7) !important;
}

#player-sprite.sleeping::after {
  /* Sleeping mouth */
  height: 3px !important;
  bottom: 10px !important;
  background: rgba(0, 0, 0, 0.4);
}

/* Bobbing/walking animation class */
.player-walking {
  animation: sprite-bob 0.25s infinite alternate ease-in-out;
}

.player-facing-left::before {
  transform: translateX(-2px);
}
.player-facing-right::before {
  transform: translateX(2px);
}

@keyframes sprite-bob {
  0% { transform: translateY(0) scaleY(1); }
  100% { transform: translateY(-4px) scaleY(0.95); }
}

/* --- Control Mode Selection Modal --- */
.control-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.95);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.control-modal-box {
  background: var(--bg-card);
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.25);
  padding: 3rem 2rem;
  max-width: 600px;
  width: 90%;
  text-align: center;
  position: relative;
}

.control-modal-box::before {
  content: 'SELECT INPUT DEVICE';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--pixel-font);
  font-size: 0.5rem;
  color: var(--neon-cyan);
  background: var(--bg-primary);
  padding: 2px 14px;
  letter-spacing: 0.08em;
}

.control-modal-box h2 {
  font-family: var(--pixel-font);
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.control-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 580px) {
  .control-options-grid {
    grid-template-columns: 1fr;
  }
}

.control-option-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(0, 240, 255, 0.15);
  padding: 24px 16px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.control-option-card:hover {
  background: rgba(0, 240, 255, 0.06);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
  transform: translateY(-4px);
}

.control-option-icon {
  font-size: 2.2rem;
}

.control-option-title {
  font-family: var(--pixel-font);
  font-size: 0.48rem;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.control-option-desc {
  font-family: var(--body-font);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- HUD Inventory Navigation Option --- */
.hud-inv-link {
  font-family: var(--pixel-font) !important;
  font-size: 0.55rem !important;
  color: var(--neon-yellow) !important;
  cursor: pointer !important;
  position: relative;
}

.hud-inv-link:hover {
  color: var(--neon-yellow) !important;
  text-shadow: 0 0 8px rgba(255, 230, 0, 0.5) !important;
}

/* --- Inventory Overlay Grid Panel --- */
#inventory-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.95);
  z-index: 10500;
  display: none; /* shown by script */
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#inventory-modal.active {
  display: flex;
}

.inv-box {
  background: var(--bg-card);
  border: 2px solid var(--neon-yellow);
  box-shadow: 0 0 35px rgba(255, 230, 0, 0.2);
  width: 90%;
  max-width: 680px;
  padding: 2.5rem 2rem;
  position: relative;
}

.inv-box::before {
  content: 'BAG / INVENTORY';
  position: absolute;
  top: -12px;
  left: 24px;
  font-family: var(--pixel-font);
  font-size: 0.45rem;
  color: var(--neon-yellow);
  background: var(--bg-primary);
  padding: 2px 12px;
  letter-spacing: 0.05em;
}

.inv-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 1px solid rgba(255, 230, 0, 0.3);
  color: var(--neon-yellow);
  font-family: var(--pixel-font);
  font-size: 0.5rem;
  cursor: pointer;
  padding: 6px 12px;
  transition: all 0.3s;
}

.inv-close-btn:hover {
  background: rgba(255, 230, 0, 0.1);
  border-color: var(--neon-yellow);
}

.inv-title {
  font-family: var(--pixel-font);
  font-size: 0.65rem;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inv-subtitle {
  font-family: var(--body-font);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Grid layout for item slots */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-bottom: 2rem;
}

@media (max-width: 600px) {
  .inv-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.inv-slot {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 230, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  position: relative;
  transition: all 0.25s;
}

.inv-slot.empty {
  cursor: default;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.04);
}

.inv-slot.locked {
  background: rgba(0, 0, 0, 0.2);
  filter: grayscale(1) opacity(0.2);
}

.inv-slot:not(.empty):not(.locked):hover {
  background: rgba(255, 230, 0, 0.08);
  border-color: var(--neon-yellow);
  box-shadow: 0 0 10px rgba(255, 230, 0, 0.2);
  transform: scale(1.05);
}

/* Reflection Dialog Board */
.reflection-board {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 240, 255, 0.15);
  padding: 18px;
  min-height: 120px;
  border-radius: 2px;
  position: relative;
}

.reflection-board::before {
  content: 'DEV DIALOGUE';
  position: absolute;
  top: -9px;
  left: 12px;
  font-family: var(--pixel-font);
  font-size: 0.32rem;
  color: var(--neon-cyan);
  background: var(--bg-card);
  padding: 1px 8px;
  letter-spacing: 0.05em;
}

.reflection-title {
  font-family: var(--pixel-font);
  font-size: 0.42rem;
  color: var(--neon-yellow);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.reflection-text {
  font-family: var(--body-font);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Floating Unlock Alert Popup --- */
.unlock-popup {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 2px solid var(--neon-yellow);
  box-shadow: 0 0 20px rgba(255, 230, 0, 0.25);
  padding: 18px 24px;
  z-index: 10600;
  display: flex;
  align-items: center;
  gap: 16px;
  transform: translateY(150%);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.unlock-popup.active {
  transform: translateY(0);
}

.unlock-popup-icon {
  font-size: 2rem;
  animation: spin-item 2.5s infinite linear;
}

.unlock-popup-details {
  display: flex;
  flex-direction: column;
}

.unlock-popup-title {
  font-family: var(--pixel-font);
  font-size: 0.38rem;
  color: var(--neon-yellow);
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.unlock-popup-name {
  font-family: var(--body-font);
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
}

@keyframes spin-item {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Gameplay Speeches & Collectibles --- */
.char-speech-bubble {
  position: absolute;
  background: #ffffff;
  color: #2b2d24;
  border: 2px solid #2b2d24;
  padding: 6px 12px;
  font-family: var(--pixel-font);
  font-size: 8px; /* small readable retro font size */
  white-space: nowrap;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -100%);
  margin-top: -12px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
  animation: fade-speech 3.2s forwards;
}

.char-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #ffffff transparent;
  display: block;
  width: 0;
}

.char-speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: #2b2d24 transparent;
  display: block;
  width: 0;
  z-index: -1;
}

@keyframes fade-speech {
  0% { opacity: 0; transform: translate(-50%, -85%); }
  10% { opacity: 1; transform: translate(-50%, -100%); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -115%); }
}

/* star-collectible removed */

.hud-volume-btn {
  background: none;
  border: 1px solid rgba(96, 125, 91, 0.15);
  color: var(--neon-yellow);
  cursor: pointer;
  padding: 4px 8px;
  margin-left: 1rem;
  font-size: 0.72rem;
  font-family: var(--pixel-font);
  transition: all 0.3s;
}

.hud-volume-btn:hover {
  background: rgba(212, 163, 89, 0.08);
  border-color: var(--neon-yellow);
  box-shadow: 0 0 10px rgba(212, 163, 89, 0.2);
}

.score-hud-text {
  font-family: var(--pixel-font);
  font-size: 0.72rem;
  color: var(--neon-yellow);
  margin-left: 1.5rem;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .hud-volume-btn, .score-hud-text {
    font-size: 0.5rem;
    margin-left: 0.6rem;
  }
}

/* --- Cozy Roadside Emojis & Wind Sway --- */
.road-deco {
  position: absolute;
  font-size: 1.25rem;
  pointer-events: none;
  z-index: 1; /* sits behind character, above road lines */
  opacity: 0.85;
  user-select: none;
  animation: wind-sway 3s infinite alternate ease-in-out;
  line-height: 1;
}

@keyframes wind-sway {
  0% { transform: scale(1) rotate(-3deg) translateY(0); }
  100% { transform: scale(1.05) rotate(3deg) translateY(-2px); }
}

/* =========================================
   CONTROLS HINT PILL (landing page)
   ========================================= */
#controls-hint {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(39, 60, 53, 0.88);
  border: 1px solid rgba(61, 122, 111, 0.35);
  border-radius: 999px;
  padding: 10px 22px;
  z-index: 9000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(39, 60, 53, 0.25);
  animation: hint-rise 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: opacity 0.7s ease, transform 0.7s ease;
  pointer-events: none;
}

#controls-hint.hint-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
}

.hint-key {
  font-family: var(--pixel-font);
  font-size: 0.62rem;
  color: #fff;
  letter-spacing: 0.05em;
  background: rgba(61, 122, 111, 0.35);
  border: 1px solid rgba(61, 122, 111, 0.5);
  border-radius: 6px;
  padding: 4px 10px;
}

.hint-sep {
  font-family: var(--pixel-font);
  font-size: 0.55rem;
  color: var(--neon-yellow);
  opacity: 0.7;
}

.hint-label {
  font-family: var(--body-font);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
}

@keyframes hint-rise {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* =========================================
   PROJECT DETAIL PAGES — STORY CONNECTIONS
   ========================================= */

/* Dotted interactive terms inside description text */
.connection-node {
  border-bottom: 2px dotted var(--neon-cyan);
  cursor: help;
  position: relative;
  font-weight: 500;
  color: var(--neon-cyan);
  transition: all 0.25s ease;
  padding: 0 2px;
}

.connection-node:hover {
  color: var(--neon-green);
  border-bottom-color: var(--neon-green);
  background-color: rgba(132, 169, 140, 0.08);
  border-radius: 2px;
}

/* Elegant marginalia/revealed notes on left or right sides */
.connection-reveal-note {
  position: absolute;
  font-family: var(--body-font);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-left: 3px solid var(--neon-green);
  padding: 8px 12px;
  max-width: 220px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(39, 60, 53, 0.08);
  border-radius: 0 4px 4px 0;
  animation: note-fade-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  pointer-events: none;
}

@keyframes note-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* SVG Line Canvas Overlay for the Connections */
.connections-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

.connection-svg-line {
  stroke: var(--neon-cyan);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  fill: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.connection-svg-line.active {
  opacity: 0.75;
  stroke: var(--neon-green);
}


/* =========================================
   REVEAL & PARALLAX SCROLL ENGINE
   ========================================= */

/* Reveal Mask (Sliding wipe block with colored block sweep) */
.reveal-mask {
  position: relative;
  overflow: hidden;
  display: inline-block; /* keeps container tight */
  width: 100%;
}

/* Terracotta color block sweep layer */
.reveal-mask::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--ba-accent, #c25f46);
  z-index: 3;
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
  transform-origin: right;
  transform: scaleX(1);
}

/* Background card/page cover layer */
.reveal-mask::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--bg-card); /* fallback matching current card background */
  z-index: 2;
  transition: transform 1.1s cubic-bezier(0.76, 0, 0.24, 1);
  transform-origin: right;
  transform: scaleX(1);
}

.project-detail-page .reveal-mask::after {
  background-color: #f2ede0; /* Detail page warm cream background */
}

/* Active sweep trigger */
.reveal-mask.active::before {
  transform: scaleX(0);
}

.reveal-mask.active::after {
  transform: scaleX(0);
  transition-delay: 0.1s; /* stagger background mask slightly behind the color block */
}

.reveal-mask > img, .reveal-mask > video {
  transform: scale(1.18) translate3d(0,0,0);
  transition: transform 1.6s cubic-bezier(0.2, 1, 0.2, 1);
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reveal-mask.active > img, .reveal-mask.active > video {
  transform: scale(1.05) translate3d(0,0,0); /* keep small scale so parallax moves freely without border leaks */
}

/* Directional variants for mask sweeps */
.reveal-mask-right::before, .reveal-mask-right::after {
  transform-origin: left;
}
.reveal-mask-up::before {
  transform-origin: bottom;
  transform: scaleY(1);
}
.reveal-mask-up::after {
  transform-origin: bottom;
  transform: scaleY(1);
}
.reveal-mask-up.active::before {
  transform: scaleY(0);
}
.reveal-mask-up.active::after {
  transform: scaleY(0);
  transition-delay: 0.1s;
}
.reveal-mask-down::before {
  transform-origin: top;
  transform: scaleY(1);
}
.reveal-mask-down::after {
  transform-origin: top;
  transform: scaleY(1);
}
.reveal-mask-down.active::before {
  transform: scaleY(0);
}
.reveal-mask-down.active::after {
  transform: scaleY(0);
  transition-delay: 0.1s;
}

/* Fade & Slide Reveal (Highly dynamic skew entry - reduced offset to prevent timeline line overlaps) */
.reveal-text {
  opacity: 0;
  transform: translate3d(0, 12px, 0) skewY(0.5deg);
  transition: opacity 0.8s cubic-bezier(0.2, 1, 0.2, 1), transform 0.8s cubic-bezier(0.2, 1, 0.2, 1);
  will-change: opacity, transform;
}

.reveal-text.active {
  opacity: 1;
  transform: translate3d(0, 0, 0) skewY(0deg);
}

/* Horizontal slide reveals with skews */
.reveal-text-left {
  opacity: 0;
  transform: translate3d(-20px, 0, 0) skewX(-1.5deg);
  transition: opacity 0.8s cubic-bezier(0.2, 1, 0.2, 1), transform 0.8s cubic-bezier(0.2, 1, 0.2, 1);
  will-change: opacity, transform;
}
.reveal-text-left.active {
  opacity: 1;
  transform: translate3d(0, 0, 0) skewX(0deg);
}

.reveal-text-right {
  opacity: 0;
  transform: translate3d(20px, 0, 0) skewX(1.5deg);
  transition: opacity 0.8s cubic-bezier(0.2, 1, 0.2, 1), transform 0.8s cubic-bezier(0.2, 1, 0.2, 1);
  will-change: opacity, transform;
}
.reveal-text-right.active {
  opacity: 1;
  transform: translate3d(0, 0, 0) skewX(0deg);
}

/* Simple fade reveal */
.reveal-fade-only {
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(0.2, 1, 0.2, 1);
}
.reveal-fade-only.active {
  opacity: 1;
}

/* Delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }

/* Parallax element styling (physically enlarged with negative margins to serve as visual bleed buffer) */
.parallax-el {
  will-change: transform;
  transition: transform 0.1s cubic-bezier(0.25, 1, 0.3, 1);
  width: 116% !important;
  height: 116% !important;
  max-width: none !important;
  max-height: none !important;
  margin-left: -8% !important;
  margin-top: -8% !important;
  object-fit: cover;
}




/* =========================================
   READABILITY + HEADER POLISH (2026-11)
   ========================================= */

/* Homepage hero: darker overlay, larger light name, clearer PRESS START */
.hero-overlay {
  background:
    radial-gradient(ellipse at center, rgba(10, 10, 15, 0.55) 0%, rgba(10, 10, 15, 0.35) 60%, rgba(10, 10, 15, 0.6) 100%),
    linear-gradient(180deg, rgba(10, 10, 15, 0.55) 0%, rgba(10, 10, 15, 0.4) 45%, rgba(10, 10, 15, 0.95) 100%);
}
.hero-glitch {
  font-size: clamp(1.9rem, 6vw, 4.2rem);
  color: #f4f8f6;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}
.hero-dialog p {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}
html body .press-start {
  font-size: 0.9rem;
  color: #f4f8f6;
  background: rgba(46, 97, 85, 0.55);
  border: 1.5px solid rgba(244, 248, 246, 0.7);
  text-shadow: none;
}
html body .press-start:hover {
  background: rgba(46, 97, 85, 0.85);
  border-color: #f4f8f6;
}

/* Header: BAG and SOUND match the other nav links */
.header-left { align-items: center; }
html body .header-left .hud-inv-link {
  font-size: 0.72rem !important;
  color: var(--text-secondary) !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 0;
}
html body .header-left .hud-inv-link:hover {
  color: var(--neon-cyan) !important;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5) !important;
}
html body .hud-volume-btn {
  font-family: var(--pixel-font);
  font-size: 0.72rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: none;
  border: none;
  padding: 6px 0;
  margin-left: 0;
}
html body .hud-volume-btn:hover {
  color: var(--neon-cyan);
  background: none;
  box-shadow: none;
}

/* Minimum pixel-font size: Silkscreen is unreadable below ~11px */
html body .footer-left span,
html body .footer-right a { font-size: 0.72rem; }
html body .inv-close-btn,
html body .reflection-title { font-size: 0.72rem; }
html body .inv-title { font-size: 0.85rem; }
html body #resetControlBtn { font-size: 0.7rem !important; }
html body .unlock-popup-title { font-size: 0.7rem; }
html body .profile-class,
html body .quest-title-text { font-size: 0.72rem; line-height: 1.6; }
html body .section-label { font-size: 0.75rem; }
html body .stat-label,
html body .lang-name,
html body .stat-level,
html body .lang-level-text,
html body .achievement-year { font-size: 0.7rem; }
html body .contact-btn { font-size: 0.8rem; }
html body .hud-menu-header,
html body .hud-theme-btn { font-size: 0.7rem; }
html body .active-badge,
html body .tile-visit-badge { font-size: 0.7rem; }
html body .codex-type,
html body .codex-ch,
html body .quest-status,
html body .quest-accept { font-size: 0.7rem; }
html body .quest-card h3 { font-size: 0.8rem; line-height: 1.5; }
html body .pd-workbench-tab { font-size: 0.72rem; }

/* Character teleport (STAGE NAV): blink out, then pop in at the new spot */
#player-sprite.teleport-out { animation: player-warp-out 0.14s ease-in forwards; }
#player-sprite.teleport-in  { animation: player-warp-in 0.26s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
@keyframes player-warp-out {
  to { transform: scale(0.2, 1.6); opacity: 0; filter: brightness(2); }
}
@keyframes player-warp-in {
  0%   { transform: scale(1.6, 0.2); opacity: 0; filter: brightness(2); }
  100% { transform: scale(1, 1); opacity: 1; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  #player-sprite.teleport-out, #player-sprite.teleport-in { animation: none; }
}

/* Footer on phones: links wrap and center instead of running off the screen */
@media (max-width: 768px) {
  html body .footer-inner,
  html body.project-detail-page #footer .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    text-align: center;
  }
  html body .footer-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.1rem;
  }
}

/* Size floor, round 2: beat older, more specific rules */
html body .codex-card .codex-type,
html body .quest-card .quest-status { font-size: 0.7rem; color: var(--neon-purple); }
html body .mobile-nav .hud-inv-link {
  font-size: 0.75rem !important;
  color: var(--text-primary) !important;
  letter-spacing: 0.1em;
}
html body .hint-key { font-size: 0.72rem; }
html body .char-speech-bubble { font-size: 11px; padding: 7px 12px; }

/* =========================================
   DESIGN PASS (2026-11): header tools, homepage
   ========================================= */
/* 1 — game tools on the right side of the header */
.header-tools { display: flex; align-items: center; gap: 1.6rem; margin-right: 0.25rem; }
html body .header-tools .hud-inv-link,
html body .header-tools .header-cv,
html body .header-tools .hud-volume-btn {
  font-family: var(--pixel-font);
  font-size: 0.72rem !important;
  color: var(--text-secondary) !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  background: none;
  border: none;
  padding: 6px 0;
  margin: 0;
  cursor: pointer;
}
html body .header-tools a:hover,
html body .header-tools .hud-volume-btn:hover { color: var(--neon-cyan) !important; }
@media (max-width: 768px) { .header-tools { display: none; } }

/* 4 — plain role line under the name */
.hero-role {
  font-family: var(--body-font);
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  letter-spacing: 0.04em;
  color: rgba(244, 248, 246, 0.92);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
  margin: -0.5rem 0 0;
}

/* 5 — featured projects under the hero */
#featured {
  background: #0d1210;
  color: #eef3f0;
  padding: 4.5rem 2rem 5rem;
}
.featured-head {
  max-width: 1200px;
  margin: 0 auto 2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.featured-head h2 {
  font-family: var(--serif-font);
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 500;
  margin: 0;
}
.featured-all {
  font-family: var(--pixel-font);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9fd2bd;
  text-decoration: none;
  border-bottom: 1px solid rgba(159, 210, 189, 0.4);
}
.featured-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.featured-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #151c19;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.featured-card:hover { transform: translateY(-4px); border-color: rgba(159, 210, 189, 0.45); }
.featured-img { aspect-ratio: 16 / 10; overflow: hidden; background: #000; }
.featured-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-info { padding: 1.1rem 1.25rem 1.4rem; }
.featured-year {
  font-family: var(--pixel-font);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #9fd2bd;
}
.featured-info h3 {
  font-family: var(--serif-font);
  font-size: 1.6rem;
  font-weight: 500;
  margin: 0.35rem 0 0.4rem;
}
.featured-info p { margin: 0; font-size: 0.95rem; line-height: 1.5; color: rgba(238, 243, 240, 0.75); }

/* Brand logos for social / store links (2026-11) */
.brand-link { display: inline-flex; align-items: center; line-height: 1; }
.brand-icon { width: 15px; height: 15px; fill: currentColor; display: block; }
.footer-right { align-items: center; }
.footer-right .brand-link:hover { text-shadow: none; filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.45)); }

/* ── Titles in a pixel display font (2026-11) ── */
html:root body .hero-glitch,
html:root body .page-title,
html:root body .featured-head h2,
html:root body .featured-info h3,
html:root body .pf-name,
html:root body .tile-info h2,
html:root body .level-tile h2,
html:root body .quest-card h3,
html:root body .codex-card h3,
html:root body .pd-title,
html:root body .pd-next-title {
  font-family: var(--title-font);
  font-style: normal;
  letter-spacing: 0.01em;
}
html:root body .pd-title { font-weight: 600; line-height: 1; }
html:root body .pd-next-title { font-weight: 500; }
html:root body .pf-name { font-weight: 600; line-height: 1.05; }
html:root body .featured-head h2,
html:root body .featured-info h3,
html:root body .tile-info h2,
html:root body .level-tile h2 { font-weight: 500; }
html:root body .page-title { font-weight: 600; }
html:root body .quest-card h3,
html:root body .codex-card h3 { font-weight: 500; }
html:root body .hero-glitch { font-weight: 600; letter-spacing: 0.04em; }

/* ── Each project title follows its cover lettering (2026-11) ── */
html:root body[data-project="tune"] .pd-title,
html:root body a[href="project-tune.html"] .tile-info h2,
html:root body a[href="project-tune.html"].level-tile h2,
html:root body a[href="project-tune.html"] .featured-info h3,
html:root body a[href="project-tune.html"] .pd-next-title {
  font-family: 'Big Shoulders Display', sans-serif;
  font-weight: 200;
  font-style: normal;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}
html:root body[data-project="wywh"] .pd-title,
html:root body a[href="project-wywh.html"] .tile-info h2,
html:root body a[href="project-wywh.html"].level-tile h2,
html:root body a[href="project-wywh.html"] .featured-info h3,
html:root body a[href="project-wywh.html"] .pd-next-title {
  font-family: 'Pixelify Sans', monospace;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0;
  text-transform: lowercase;
}
html:root body[data-project="talsoom"] .pd-title,
html:root body a[href="project-talsoom.html"] .tile-info h2,
html:root body a[href="project-talsoom.html"].level-tile h2,
html:root body a[href="project-talsoom.html"] .featured-info h3,
html:root body a[href="project-talsoom.html"] .pd-next-title {
  font-family: 'Pinyon Script', cursive;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
}
html:root body[data-project="talsoom"] .pd-title { font-size: calc(clamp(2.8rem, 7.5vw, 5.5rem) * 1.35); }
html:root body a[href="project-talsoom.html"] .tile-info h2, html:root body a[href="project-talsoom.html"].level-tile h2 { font-size: calc(1.85rem * 1.35); }
html:root body a[href="project-talsoom.html"] .featured-info h3 { font-size: calc(1.6rem * 1.35); }
html:root body a[href="project-talsoom.html"] .pd-next-title { font-size: calc(1.9rem * 1.35); }
html:root body[data-project="6sentences"] .pd-title,
html:root body a[href="project-6sentences.html"] .tile-info h2,
html:root body a[href="project-6sentences.html"].level-tile h2,
html:root body a[href="project-6sentences.html"] .featured-info h3,
html:root body a[href="project-6sentences.html"] .pd-next-title {
  font-family: 'Press Start 2P', monospace;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
}
html:root body[data-project="6sentences"] .pd-title { font-size: calc(clamp(2.8rem, 7.5vw, 5.5rem) * 0.55); }
html:root body a[href="project-6sentences.html"] .tile-info h2, html:root body a[href="project-6sentences.html"].level-tile h2 { font-size: calc(1.85rem * 0.62); }
html:root body a[href="project-6sentences.html"] .featured-info h3 { font-size: calc(1.6rem * 0.62); }
html:root body a[href="project-6sentences.html"] .pd-next-title { font-size: calc(1.9rem * 0.62); }
html:root body[data-project="ambiband"] .pd-title,
html:root body a[href="project-ambiband.html"] .tile-info h2,
html:root body a[href="project-ambiband.html"].level-tile h2,
html:root body a[href="project-ambiband.html"] .featured-info h3,
html:root body a[href="project-ambiband.html"] .pd-next-title {
  font-family: 'Turret Road', sans-serif;
  font-weight: 300;
  font-style: normal;
  letter-spacing: 0;
  text-transform: lowercase;
}
html:root body[data-project="artronaut"] .pd-title,
html:root body a[href="project-artronaut.html"] .tile-info h2,
html:root body a[href="project-artronaut.html"].level-tile h2,
html:root body a[href="project-artronaut.html"] .featured-info h3,
html:root body a[href="project-artronaut.html"] .pd-next-title {
  font-family: 'Russo One', sans-serif;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
}
html:root body[data-project="timetogo"] .pd-title,
html:root body a[href="project-timetogo.html"] .tile-info h2,
html:root body a[href="project-timetogo.html"].level-tile h2,
html:root body a[href="project-timetogo.html"] .featured-info h3,
html:root body a[href="project-timetogo.html"] .pd-next-title {
  font-family: 'Nanum Pen Script', cursive;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
}
html:root body[data-project="timetogo"] .pd-title { font-size: calc(clamp(2.8rem, 7.5vw, 5.5rem) * 1.3); }
html:root body a[href="project-timetogo.html"] .tile-info h2, html:root body a[href="project-timetogo.html"].level-tile h2 { font-size: calc(1.85rem * 1.3); }
html:root body a[href="project-timetogo.html"] .featured-info h3 { font-size: calc(1.6rem * 1.3); }
html:root body a[href="project-timetogo.html"] .pd-next-title { font-size: calc(1.9rem * 1.3); }
html:root body[data-project="beyondframe"] .pd-title,
html:root body a[href="project-beyondframe.html"] .tile-info h2,
html:root body a[href="project-beyondframe.html"].level-tile h2,
html:root body a[href="project-beyondframe.html"] .featured-info h3,
html:root body a[href="project-beyondframe.html"] .pd-next-title {
  font-family: 'Federo', sans-serif;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
html:root body[data-project="inthetrain"] .pd-title,
html:root body a[href="project-inthetrain.html"] .tile-info h2,
html:root body a[href="project-inthetrain.html"].level-tile h2,
html:root body a[href="project-inthetrain.html"] .featured-info h3,
html:root body a[href="project-inthetrain.html"] .pd-next-title {
  font-family: 'Rock Salt', cursive;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  text-transform: uppercase;
}
html:root body[data-project="inthetrain"] .pd-title { font-size: calc(clamp(2.8rem, 7.5vw, 5.5rem) * 0.7); }
html:root body a[href="project-inthetrain.html"] .tile-info h2, html:root body a[href="project-inthetrain.html"].level-tile h2 { font-size: calc(1.85rem * 0.72); }
html:root body a[href="project-inthetrain.html"] .featured-info h3 { font-size: calc(1.6rem * 0.72); }
html:root body a[href="project-inthetrain.html"] .pd-next-title { font-size: calc(1.9rem * 0.72); }

/* Research question in Fraunces (2026-11) */
html:root body .pd-pullquote,
html:root body .pd-pullquote::before {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
}
html:root body .pd-pullquote { font-weight: 300; font-style: italic; }

/* Homepage name is the page's main heading (h1) */
h1.hero-glitch { margin: 0; }

/* SoKids title: drawn in the game's own logo lettering (SoKids/wordmark*.svg).
   The text stays in the page for screen readers; only its look is replaced. */
html:root body[data-project="sokids"] .pd-title {
  display: block;
  font-size: 0;
  line-height: 0;
  color: transparent;
  width: clamp(11rem, 24vw, 20rem);
  aspect-ratio: 944 / 264;
  background: url('SoKids/wordmark-light.svg') left center / contain no-repeat;
}
html:root body a[href="project-sokids.html"] .tile-info h2,
html:root body a[href="project-sokids.html"].level-tile h2,
html:root body a[href="project-sokids.html"] .featured-info h3 {
  font-size: 0;
  line-height: 0;
  color: transparent;
  width: 8.5rem;
  aspect-ratio: 944 / 264;
  background: url('SoKids/wordmark.svg') left center / contain no-repeat;
}
html:root body a[href="project-sokids.html"] .pd-next-title {
  font-size: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
html:root body a[href="project-sokids.html"] .pd-next-title::before {
  content: '';
  width: 8rem;
  aspect-ratio: 944 / 264;
  background: url('SoKids/wordmark.svg') left center / contain no-repeat;
}
html:root body a[href="project-sokids.html"] .pd-next-title::after {
  content: '→';
  font-size: 1.9rem;
}
