/* ============================================================
   CAVES OF QUD — flavored portfolio theme
   Palette inspired by the game's dim teal caverns + amber glow.
   ============================================================ */
:root {
  /* shared accents */
  --amber:        #d8b94a;
  --amber-bright: #ffd23f;
  --cyan:         #77bfcf;
  --green:        #6bbf59;
  --red:          #d74200;
  --magenta:      #c77dba;
}

/* DARK = "the caves" (default) */
[data-theme="dark"] {
  --bg:        #0a1413;
  --bg-2:      #0e201e;   /* panels */
  --bg-3:      #123330;   /* raised */
  --text:      #b1c9c3;
  --muted:     #6f8f88;
  --primary:   var(--amber);
  --link:      var(--cyan);
  --border:    rgba(216,185,74,0.32);
  --border-2:  rgba(119,191,207,0.22);
  --glow:      rgba(216,185,74,0.16);
  --navbar-bg: rgba(8,17,16,0.92);
  --scan:      rgba(0,0,0,0.16);
  --shadow:    rgba(0,0,0,0.5);
}

/* LIGHT = "the surface" parchment / salt desert */
[data-theme="light"] {
  --bg:        #e7e0cd;
  --bg-2:      #f1ebd9;
  --bg-3:      #ddd4ba;
  --text:      #2c2718;
  --muted:     #7a6f55;
  --primary:   #9a6b1f;
  --link:      #1f6f7f;
  --border:    rgba(154,107,31,0.40);
  --border-2:  rgba(31,111,127,0.30);
  --glow:      rgba(154,107,31,0.12);
  --navbar-bg: rgba(237,231,213,0.94);
  --scan:      rgba(120,100,60,0.05);
  --shadow:    rgba(80,60,20,0.18);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Courier New', monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.5s, color 0.5s;
  overflow-x: hidden;
}

/* faint cavern haze in the background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 80% -5%, var(--glow), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(119,191,207,0.07), transparent 60%);
}

/* CRT scanline + vignette overlay */
#crt {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, transparent 0 2px, var(--scan) 2px 3px),
    radial-gradient(120% 120% at 50% 50%, transparent 60%, rgba(0,0,0,0.35) 100%);
  mix-blend-mode: multiply;
  opacity: 0.7;
}
[data-theme="light"] #crt { opacity: 0.4; }

/* ---------- selection / scrollbar ---------- */
::selection { background: var(--amber); color: var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border: 1px solid var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--navbar-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  width: 100%;
  z-index: 99;
}

.logo {
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 10px var(--glow);
  text-decoration: none;
  letter-spacing: 1px;
  transition: text-shadow 0.3s, transform 0.3s;
}
.logo:hover { text-shadow: 0 0 18px var(--amber-bright); transform: translateY(-1px); }

.nav-links { display: flex; align-items: center; gap: 1.8rem; }

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  position: relative;
  transition: color 0.2s;
}
.nav-links > a::before { content: "·"; color: var(--muted); margin-right: 0.4rem; }
.nav-links > a:hover, .dropdown > a:hover { color: var(--primary); }
.nav-links > a:hover::before { color: var(--primary); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  cursor: pointer;
  z-index: 102;
}
.hamburger span {
  display: block;
  width: 27px;
  height: 3px;
  background: var(--text);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55),
              opacity 0.3s ease, background 0.2s;
  transform-origin: center;
}
.hamburger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
.hamburger:hover span { background: var(--primary); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 1.1rem;
  cursor: pointer;
  margin-left: 1.1rem;
  padding: 0.3rem 0.5rem;
  display: flex;
  align-items: center;
  transition: background 0.2s, border-color 0.2s;
}
.theme-toggle:hover { background: var(--bg-3); border-color: var(--primary); }
.theme-toggle .fa-sun { display: inline; }
.theme-toggle .fa-moon { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle .fa-moon { display: inline; }

.social-container { margin-left: 1.5rem; }
.socials { display: flex; align-items: center; gap: 1.1rem; }
.socials a { color: var(--link); font-size: 1.15rem; transition: color 0.2s, transform 0.2s; }
.socials a:hover { color: var(--primary); transform: translateY(-2px) scale(1.12); }

.dropdown {
  display: flex;
  position: fixed;
  right: 1.5rem;
  top: 64px;
  background:
    radial-gradient(120% 80% at 100% 0%, var(--glow), transparent 60%),
    var(--navbar-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  z-index: 101;
  flex-direction: column;
  min-width: 230px;
  box-shadow: 0 12px 34px var(--shadow), inset 0 0 30px rgba(0, 0, 0, 0.3);
  padding: 0.7rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px) scale(0.95);
  transform-origin: top right;
  transition: opacity 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55),
              transform 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55), visibility 0.35s;
}
/* corner brackets to match the site's panels */
.dropdown::before, .dropdown::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.dropdown::before { top: -1px;    left: -1px;  border-top: 2px solid var(--primary);    border-left: 2px solid var(--primary); }
.dropdown::after  { bottom: -1px; right: -1px; border-bottom: 2px solid var(--primary); border-right: 2px solid var(--primary); }

.dropdown-head {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: left;
  padding: 0.1rem 0.6rem 0.6rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px dashed var(--border);
}

.dropdown > a {
  color: var(--text);
  text-decoration: none;
  margin: 0.12rem 0;
  font-size: 1rem;
  letter-spacing: 1px;
  display: block;
  text-align: left;
  padding: 0.45rem 0.9rem 0.45rem 1.6rem;
  position: relative;
  border-left: 2px solid transparent;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.3s ease, transform 0.3s ease,
              background 0.2s, color 0.2s, border-color 0.2s;
}
.dropdown > a::before {
  content: "›";
  position: absolute;
  left: 0.75rem;
  color: var(--primary);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.dropdown > a:hover {
  color: var(--amber-bright);
  background: var(--bg-3);
  border-left-color: var(--primary);
}
.dropdown > a:hover::before { opacity: 1; transform: translateX(0); }

.dropdown .social-container {
  margin: 0.5rem 0 0.15rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: center;
}
.dropdown .socials { gap: 0.55rem; }
.dropdown .socials a {
  color: var(--link);
  border: 1px solid var(--border);
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.dropdown .socials a:hover {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.dropdown.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.dropdown.show > a, .dropdown.show .social-container { opacity: 1; transform: translateX(0); }

@media (max-width: 980px) { .nav-links { gap: 1.2rem; } .social-container { margin-left: 1rem; } }
@media (max-width: 820px) {
  .nav-links, .navbar > .social-container { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 490px) { .dropdown { right: 0.7rem; left: 0.7rem; min-width: unset; } }

/* ============================================================
   SECTIONS — common
   ============================================================ */
section {
  position: relative;
  width: min(1100px, 88%);
  margin: 0 auto;
  padding: 6rem 0 4rem;
  scroll-margin-top: 80px;
}

section h2 {
  text-align: center;
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  color: var(--primary);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  text-shadow: 0 0 12px var(--glow);
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
section h2::before { content: "[ "; color: var(--muted); }
section h2::after  { content: " ]"; color: var(--muted); }
section h2.visible { opacity: 1; transform: translateY(0) scale(1); }

.section-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: -1.6rem;
  margin-bottom: 2.5rem;
}

/* ============================================================
   HOME / HERO
   ============================================================ */
#home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 7rem;
}
.home-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
}
.home-intro { text-align: left; }

.prompt-line { color: var(--green); font-size: 0.95rem; margin-bottom: 1rem; }
.cursor {
  display: inline-block;
  color: var(--amber-bright);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.profile-image { margin-bottom: 1.4rem; }
.profile-image img {
  width: clamp(120px, 12vw, 170px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px var(--bg), 0 0 22px var(--glow);
  filter: saturate(0.9);
  transition: transform 0.3s, box-shadow 0.3s;
}
.profile-image img:hover { transform: translateY(-3px); box-shadow: 0 0 0 4px var(--bg), 0 0 30px var(--amber-bright); }

.home-name {
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.home-name .han { color: var(--primary); font-weight: 700; margin-left: 0.4rem; text-shadow: 0 0 10px var(--glow); }

.home-role { color: var(--cyan); font-size: 0.95rem; margin-bottom: 1.4rem; letter-spacing: 0.5px; }

.about-me {
  color: var(--text);
  font-size: clamp(0.92rem, 1.2vw, 1.05rem);
  max-width: 46ch;
  min-height: 7.5em;
  line-height: 1.75;
  margin-bottom: 1.6rem;
}

.home-socials { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.home-socials a {
  color: var(--link);
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  padding: 0.35rem 0.8rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.home-socials a:hover { background: var(--primary); color: var(--bg); border-color: var(--primary); transform: translateY(-2px); }

/* ----- 3D globe / world map ----- */
.home-map { display: flex; justify-content: center; }
.map-frame {
  width: 100%;
  max-width: 460px;
  background:
    linear-gradient(var(--bg-2), var(--bg-2)) padding-box,
    radial-gradient(circle at 50% 35%, rgba(119,191,207,0.12), transparent 70%) padding-box;
  border: 1px solid var(--border);
  box-shadow: 0 0 30px var(--shadow), inset 0 0 40px rgba(0,0,0,0.35);
  padding: 0;
  overflow: hidden;
}
.map-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.map-hint { color: var(--muted); font-size: 0.7rem; text-transform: lowercase; }
#globe {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  cursor: grab;
  touch-action: none;
}
#globe.grabbing { cursor: grabbing; }
#globe canvas { display: block; width: 100% !important; height: 100% !important; }

#globe-label {
  position: absolute;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  font-size: 0.66rem;
  letter-spacing: 1.5px;
  color: var(--amber-bright);
  background: rgba(8,17,16,0.7);
  border: 1px solid var(--border);
  padding: 1px 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
#globe-label::before { content: "◇ "; }
#globe-coords {
  padding: 0.45rem 0.85rem;
  font-size: 0.7rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg-3);
  text-align: center;
}
.globe-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: pre;
  line-height: 1.2;
  text-align: center;
}

@media (max-width: 880px) {
  .home-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .home-intro { text-align: center; }
  .about-me { margin-left: auto; margin-right: auto; }
  .home-socials { justify-content: center; }
  .map-frame { max-width: 380px; }
}

/* ============================================================
   CORNER BRACKETS (shared frame accent)
   ============================================================ */
.bracket { position: relative; }
.bracket::before, .bracket::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.bracket::before { top: -1px;    left: -1px;  border-top: 2px solid var(--primary);    border-left: 2px solid var(--primary); }
.bracket::after  { bottom: -1px; right: -1px; border-bottom: 2px solid var(--primary); border-right: 2px solid var(--primary); }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid { display: flex; flex-direction: column; gap: 2rem; }
.projects-grid hr { border: none; border-top: 1px dashed var(--border); opacity: 0.6; }

.project {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  position: relative;
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.project.visible { opacity: 1; transform: translateY(0); }

.project-info { flex: 1 1 340px; min-width: 260px; text-align: left; z-index: 2; }
.project-title {
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}
.project-title::before { content: "▸ "; color: var(--cyan); }
.project-links { margin-bottom: 0.8rem; }
.project-links a {
  color: var(--link);
  font-size: 1.1rem;
  margin-right: 1rem;
  transition: color 0.2s, transform 0.2s;
}
.project-links a:hover { color: var(--primary); transform: scale(1.12); }
.project-desc { font-size: 0.95rem; color: var(--text); margin-bottom: 0.9rem; line-height: 1.7; }

.project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; }
.project-tags li {
  background: transparent;
  color: var(--amber-bright);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  letter-spacing: 0.5px;
}
.project-tags li::before { content: "#"; color: var(--muted); }

.project-image { flex: 1 1 250px; display: flex; justify-content: flex-end; align-items: center; }
.project-image iframe {
  max-width: 500px; width: 100%; min-height: 15rem; height: 100%;
  border: 2px solid var(--border);
  box-shadow: 0 0 24px var(--shadow);
  display: block;
}
.project-image img, .project-image-s img {
  width: 100%; max-width: 500px;
  border: 2px solid var(--border);
  box-shadow: 0 0 24px var(--shadow);
  filter: saturate(0.92);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.project-image img:hover, .project-image-s img:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 34px var(--glow);
  border-color: var(--primary);
}

.project-image-slideshow { max-width: 500px; position: relative; margin: auto; flex: 1 1 250px; }
.project-image-s { display: none; width: 100%; aspect-ratio: 16 / 9; }
/* every slide uses an identical box so the carousel never resizes;
   images scale down to fit (letterboxed) rather than being cropped */
.project-image-s img {
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--bg-3);
  display: block;
}
/* identical, background-free controls — just the arrow glyphs */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 12px;
  background: none;
  color: var(--amber-bright);
  font-weight: bold;
  font-size: 22px;
  line-height: 1;
  user-select: none;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.85);
  transition: color 0.2s, transform 0.2s;
}
.next { right: 0; }
.prev { left: 0; }
.prev:hover, .next:hover { color: var(--primary); transform: translateY(-50%) scale(1.25); }
.fade { animation: fade 1.2s; }
@keyframes fade { from { opacity: 0.4; } to { opacity: 1; } }

/* project reveal directional */
.project:nth-child(odd) .project-info,
.project:nth-child(even) .project-image,
.project:nth-child(even) .project-image-slideshow {
  opacity: 0; transform: translateX(-40px);
  transition: opacity 0.6s ease 0.2s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}
.project:nth-child(odd) .project-image,
.project:nth-child(odd) .project-image-slideshow,
.project:nth-child(even) .project-info {
  opacity: 0; transform: translateX(40px);
  transition: opacity 0.6s ease 0.3s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}
.project.visible .project-info,
.project.visible .project-image,
.project.visible .project-image-slideshow { opacity: 1; transform: translateX(0); }

.project-tags li { opacity: 0; transform: translateY(16px) scale(0.85); transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55); }
.project.visible .project-tags li { opacity: 1; transform: translateY(0) scale(1); }
.project.visible .project-tags li:nth-child(1) { transition-delay: 0.4s; }
.project.visible .project-tags li:nth-child(2) { transition-delay: 0.46s; }
.project.visible .project-tags li:nth-child(3) { transition-delay: 0.52s; }
.project.visible .project-tags li:nth-child(4) { transition-delay: 0.58s; }

@media (max-width: 740px) {
  .project { gap: 1.2rem; align-items: stretch; }
  .project-image { justify-content: flex-start; margin-top: 0.6rem; }
}

/* ============================================================
   EDUCATION timeline
   ============================================================ */
.education-timeline { position: relative; max-width: 1000px; margin: 0 auto; }
.education-timeline::after {
  content: ''; position: absolute; width: 2px; background: var(--border);
  top: 0; bottom: 0; left: 50%; margin-left: -1px;
}
.education-item { padding: 10px 40px; position: relative; width: 50%; }
.education-item:nth-child(odd) { left: 0; text-align: right; }
.education-item:nth-child(even) { left: 50%; text-align: left; }
.education-item::before {
  content: '✦'; position: absolute; color: var(--primary); font-size: 1rem;
  top: 14px; right: -9px; z-index: 2; background: var(--bg); line-height: 1;
  transition: color 0.4s, text-shadow 0.4s;
}
.education-item:nth-child(even)::before { left: -9px; right: auto; }
.education-item.hovered::before { color: var(--amber-bright); text-shadow: 0 0 12px var(--amber-bright); }

.education-content {
  background: var(--bg-2);
  color: var(--text);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 0 18px var(--shadow);
  transition: transform 0.4s, box-shadow 0.4s, border-color 0.4s;
}
.education-content:hover { transform: scale(1.02); box-shadow: 0 0 26px var(--glow); border-color: var(--primary); }
.education-content h3 { margin: 0 0 6px 0; color: var(--primary); font-size: 1.05rem; }
.education-content p { margin: 5px 0; font-size: 0.9rem; }
.education-content p strong { color: var(--cyan); }

.education-item { opacity: 0; transform: translateY(40px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16,1,0.3,1); }
.education-item.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 700px) {
  .education-timeline::after { left: 8px; margin-left: 0; }
  .education-item { width: 100%; padding-left: 40px; padding-right: 8px; text-align: left; left: 0 !important; }
  .education-item::before, .education-item:nth-child(even)::before { left: -1px; right: auto; }
}

/* ============================================================
   EXPERIENCE
   ============================================================ */
#experience { display: flex; flex-direction: column; align-items: center; }
.experience {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 22px 26px;
  margin-bottom: 1.6rem;
  width: 100%;
  max-width: 800px;
  box-shadow: 0 0 14px var(--shadow);
  opacity: 0;
  transform: translateY(50px) scale(0.97);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16,1,0.3,1), box-shadow 0.4s;
}
.experience.visible { opacity: 1; transform: translateY(0) scale(1); }
.experience:hover { transform: translateY(-5px); box-shadow: 0 10px 34px var(--glow); border-color: var(--primary); }
.experience a { text-decoration: none; }
.experience h3 { color: var(--primary); font-size: 1.2rem; margin-bottom: 1rem; font-weight: 700; }
.experience h3::before { content: "◆ "; color: var(--cyan); }
.experience p { color: var(--text); font-size: 0.92rem; margin-bottom: 0.7rem; text-align: left; line-height: 1.7; }
.experience p:nth-child(2), .experience p:nth-child(3),
.experience p:nth-child(4), .experience p:nth-child(5) { padding-left: 1.4rem; position: relative; }
.experience p:nth-child(2)::before, .experience p:nth-child(3)::before,
.experience p:nth-child(4)::before, .experience p:nth-child(5)::before {
  content: "›"; color: var(--primary); position: absolute; left: 0.4rem;
}
.experience p strong { color: var(--cyan); margin-right: 0.5rem; }

.experience h3 { opacity: 0; transform: translateX(-26px); transition: opacity 0.5s ease 0.2s, transform 0.5s cubic-bezier(0.16,1,0.3,1) 0.2s; }
.experience p { opacity: 0; transform: translateX(-18px); transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16,1,0.3,1); }
.experience.visible h3, .experience.visible p { opacity: 1; transform: translateX(0); }
.experience.visible p:nth-child(2) { transition-delay: 0.3s; }
.experience.visible p:nth-child(3) { transition-delay: 0.36s; }
.experience.visible p:nth-child(4) { transition-delay: 0.42s; }
.experience.visible p:nth-child(5) { transition-delay: 0.48s; }

/* ============================================================
   INTERESTS
   ============================================================ */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}
.interest-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  box-shadow: 0 0 16px var(--shadow);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16,1,0.3,1), box-shadow 0.4s, border-color 0.4s;
}
.interest-card.visible { opacity: 1; transform: translateY(0); }
.interest-card:hover { box-shadow: 0 8px 30px var(--glow); border-color: var(--primary); }

.card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.card-glyph { color: var(--primary); font-size: 1rem; }
.card-head h3 {
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
  flex: 1;
  text-align: left;
}
.card-tag {
  font-size: 0.62rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 1px 6px;
}
.card-body { padding: 1rem; flex: 1; text-align: left; }
.card-loading { color: var(--muted); font-size: 0.85rem; }
.card-error { color: var(--red); font-size: 0.8rem; }
.card-note { color: var(--muted); font-size: 0.68rem; margin-top: 0.8rem; line-height: 1.5; border-top: 1px dashed var(--border); padding-top: 0.6rem; }

/* games list */
.game-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, color 0.2s;
}
.game-row:last-child { border-bottom: none; }
.game-row:hover { transform: translateX(4px); color: var(--amber-bright); }
.game-art {
  width: 64px; height: 30px; flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.game-meta { min-width: 0; }
.game-name { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-sub { font-size: 0.72rem; color: var(--muted); }

/* run card */
.run-map {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.run-map svg { width: 100%; height: 100%; display: block; }
.run-map .map-bg { fill: var(--bg-2); }
.run-map .grid { stroke: var(--border-2); stroke-width: 0.6; opacity: 0.6; }
.run-map .route-glow { fill: none; stroke: var(--primary); stroke-width: 6; opacity: 0.18; stroke-linejoin: round; stroke-linecap: round; }
.run-map .route { fill: none; stroke: var(--primary); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.run-map .pt-start { fill: var(--green); stroke: var(--bg); stroke-width: 1; }
.run-map .pt-end { fill: var(--red); stroke: var(--bg); stroke-width: 1; }
.run-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  margin-top: 0.9rem;
}
.run-stats li { display: flex; flex-direction: column; }
.run-stats .stat-val { color: var(--amber-bright); font-size: 1.05rem; font-weight: 700; }
.run-stats .stat-key { color: var(--muted); font-size: 0.66rem; letter-spacing: 1px; text-transform: uppercase; }

/* books */
.books-grid { display: flex; flex-direction: column; gap: 0.9rem; }
.book-row { display: flex; gap: 0.8rem; align-items: flex-start; }
.book-cover {
  width: 46px; height: 68px; flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-3);
  box-shadow: 2px 2px 0 var(--shadow);
}
.book-cover.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1.3rem;
}
.book-meta { flex: 1; min-width: 0; }
.book-title { font-size: 0.88rem; font-weight: 500; color: var(--text); }
.book-author { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.35rem; }
.book-progress { height: 6px; background: var(--bg-3); border: 1px solid var(--border); position: relative; }
.book-progress span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--primary); transition: width 0.6s ease; }
.book-pct { font-size: 0.64rem; color: var(--muted); margin-top: 2px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.footer a { color: var(--link); text-decoration: none; }
.footer a:hover { color: var(--primary); }
@media (max-width: 500px) { .footer { flex-direction: column; gap: 0.5rem; text-align: center; padding: 1rem; } }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #crt { display: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
