@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,600;1,400&family=Press+Start+2P&display=swap');

/* ── View Transitions ─────────────────────────────────────────── */
@view-transition { navigation: auto; }

@keyframes vt-in  { from { opacity: 0; transform: translateY(8px);  } }
@keyframes vt-out { to   { opacity: 0; transform: translateY(-8px); } }

/* Root (body bg) snaps instantly — sidebar and right-panel handle themselves */
::view-transition-old(root),
::view-transition-new(root) { animation: none; }

/* Right panel slides in/out */
::view-transition-old(main-content) { animation: 140ms ease vt-out forwards; }
::view-transition-new(main-content) { animation: 200ms ease vt-in  backwards; }

/* Sidebar stays frozen */
::view-transition-old(sidebar),
::view-transition-new(sidebar) { animation: none; }

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

/* ── Variables ────────────────────────────────────────────────── */
:root {
  --bg:           #161410;
  --bg-panel:     #0e0c08;
  --border-light: #c08830;
  --border-dark:  #382614;
  --text:         #c8a060;
  --text-alt:     #e8c050;
  --text-white:   #d4c8a0;
  --link:         #e09840;
  --link-hover:   #f8d060;
  --accent:       #e07820;
  --hot-pink:     #d86048;
  --cyan:         #f0c040;
  --terminal:     'IBM Plex Mono', monospace;
  --pixel:        'Press Start 2P', monospace;
}

/* ── Base ─────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--terminal);
  font-size: 16px;
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(200,160,80,0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--text);
  line-height: 1.6;
}


::selection { background: var(--hot-pink); color: #161410; }
a { color: var(--link); text-decoration: underline; transition: color 0.1s; }
a:hover { color: var(--link-hover); }

/* ── Layout ───────────────────────────────────────────────────── */
/* (two-panel layout — see end of file) */

/* ── Marquee ──────────────────────────────────────────────────── */
.marquee-bar {
  background: #0a0806;
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  padding: 0.35rem 0;
  overflow: hidden;
  white-space: nowrap;
}
.marquee-content {
  display: inline-block;
  animation: marquee 18s linear infinite;
  font-family: var(--terminal);
  font-size: 0.9rem;
  color: var(--text-alt);
  letter-spacing: 2px;
}
@keyframes marquee { 0% { transform: translateX(100vw); } 100% { transform: translateX(-100%); } }

/* ── Dividers ─────────────────────────────────────────────────── */
.hr-stars {
  text-align: center;
  border: none;
  color: var(--text-alt);
  font-size: 0.9rem;
  margin: 2rem 0;
  letter-spacing: 4px;
}
.hr-stars::before { content: '·═══════════════════════════════·'; color: var(--border-light); }

/* ── Section header ───────────────────────────────────────────── */
.section-header {
  font-family: var(--pixel);
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.6), 0 0 8px rgba(240,192,64,0.2);
  margin-bottom: 1.25rem;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-header::before,
.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
  opacity: 0.5;
}
.section-header span { color: var(--text-alt); }

/* ── Hero / About ─────────────────────────────────────────────── */
.hero { text-align: center; padding: 2rem 0 1rem; }

.hero-title {
  font-family: var(--pixel);
  font-size: clamp(0.85rem, 3vw, 1.4rem);
  color: var(--text-alt);
  text-shadow: 2px 2px 0 #6a4820, -1px -1px 0 var(--hot-pink);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.hero-subtitle {
  font-family: var(--terminal);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-content { display: flex; gap: 1.5rem; align-items: flex-start; text-align: left; margin-top: 1.5rem; }

.photo-box { flex-shrink: 0; width: 180px; }
.photo-frame {
  width: 180px; height: 220px;
  border: 3px outset #8a6028;
  background: #0e0c08;
  overflow: hidden;
  image-rendering: pixelated;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.photo-caption { font-size: 0.75rem; color: var(--text-alt); text-align: center; margin-top: 0.35rem; }

.hero-desc { font-size: 1rem; color: var(--text-white); line-height: 1.75; }

.hero-desc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--text-white);
  line-height: 1.6;
}
.hero-desc-list > li::before {
  content: '> ';
  color: var(--cyan);
}
.hero-desc-list > li { padding-left: 0.1rem; }
.hero-desc-list > li.no-bullet::before { content: none; }

.current-roles { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.1rem; }
.role-row { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.88rem; }
.role-company { color: var(--text-alt); text-decoration: none; }
.role-company:hover { color: var(--link-hover); text-decoration: underline; }
.role-sep { color: var(--border-light); opacity: 0.6; }
.role-title { color: var(--text-white); }

.hero-desc-games-wrap { display: flex; flex-direction: column; gap: 0.35rem; }
.hero-desc-games-label { color: var(--text-alt); font-size: 0.8rem; }
.fav-games-numbered { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.fav-games-numbered li { font-size: 0.85rem; color: var(--text-white); }
.fav-games-numbered li .num { color: var(--cyan); margin-right: 0.4rem; font-size: 0.78rem; }
.honorable-mentions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.4rem; margin-top: 0.1rem; }
.honorable-mentions-label { color: var(--text-alt); font-size: 0.78rem; }
.honorable-mentions span:not(.honorable-mentions-label) {
  font-size: 0.75rem;
  color: var(--text);
  background: rgba(200,160,80,0.07);
  border: 1px solid var(--border-dark);
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
}

.role-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.role-badge { font-family: var(--terminal); font-size: 0.85rem; padding: 0.2rem 0.6rem; border: 2px outset; display: inline-block; }
.role-badge.designer   { color: #0e0c08; background: var(--cyan);    border-color: #b87830; }
.role-badge.programmer { color: #0e0c08; background: var(--hot-pink); border-color: #c86838; }
.role-badge.composer   { color: #0e0c08; background: var(--text-alt); border-color: #c8982a; }

/* ── Panels ───────────────────────────────────────────────────── */
.panel { border: 2px inset #4a3418; background: rgba(0,0,0,0.35); padding: 1.25rem; margin-bottom: 1rem; }

/* ── Education entries ────────────────────────────────────────── */
.edu-entry { margin-bottom: 0.75rem; padding-left: 1rem; border-left: 2px solid var(--border-light); }
.edu-entry .year   { color: var(--accent);     font-size: 0.9rem; }
.edu-entry .school { color: var(--cyan);        font-size: 1rem; }
.edu-entry .desc   { color: var(--text-white);  font-size: 0.9rem; }

/* ── Sub-headers ──────────────────────────────────────────────── */
.sub-header {
  font-family: var(--terminal);
  font-size: 1rem;
  color: var(--accent);
  margin: 1.25rem 0 0.75rem;
  letter-spacing: 1px;
}
.sub-header:first-child { margin-top: 0; }
.sub-header::before { content: '>> '; color: var(--border-light); }

/* ── Tabs ─────────────────────────────────────────────────────── */
.tab-bar { display: flex; flex-wrap: wrap; gap: 0; }
.tab-btn {
  font-family: var(--terminal);
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border: 2px outset #8a6028;
  background: #2a1e0e;
  color: var(--text-white);
  cursor: pointer;
}
.tab-btn:hover  { background: #3a2814; color: #fff; }
.tab-btn.active { background: var(--bg-panel); color: var(--text); border-style: inset; font-weight: bold; }

.tab-panel { display: none; border: 2px inset #4a3418; background: var(--bg-panel); padding: 1.25rem; }
.tab-panel.active { display: block; animation: tab-in 180ms ease forwards; }
@keyframes tab-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Project cards ────────────────────────────────────────────── */
.project-list { display: flex; flex-direction: column; gap: 0.75rem; }
.project-entry {
  border: 1px solid var(--border-dark);
  padding: 0.85rem;
  background: rgba(0,0,0,0.3);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: border-color 0.15s;
  position: relative;
}
.project-entry:hover { border-color: var(--text); }
.project-thumb-sm {
  width: 160px;
  flex-shrink: 0;
  border-right: 2px outset #4a3418;
  border-bottom: 2px outset #4a3418;
  background: #0a0806;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem;
  color: var(--border-light);
  overflow: hidden;
}
.project-thumb-sm img { width: 100%; height: auto; display: block; }

.steam-link {
  font-family: var(--terminal);
  font-size: 0.7rem;
  color: var(--cyan);
  text-decoration: none;
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
}
.steam-link:hover { color: var(--link-hover); text-decoration: underline; }
.project-info { padding-right: 7.5rem; }
.project-info h4 { font-family: var(--terminal); font-size: 1rem; color: var(--text-alt); margin-bottom: 0.15rem; }
.project-info p  { font-size: 0.875rem; color: var(--text-white); margin-bottom: 0.3rem; }
.project-title-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.15rem; }
.project-title-row h4 { margin-bottom: 0; }

.project-tags-row { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tag-sm {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: rgba(200,160,80,0.08);
  border: 1px solid var(--border-dark);
  color: var(--text);
}

/* ── Tag colour variants ───────────────────────────────────────── */
.tag-design  { color: var(--cyan);     background: rgba(240,192,64,0.09);  border-color: rgba(240,192,64,0.35);  }
.tag-music   { color: var(--hot-pink); background: rgba(216,96,72,0.09);   border-color: rgba(216,96,72,0.35);   }
.tag-sfx     { color: var(--accent);   background: rgba(232,184,96,0.09);  border-color: rgba(232,184,96,0.35);  }
.tag-code    { color: var(--text);     background: rgba(200,168,96,0.09);  border-color: rgba(200,168,96,0.35);  }
.tag-produce { color: var(--text-alt); background: rgba(240,230,140,0.09); border-color: rgba(240,230,140,0.35); }
.tag-write   { color: var(--link);     background: rgba(224,152,64,0.09);  border-color: rgba(224,152,64,0.35);  }
.tag-art     { color: #c8a0e0;         background: rgba(200,160,224,0.09); border-color: rgba(200,160,224,0.35); }
.tag-dev     { color: #f0a030;         background: rgba(240,160,48,0.09);  border-color: rgba(240,160,48,0.45);  }

/* ── Work game entries (education page) ───────────────────────── */
.work-games { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; }
.work-game  {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-left: 2px solid var(--border-dark);
}
.work-game-title  { color: var(--cyan); font-size: 0.875rem; margin-right: 0.1rem; }
.work-game-steam  { font-size: 0.68rem; color: var(--link); text-decoration: none; white-space: nowrap; margin-right: 0.2rem; }
.work-game-steam:hover { color: var(--link-hover); text-decoration: underline; }
.work-game-note   { width: 100%; font-size: 0.7rem; color: var(--text-white); padding-left: 0.1rem; }
.ost-links { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; margin-left: 0.25rem; }
.ost-link  { font-size: 0.8rem; color: var(--cyan); text-decoration: none; }
.ost-link:hover { color: var(--link-hover); text-decoration: underline; }

/* ── Music entries ────────────────────────────────────────────── */
.music-list { display: flex; flex-direction: column; gap: 0.5rem; }

.music-album {
  border: 1px solid var(--border-dark);
  padding: 0.75rem;
  background: rgba(0,0,0,0.3);
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-start;
  transition: border-color 0.15s;
  position: relative;
}
.music-album:hover { border-color: var(--text); }
.album-cover {
  width: 72px;
  flex-shrink: 0;
  border-right: 2px outset #4a3418;
  border-bottom: 2px outset #4a3418;
  background: #0a0806;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; color: var(--border-light);
}
.album-cover img { width: 100%; height: auto; display: block; }
.album-info { flex: 1; min-width: 0; padding-right: 7.5rem; }
.album-info h4 { font-family: var(--terminal); font-size: 0.95rem; color: var(--text-alt); margin-bottom: 0.1rem; }
.album-info .music-meta { font-size: 0.75rem; color: var(--text-white); }

.music-links {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}
.music-link-btn {
  font-family: var(--terminal);
  font-size: 0.68rem;
  color: var(--cyan);
  text-decoration: none;
  white-space: nowrap;
}
.music-link-btn:hover { color: var(--link-hover); text-decoration: underline; }

.tracks-toggle {
  font-family: var(--terminal);
  font-size: 0.68rem;
  line-height: 1;
  height: 1.3rem;
  color: var(--cyan);
  background: none;
  border: 1px solid var(--border-dark);
  padding: 0.1rem 0.45rem;
  cursor: pointer;
  margin-top: 0.4rem;
  display: inline-flex;
  align-items: center;
}
.tracks-toggle:hover { color: var(--text-alt); border-color: var(--border-light); }

.tracks-list {
  overflow: hidden;
  max-height: 0;
  width: 100%;
  border-top: 1px dashed var(--border-dark);
  padding-top: 0;
  margin-top: 0.1rem;
  transition: max-height 320ms linear, padding-top 320ms linear;
}
.tracks-list.open {
  max-height: 1800px;
  padding-top: 0.45rem;
}

.track-row {
  display: flex;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-white);
  padding: 0.12rem 0;
  border-bottom: 1px solid rgba(74,52,20,0.3);
}
.track-row:last-child { border-bottom: none; }
.track-num   { color: var(--border-light); width: 2rem; flex-shrink: 0; text-align: right; }
.track-title { flex: 1; color: var(--text-white); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-dur   { color: var(--accent); flex-shrink: 0; min-width: 2.5rem; text-align: right; }

.track-play {
  font-family: var(--terminal);
  font-size: 0.6rem;
  line-height: 1;
  width: 1.4rem;
  height: 1.4rem;
  flex-shrink: 0;
  color: var(--cyan);
  background: rgba(240,192,64,0.05);
  border: 1px solid var(--border-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.1s, border-color 0.1s, background 0.1s;
}
.track-play:hover { color: var(--text-alt); border-color: var(--border-light); background: rgba(240,192,64,0.12); }
.track-play.playing { color: var(--hot-pink); border-color: var(--hot-pink); background: rgba(216,96,72,0.1); }

/* ── Covers grid ── */
.cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.cover-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-dark);
  background: var(--bg-panel);
  overflow: hidden;
  transition: border-color 0.1s;
}
.cover-card:hover { border-color: var(--text); }
.cover-media {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.cover-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.cover-embed {
  position: absolute;
  inset: 0;
  display: none;
}
.cover-embed.open { display: block; }
.cover-embed iframe { width: 100%; height: 100%; border: none; display: block; }
.cover-info {
  padding: 0.45rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}
.cover-title {
  font-family: var(--terminal);
  font-size: 0.68rem;
  color: var(--text-white);
  line-height: 1.4;
}
.cover-watch-btn {
  font-family: var(--terminal);
  font-size: 0.62rem;
  color: var(--text-alt);
  background: none;
  border: 1px solid var(--border-dark);
  padding: 0.22rem 0.4rem;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: color 0.1s, border-color 0.1s;
  align-self: flex-start;
  margin-top: auto;
}
.cover-watch-btn:hover { color: var(--link-hover); border-color: var(--border-light); }

/* ── Track scrubber ───────────────────────────────────────────── */
.track-scrubber {
  display: none;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  min-width: 0;
}
.track-scrubber.visible {
  display: flex;
  animation: scrubber-in 0.2s ease both;
}
@keyframes scrubber-in {
  from { opacity: 0; transform: scaleX(0.35); transform-origin: left; }
  to   { opacity: 1; transform: scaleX(1);    transform-origin: left; }
}

.track-row.active-track .track-title { flex: 0 0 auto; }
.track-row.active-track .track-dur   { display: none; }

.track-seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 2px;
  background: var(--border-dark);
  outline: none;
  cursor: pointer;
}
.track-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 7px;
  height: 7px;
  background: var(--accent);
  cursor: pointer;
  border: 1px solid var(--border-light);
}
.track-seek::-moz-range-thumb {
  width: 7px;
  height: 7px;
  background: var(--accent);
  cursor: pointer;
  border: 1px solid var(--border-light);
  border-radius: 0;
}
.track-seek::-moz-range-track { height: 2px; background: var(--border-dark); }
.track-seek:hover::-webkit-slider-thumb { background: var(--text-alt); border-color: var(--text-alt); }

.track-time {
  font-size: 0.62rem;
  color: var(--accent);
  flex-shrink: 0;
  white-space: nowrap;
  font-family: var(--terminal);
  min-width: 3.5rem;
  text-align: right;
}

/* ── Dev badge ────────────────────────────────────────────────── */
.dev-badge {
  font-family: var(--terminal);
  font-size: 0.58rem;
  color: var(--hot-pink);
  letter-spacing: 0.5px;
  opacity: 0.9;
  position: absolute;
  bottom: 0.4rem;
  right: 0.5rem;
}

/* ── Game embed ───────────────────────────────────────────────── */
.game-embed-toggle {
  font-family: var(--terminal);
  font-size: 0.68rem;
  line-height: 1;
  height: 1.3rem;
  color: var(--link-hover);
  text-shadow: 0 0 6px rgba(248,208,96,0.55);
  background: none;
  border: 1px solid rgba(248,208,96,0.35);
  padding: 0.1rem 0.45rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.game-embed-toggle:hover { color: #fff; text-shadow: 0 0 8px rgba(248,208,96,0.85); border-color: var(--link-hover); }

.game-embed-wrap {
  display: none;
  border-top: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
  background: #0a0806;
  padding: 0.75rem;
  width: 100%;
}
.game-embed-wrap.open { display: block; }
.game-embed-wrap iframe {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  border: 2px inset #4a3418;
}

/* ── Research entries ─────────────────────────────────────────── */
.research-entry { border: 1px solid var(--border-dark); padding: 0.85rem; background: rgba(0,0,0,0.3); margin-bottom: 1.25rem; }
.research-entry h4 { color: var(--cyan); font-size: 0.95rem; margin-bottom: 0.25rem; }
.research-entry p  { color: var(--text-white); font-size: 0.875rem; }

/* ── CV panel ─────────────────────────────────────────────────── */
.cv-panel { text-align: center; padding: 1.5rem; }
.cv-panel p { color: var(--text-white); margin-bottom: 1rem; font-size: 0.9rem; }

.btn-90s {
  font-family: var(--terminal);
  font-size: 1rem;
  padding: 0.5rem 1.5rem;
  border: 3px outset #8a6028;
  background: linear-gradient(180deg, #3a2814 0%, #161410 100%);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  letter-spacing: 1px;
}
.btn-90s:hover { border-style: inset; background: linear-gradient(180deg, #2a1e0a 0%, #0e0c08 100%); color: var(--text-alt); }

/* ── Links list ───────────────────────────────────────────────── */
.links-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}
.link-entry {
  border: 2px outset #4a3418;
  background: #1a1208;
  padding: 0.65rem 0.85rem;
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none;
  color: var(--text-white);
}
.link-entry:hover { background: #2a1e0e; border-style: inset; color: var(--text-alt); opacity: 1; }
.link-entry .link-ico  { font-size: 1.1rem; width: 24px; text-align: center; }
.link-entry .link-name { font-size: 0.9rem; color: var(--link); }

/* ── Footer ───────────────────────────────────────────────────── */
.footer-90s {
  text-align: center;
  padding: 1.5rem 0;
  border-top: 3px double var(--border-light);
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--text-white);
}
.footer-90s .counter {
  display: inline-block;
  border: 2px inset #4a3418;
  background: #0a0806;
  padding: 0.15rem 0.6rem;
  font-family: var(--pixel);
  font-size: 0.5rem;
  color: var(--text);
  margin: 0.5rem 0;
  letter-spacing: 2px;
}

/* ── Misc ─────────────────────────────────────────────────────── */
.blink { animation: blink90 1s step-end infinite; }
@keyframes blink90 { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.construction {
  font-family: var(--pixel);
  font-size: 0.55rem;
  color: var(--text-alt);
  text-align: center;
  margin: 0.5rem 0;
  letter-spacing: 1px;
}
.ascii-art {
  font-family: var(--terminal);
  font-size: 0.65rem;
  color: var(--border-light);
  text-align: center;
  line-height: 1.2;
  white-space: pre;
  margin: 0.5rem 0;
  opacity: 0.6;
}

/* ── Page entry animation ─────────────────────────────────────── */
@keyframes page-load { from { opacity: 0; } }

/* ── Two-panel layout ─────────────────────────────────────────── */
:root { --left-panel-w: 342px; --minimap-size: 280px; }

.left-panel {
  position: fixed; top: 0; left: 0;
  width: var(--left-panel-w); height: 100vh;
  overflow-y: hidden; background: var(--bg-panel);
  border-right: 2px solid var(--border-dark);
  display: flex; flex-direction: column; z-index: 50;
  view-transition-name: sidebar;
}
.left-panel-top {
  display: flex; flex-direction: column; align-items: center;
  border-bottom: 2px solid var(--border-dark); flex-shrink: 0;
  background: var(--bg-panel);
}

/* ── Minimap ── */
.minimap-wrap {
  width: var(--minimap-size); height: var(--minimap-size);
  max-width: 100%;
  flex-shrink: 0; border-bottom: 1px solid var(--border-dark);
  overflow: hidden; image-rendering: pixelated;
}
.minimap-wrap svg { width: 100%; height: 100%; display: block; }
.minimap-wrap svg a { cursor: pointer; }
.minimap-wrap svg a rect { transition: filter 0.15s; }
.minimap-wrap svg a:hover rect { filter: brightness(1.8) drop-shadow(0 0 3px #f8d060); }
.minimap-wrap svg text { font-family: var(--pixel); pointer-events: none; }
.minimap-wrap svg a text { visibility: hidden; }
.minimap-wrap svg a:hover text { visibility: visible; }
.minimap-dot-current rect { animation: dot-blink 1.8s step-end infinite; }
@keyframes dot-blink { 50% { opacity: 0; } }

/* ── Tower warning lights ── */
@keyframes tower-blink { 50% { opacity: 0; } }
.tower-light   { animation: tower-blink 2.6s step-end infinite; }
.tower-light-2 { animation: tower-blink 2.6s step-end 1.3s infinite; }

/* ── Side nav ── */
.side-nav { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.side-nav a {
  font-family: var(--terminal); font-size: 0.68rem; color: var(--text-white);
  text-decoration: none; padding: 0.5rem 0.4rem;
  border: 2px outset #8a6028; background: #2a1e0e;
  letter-spacing: 0.3px; display: flex; align-items: center; justify-content: center;
  line-height: 1.4; text-align: center;
  transition: color 0.1s, background 0.1s;
}
.side-nav a:hover { background: #3a2814; color: #fff; }
.side-nav a.active {
  background: var(--bg-panel); color: var(--text-alt);
  border-style: inset; font-weight: bold;
}
.side-nav a[href="selected-portfolio.html"] {
  color: #40c8d0;
  text-shadow: 0 0 8px rgba(64,200,208,0.55);
}
.side-nav a[href="selected-portfolio.html"]:hover { color: #80e8f0; }
.side-nav a[href="selected-portfolio.html"].active { color: #40c8d0; text-shadow: 0 0 10px rgba(64,200,208,0.7); }

/* ── Left about panel ── */
.left-about { padding: 0.85rem 0.85rem 1.5rem; flex: 1; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--border-dark) transparent; }
.left-about .about-name {
  font-family: var(--pixel); font-size: 0.8rem; color: var(--text-alt);
  text-shadow: 1px 1px 0 #6a4820; margin-bottom: 0.3rem; line-height: 1.8;
  text-align: center; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.left-about .about-section-label {
  font-family: var(--terminal); font-size: 0.8rem; color: var(--text-alt);
  margin: 0.6rem 0 0.3rem; letter-spacing: 0.5px;
}
.left-about .about-roles { display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 0.5rem; }
.left-about .about-roles .role-row { font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.left-about .about-genres { display: flex; flex-wrap: wrap; gap: 0.2rem 0.25rem; margin-bottom: 0.5rem; }
.left-about .about-fav-games { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.left-about .about-fav-games li { font-size: 0.82rem; color: var(--text-white); padding: 0.1rem 0; }
.left-about .about-fav-games li .fav-num { color: var(--cyan); margin-right: 0.3rem; font-size: 0.72rem; }
.left-about .about-links { display: flex; flex-direction: column; gap: 0.25rem; }
.left-about .about-links a {
  font-family: var(--terminal); font-size: 0.88rem; color: var(--link);
  text-decoration: none; display: flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.35rem; border: 1px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}
.left-about .about-links a:hover { color: var(--link-hover); border-color: var(--border-dark); }

/* ── Bottom link buttons ── */
.left-links {
  display: grid; grid-template-columns: repeat(3, 1fr);
  flex-shrink: 0; border-top: 2px solid var(--border-dark);
}
.left-links a {
  font-family: var(--terminal); font-size: 0.62rem; color: var(--text-white);
  text-decoration: none; padding: 0.6rem 0.3rem;
  border: 2px outset #8a6028; background: #2a1e0e;
  text-align: center; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; display: block;
  transition: color 0.1s, background 0.1s;
}
.left-links a:hover { background: #3a2814; color: #fff; }

/* ── About photo ── */
.about-photo { text-align: center; padding: 0.5rem 0 0.4rem; }
.about-photo-frame {
  display: inline-block; width: 110px; height: 130px;
  border: 2px outset #8a6028; background: #0a0806;
  overflow: hidden; image-rendering: pixelated;
}
.about-photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }

/* ── About tagline ── */
.about-tagline {
  font-family: var(--terminal); font-size: 0.88rem; color: var(--text-white);
  margin-bottom: 0.65rem; line-height: 1.55; text-align: center;
}

/* ── Expandable sidebar sections ── */
.about-expandable { margin-bottom: 0.15rem; }
.about-expand-btn {
  font-family: var(--terminal); font-size: 0.8rem; color: var(--text-alt);
  background: none; border: none; border-bottom: 1px solid var(--border-dark);
  padding: 0.42rem 0; cursor: pointer; width: 100%; text-align: left;
  letter-spacing: 0.3px; display: flex; align-items: center;
  transition: color 0.1s;
}
.about-expand-btn::before { content: '▶  '; color: var(--border-light); font-size: 0.65rem; }
.about-expand-btn.open::before { content: '▼  '; color: var(--link-hover); }
.about-expand-btn:hover { color: var(--link-hover); }
.about-expand-btn.open { color: var(--link-hover); }
.expand-content { display: none; padding: 0.45rem 0 0.3rem 0.35rem; }
.about-expandable.open .expand-content { display: block; }

/* ── World building static label ── */
.about-worldbuilding {
  font-family: var(--terminal); font-size: 0.8rem; color: var(--text);
  padding: 0.42rem 0; border-bottom: 1px solid var(--border-dark);
  margin-bottom: 0.15rem;
}

/* ── Select Mission screen ── */
.page-home .right-content { display: flex; flex-direction: column; }
.page-home .footer-90s   { margin-top: auto; }

.select-mission {
  display: flex; flex-direction: row; align-items: center; gap: 0.75rem;
  padding-top: calc(var(--minimap-size) - 3.2rem - 1.5rem);
}
.select-mission-text {
  font-family: var(--pixel); font-size: 0.6rem; color: var(--text-alt);
  text-shadow: 0 0 12px rgba(248,208,96,0.4), 2px 2px 0 rgba(0,0,0,0.7);
  letter-spacing: 2px; line-height: 2.8; text-align: left;
  animation: mission-pulse 2.5s ease-in-out infinite;
}
@keyframes mission-pulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 12px rgba(248,208,96,0.4), 2px 2px 0 rgba(0,0,0,0.7); }
  50% { opacity: 0.6; text-shadow: 0 0 22px rgba(248,208,96,0.75), 2px 2px 0 rgba(0,0,0,0.7); }
}
.select-mission-arrow {
  font-size: 1.8rem; color: var(--link-hover);
  animation: arrow-pulse 1.1s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(248,208,96,0.55);
  flex-shrink: 0;
}
@keyframes arrow-pulse {
  0%, 100% { transform: translateX(0);    opacity: 1;   }
  50%       { transform: translateX(-8px); opacity: 0.45; }
}

/* ── Right panel ── */
.right-panel {
  margin-left: var(--left-panel-w); min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ── Page title bar with line animation ── */
.page-title-bar {
  display: flex; align-items: center;
  padding: 0.85rem 1.5rem 0.85rem 0;
  border-bottom: 1px solid var(--border-dark);
  flex-shrink: 0; min-height: 3.2rem; overflow: hidden;
}
.page-title-line {
  flex: 1; height: 2px; background: var(--border-light);
  transform-origin: left center; transform: scaleX(0);
  animation: line-draw 0.28s ease-out forwards;
  animation-play-state: paused;
}
@keyframes line-draw   { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes line-undraw { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes vert-draw   { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes vert-undraw { from { transform: scaleY(1); } to { transform: scaleY(0); } }
.page-title-text {
  font-family: var(--pixel); font-size: 0.6rem; color: var(--text-alt);
  text-shadow: 0 0 10px rgba(248,208,96,0.45), 2px 2px 0 rgba(0,0,0,0.7);
  letter-spacing: 2px; white-space: nowrap; margin-left: 0.65rem;
  opacity: 0; animation: title-appear 0.12s ease forwards;
  animation-play-state: paused;
}
@keyframes title-appear { to { opacity: 1; } }

/* ── Right content area ── */
.right-content { padding: 1.5rem 1.75rem 2rem; flex: 1; animation: page-load 0.2s ease both; animation-play-state: paused; }

/* ── Mobile menu button (hidden on desktop) ── */
.mobile-menu-btn { display: none; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 860px) {
  :root { --left-panel-w: 262px; --minimap-size: 220px; }
  .side-nav a { font-size: 0.65rem; padding: 0.38rem 0.5rem; }
  .left-about .about-name { font-size: 0.45rem; }
  .about-photo-frame { width: 90px; height: 108px; }
  .about-tagline { font-size: 0.68rem; }
  .about-expand-btn { font-size: 0.72rem; }
}
@media (max-width: 640px) {
  .left-panel { transform: translateX(-100%); transition: transform 0.25s ease; z-index: 200; }
  .left-panel.open { transform: translateX(0); }
  .right-panel { margin-left: 0; }
  .mobile-menu-btn {
    display: flex !important; position: fixed; top: 0.6rem; left: 0.6rem; z-index: 300;
    font-family: var(--terminal); font-size: 0.7rem; background: var(--bg-panel);
    border: 1px solid var(--border-light); color: var(--text-alt);
    padding: 0.3rem 0.5rem; cursor: pointer;
  }
  .project-entry  { flex-direction: column; }
  .project-thumb-sm { width: 100%; height: auto; }
  .tab-btn        { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
}
