/* ============================================
   TOKENS
   ============================================ */
:root {
  --void:      #32021F; /* background */
  --void-2:    #45092b; /* lighter panel bg, derived from void */
  --blue:      #274C77; /* window chrome / borders */
  --lavender:  #998FC7; /* headings / primary text */
  --teal:      #53917E; /* links / accents */
  --mint:      #AFD5AA; /* highlights / badges */
  --ink:       #000000; /* shadows / outlines */

  --font-display: 'Silkscreen', monospace;
  --font-body: 'Space Mono', monospace;
}

/* ============================================
   PAGE THEMES
   override root tokens per page via body[data-theme].
   Every component below reads these same variables,
   so re-theming a page is just redefining the palette —
   no component CSS needs to change.
   ============================================ */
body[data-theme="hoard"] {
  --void:     #240701;
  --void-2:   #401004;
  --blue:     #7a2c0f;
  --lavender: #f4a261;
  --teal:     #e63946;
  --mint:     #ffb703;
}
body[data-theme="pact"] {
  --void:     #0d0221;
  --void-2:   #1a0938;
  --blue:     #3d2b6b;
  --lavender: #c9a4ff;
  --teal:     #7b2ff7;
  --mint:     #e0c3fc;
}
body[data-theme="playlist"] {
  --void:     #1a0b2e;
  --void-2:   #2d1b4e;
  --blue:     #4b2c6f;
  --lavender: #ff6ec7;
  --teal:     #00d9ff;
  --mint:     #f6f740;
}
body[data-theme="setup"] {
  --void:     #000900;
  --void-2:   #001a05;
  --blue:     #0d3b1e;
  --lavender: #39ff14;
  --teal:     #00ff41;
  --mint:     #7fff9f;
}

/* ============================================
   RESET / BASE
   ============================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(153,143,199,0.08), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(83,145,126,0.10), transparent 45%);
  color: var(--lavender);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color .4s ease, color .4s ease;
  cursor: auto;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0 0 .5em; letter-spacing: .5px; }

a {
  color: var(--mint);
  text-decoration: none;
  border-bottom: 1px dashed var(--teal);
}
a:hover { color: var(--teal); border-bottom-color: var(--mint); }

a:focus-visible,
button:focus-visible {
  outline: 2px dashed var(--mint);
  outline-offset: 3px;
}

/* faint CRT scanline overlay */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.12) 0px,
    rgba(0,0,0,0.12) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: .25;
  mix-blend-mode: multiply;
}

/* ============================================
   BOOT SCREEN
   ============================================ */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #000;
  color: var(--mint);
  font-family: var(--font-display);
  font-size: .8rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  animation: boot-fade 1.7s ease forwards;
  pointer-events: none;
}
.boot-screen p {
  margin: .25rem 0;
  opacity: 0;
  animation: boot-line-in .25s ease forwards;
}
.boot-screen p:nth-child(1) { animation-delay: .05s; }
.boot-screen p:nth-child(2) { animation-delay: .3s; }
.boot-screen p:nth-child(3) { animation-delay: .55s; }
.boot-screen p:nth-child(4) { animation-delay: .85s; }
@keyframes boot-line-in { to { opacity: 1; } }
@keyframes boot-fade {
  0%, 65% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .boot-screen { display: none; }
}

/* ============================================
   CURSOR TRAIL + PARALLAX BACKDROP
   ============================================ */
.bg-parallax {
  position: fixed;
  inset: -6%;
  z-index: -1;
  background-image: radial-gradient(rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 36px 36px;
  will-change: transform;
}

/* ============================================
   TASKBAR
   ============================================ */
.taskbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .6rem 1rem;
  background: linear-gradient(180deg, var(--blue), #1c3654);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 3px 0 rgba(0,0,0,.4);
}

.start-btn {
  font-family: var(--font-display);
  font-size: .7rem;
  background: var(--lavender);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: .5rem .7rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.start-btn:active { box-shadow: none; transform: translate(2px, 2px); }

.nav-menu {
  display: flex;
  gap: 1.1rem;
  flex: 1;
  flex-wrap: wrap;
}
.nav-menu a {
  font-family: var(--font-display);
  font-size: .68rem;
  color: var(--mint);
  border-bottom: none;
  padding: .3rem .2rem;
}
.nav-menu a:hover { color: #fff; text-shadow: 0 0 6px var(--mint); }
.nav-menu a.active {
  color: #fff;
  text-shadow: 0 0 6px var(--mint);
  border-bottom: 2px solid var(--mint);
}

.taskbar-clock {
  font-family: var(--font-body);
  font-size: .8rem;
  color: var(--mint);
  background: rgba(0,0,0,.35);
  border: 1px solid var(--ink);
  padding: .3rem .55rem;
  white-space: nowrap;
}

.sound-toggle {
  font-family: var(--font-display);
  font-size: .8rem;
  background: rgba(0,0,0,.35);
  color: var(--mint);
  border: 1px solid var(--ink);
  padding: .3rem .5rem;
  cursor: pointer;
  line-height: 1;
}
.sound-toggle:hover { color: #fff; }

@media (max-width: 640px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--blue);
    border-bottom: 2px solid var(--ink);
    padding: .5rem 1rem 1rem;
  }
  .nav-menu.open { display: flex; }
}

/* ============================================
   TICKER / MARQUEE
   ============================================ */
.ticker {
  overflow: hidden;
  background: var(--ink);
  border-bottom: 2px solid var(--blue);
  white-space: nowrap;
  padding: .4rem 0;
}
.ticker-track {
  display: inline-flex;
  width: max-content;
  animation: scroll-ticker 28s linear infinite;
}
.ticker-track span {
  font-family: var(--font-body);
  font-size: .78rem;
  color: var(--mint);
  padding-right: 2rem;
}
.ticker:hover .ticker-track { animation-play-state: paused; }

@keyframes scroll-ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================
   LAYOUT / SECTIONS
   ============================================ */
main { max-width: 900px; margin: 0 auto; padding: 0 1.2rem; }

.section { padding: 3.5rem 0; border-bottom: 1px dashed rgba(153,143,199,.25); }
.section:last-of-type { border-bottom: none; }

.section-heading {
  font-size: 1.4rem;
  color: var(--mint);
  display: flex;
  align-items: baseline;
  gap: .6rem;
}
.section-heading .tag {
  font-size: .7rem;
  color: var(--ink);
  background: var(--teal);
  padding: .2rem .4rem;
}

.section-intro { max-width: 60ch; color: var(--lavender); opacity: .9; }
.hint { font-size: .75rem; opacity: .55; margin-top: 1rem; }

/* ============================================
   WINDOW COMPONENT (win95-esque chrome)
   ============================================ */
.window {
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(0,0,0,.5);
  background: var(--void-2);
  margin-top: 1.5rem;
}
.window-titlebar {
  background: linear-gradient(90deg, var(--blue), var(--teal));
  color: var(--mint);
  font-family: var(--font-display);
  font-size: .65rem;
  padding: .5rem .7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
}
.window-dots { display: inline-flex; gap: .3rem; }
.window-dots i {
  width: 9px; height: 9px;
  background: var(--void);
  border: 1px solid var(--ink);
  display: inline-block;
}
.window-body { padding: 1.4rem; }

/* ============================================
   HERO
   ============================================ */
.hero { padding-top: 2.5rem; }
.hero-window .window-body { text-align: left; }

.pixel-title {
  font-size: clamp(2rem, 7vw, 3.2rem);
  color: var(--mint);
  text-shadow:
    3px 3px 0 var(--blue),
    6px 6px 0 var(--ink);
  margin-bottom: .3rem;
}
.subtitle { font-size: .85rem; opacity: .85; margin-top: 0; }

.terminal {
  background: #000;
  border: 2px solid var(--blue);
  padding: 1rem 1.1rem;
  margin: 1.4rem 0;
  font-size: .82rem;
  color: var(--mint);
}
.terminal .prompt { margin: 0 0 .5rem; color: var(--teal); }
.terminal .prompt::before { content: "guest@portfolio:~$ "; color: var(--lavender); }
.type-line::after {
  content: "▌";
  animation: blink 1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-buttons { display: flex; gap: .8rem; flex-wrap: wrap; }
.pixel-btn {
  font-family: var(--font-display);
  font-size: .68rem;
  background: var(--mint);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: .6rem .9rem;
  box-shadow: 3px 3px 0 var(--ink);
  border-bottom-style: solid;
  cursor: pointer;
}
.pixel-btn:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.pixel-btn-alt { background: var(--teal); color: var(--void); }

/* ============================================
   HOME — REDESIGNED LAYOUT
   ============================================ */
body[data-theme="home"] main { max-width: 1120px; }

.home-hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.6rem;
  align-items: stretch;
}
.home-hero-grid .hero-window,
.home-hero-grid .quicklaunch-panel { margin-top: 0; height: 100%; }
.quicklaunch-panel .window-body { padding: 1.2rem; display: flex; flex-direction: column; }
.quicklaunch-panel .tile-grid { grid-template-columns: repeat(2, 1fr); margin-top: 0; flex: 1; }

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  align-items: start;
}
.dashboard-row .window { margin-top: 0; }

@media (max-width: 760px) {
  .home-hero-grid { grid-template-columns: 1fr; }
  .dashboard-row { grid-template-columns: 1fr; }
}

/* ============================================
   HOME — QUICK-LINK TILES
   ============================================ */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 2.2rem;
}
.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1rem .6rem;
  border: 2px solid var(--ink);
  background: var(--void-2);
  box-shadow: 3px 3px 0 rgba(0,0,0,.5);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.app-tile:hover {
  transform: translateY(-3px);
  box-shadow: 5px 5px 0 rgba(0,0,0,.5);
  border-color: var(--mint);
}
.tile-icon {
  font-size: 1.6rem;
  line-height: 1;
}
.tile-label {
  font-family: var(--font-display);
  font-size: .62rem;
  color: var(--mint);
  text-align: center;
}

/* ============================================
   HOME — CURRENTLY.EXE
   ============================================ */
.currently-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.currently-item {
  border: 1px dashed rgba(153,143,199,.35);
  padding: .8rem .9rem;
}
.currently-label {
  font-family: var(--font-display);
  font-size: .6rem;
  color: var(--teal);
  display: block;
  margin-bottom: .35rem;
}
.currently-value {
  font-size: .82rem;
  color: var(--lavender);
}

/* ============================================
   HOME — UPDATES / CHANGELOG
   ============================================ */
.changelog { display: flex; flex-direction: column; gap: 0; }
.log-entry {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: .8rem;
  padding: .55rem .1rem;
  border-bottom: 1px dashed rgba(153,143,199,.2);
  font-size: .8rem;
}
.log-entry:last-child { border-bottom: none; }
.log-date {
  font-family: var(--font-display);
  font-size: .6rem;
  color: var(--teal);
  white-space: nowrap;
}
.log-text { color: var(--lavender); }

@media (max-width: 560px) {
  .log-entry { grid-template-columns: 1fr; gap: .2rem; }
}

/* ============================================
   DECK NAME / SUBHEADINGS (Magic + D&D sections)
   ============================================ */
.deck-name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--mint);
  margin: 0 0 .4rem;
}
.deck-colors {
  font-family: var(--font-body);
  font-size: .7rem;
  color: var(--teal);
  font-weight: normal;
}
.subheading {
  font-family: var(--font-display);
  font-size: .85rem;
  color: var(--lavender);
  margin: 2.2rem 0 0;
}

/* ============================================
   MTG STATS BAR
   ============================================ */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 1.8rem;
  padding: 1rem 1.2rem;
  border: 2px dashed var(--teal);
  border-radius: 4px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--mint);
  text-shadow: 0 0 8px rgba(0,0,0,.4);
}
.stat-label {
  font-size: .65rem;
  opacity: .75;
  text-align: center;
  margin-top: .25rem;
}

/* ============================================
   D&D CHARACTER SHEET LAYOUT
   ============================================ */
.char-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.6rem;
  align-items: start;
}
.char-portrait {
  width: 140px;
  height: 140px;
  border: 2px solid var(--ink);
  background:
    linear-gradient(var(--void-2), var(--void-2)) content-box,
    repeating-conic-gradient(var(--blue) 0% 25%, var(--lavender) 0% 50%) 0 0 / 24px 24px;
}
.char-meta {
  font-size: .78rem;
  color: var(--teal);
  margin: 0 0 1rem;
}
.char-trait {
  font-size: .82rem;
  margin: .5rem 0;
}
.char-trait strong { color: var(--mint); }

@media (max-width: 560px) {
  .char-grid { grid-template-columns: 1fr; }
  .char-portrait { margin: 0 auto; }
}

/* ============================================
   DICE ROLLER
   ============================================ */
.dice-widget { max-width: 340px; }
.dice-body {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.dice-result {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--mint);
  min-width: 3ch;
  text-align: center;
  border: 2px solid var(--ink);
  padding: .4rem .8rem;
  background: var(--void);
  box-shadow: 3px 3px 0 var(--ink);
  transition: color .15s ease, text-shadow .15s ease;
}
.dice-result.crit { color: #ffd700; text-shadow: 0 0 10px #ffd700; }
.dice-result.fail { color: #ff4d4d; text-shadow: 0 0 10px #ff4d4d; }

/* ============================================
   ART — SCRAPBOOK GRID (signature element)
   ============================================ */
.scrap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 2.2rem 1.6rem;
  margin-top: 2.2rem;
}

.scrap-card {
  position: relative;
  display: block;
  background: var(--void-2);
  border: 1px solid var(--blue);
  padding: .6rem .6rem .9rem;
  transform: rotate(var(--tilt, 0deg));
  box-shadow: 3px 4px 0 rgba(0,0,0,.55);
  transition: transform .18s ease, box-shadow .18s ease;
}
.scrap-card:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 5px 7px 0 rgba(0,0,0,.55);
  border-color: var(--mint);
}

.washi {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 62px;
  height: 20px;
  transform: translateX(-50%) rotate(-3deg);
  background: repeating-linear-gradient(
    45deg,
    var(--mint), var(--mint) 5px,
    var(--teal) 5px, var(--teal) 10px
  );
  opacity: .55;
}

.scrap-thumb {
  width: 100%;
  aspect-ratio: 63 / 88;
  border: 1px solid var(--ink);
  border-radius: 5% / 3.6%;
  display: block;
  object-fit: contain;
  overflow: hidden;
}
.thumb-a { background: linear-gradient(135deg, var(--blue), var(--lavender)); }
.thumb-b { background: linear-gradient(135deg, var(--teal), var(--mint)); }
.thumb-c { background: linear-gradient(135deg, var(--lavender), var(--teal)); }
.thumb-d { background: linear-gradient(135deg, var(--void), var(--blue)); }

.scrap-caption {
  font-size: .72rem;
  text-align: center;
  color: var(--lavender);
  margin: .6rem 0 0;
}
.scrap-caption span { opacity: .6; }

/* ============================================
   PLAYLIST — VINYL CRATE
   ============================================ */
.crate-spotlight {
  margin-top: 1.6rem;
  padding: .8rem 1.2rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: linear-gradient(90deg, var(--void-2), var(--blue), var(--void-2));
  background-size: 200% 100%;
  animation: spotlight-glow 6s ease-in-out infinite;
  box-shadow: 4px 4px 0 rgba(0,0,0,.5);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem;
}
@keyframes spotlight-glow {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}
.spotlight-label {
  font-family: var(--font-display);
  font-size: .62rem;
  color: var(--mint);
  background: var(--ink);
  padding: .2rem .5rem;
  border-radius: 3px;
}
.spotlight-artist {
  font-family: var(--font-display);
  font-size: .95rem;
  color: #fff;
  text-shadow: 0 0 8px var(--mint);
}

.vinyl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 2.6rem 1.4rem;
  margin-top: 2.4rem;
}

.vinyl-sleeve {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 rgba(0,0,0,.55);
  text-decoration: none;
  overflow: visible;
  background: var(--void-2);
  transition: transform .25s ease;
}
.vinyl-sleeve:hover { transform: translateY(-4px) rotate(-1deg); }

.sleeve-blue     { --accent: var(--mint); }
.sleeve-lavender { --accent: var(--blue); }
.sleeve-teal     { --accent: var(--lavender); }
.sleeve-mint     { --accent: var(--teal); }

.cover-art {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-size: cover;
  background-position: center;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,.4);
  transition: transform .4s ease, box-shadow .4s ease;
}
.vinyl-sleeve:hover .cover-art {
  transform: translateX(-8%) rotate(-3deg);
  box-shadow: -8px 6px 14px rgba(0,0,0,.55);
}

.vinyl-disc {
  position: absolute;
  top: 50%;
  left: 8%;
  width: 84%;
  aspect-ratio: 1 / 1;
  transform: translate(0, -50%);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center,
      #111 0, #111 2px,
      #222 2px, #222 4px
    );
  border: 1px solid #000;
  box-shadow: 0 0 0 1px rgba(255,255,255,.05) inset;
  z-index: 1;
  transition: transform .45s cubic-bezier(.2,.7,.3,1);
  opacity: .97;
}
.vinyl-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34%;
  height: 34%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: var(--accent);
}

.vinyl-sleeve:hover .vinyl-disc {
  transform: translate(62%, -50%);
  animation: spin-disc 2.4s linear infinite;
}
@keyframes spin-disc { to { transform: translate(62%, -50%) rotate(360deg); } }

.sleeve-face {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: .5rem .55rem;
  background: linear-gradient(to top, rgba(0,0,0,.8), transparent 60%);
  pointer-events: none;
  border-radius: 2px;
}
.sleeve-name {
  font-family: var(--font-display);
  font-size: .64rem;
  color: #fff;
  line-height: 1.25;
}
.sleeve-vibe {
  font-family: var(--font-body);
  font-size: .58rem;
  color: var(--mint);
  opacity: .9;
}

/* ============================================
   CODE — FILE LIST
   ============================================ */
.file-list { display: flex; flex-direction: column; gap: .1rem; }
.file-row {
  display: grid;
  grid-template-columns: auto 9rem 1fr auto;
  align-items: center;
  gap: .8rem;
  padding: .6rem .4rem;
  border-bottom: 1px dashed rgba(153,143,199,.25);
  border-bottom-width: 1px;
  color: var(--lavender);
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: rgba(83,145,126,.12); }
.file-name { font-family: var(--font-display); font-size: .68rem; color: var(--mint); }
.file-desc { font-size: .78rem; opacity: .8; }
.file-tags { font-size: .68rem; color: var(--teal); white-space: nowrap; }

@media (max-width: 560px) {
  .file-row { grid-template-columns: auto 1fr; }
  .file-desc, .file-tags { grid-column: 2; }
}

/* ============================================
   ABOUT
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.6rem;
  align-items: start;
  margin-top: 1.8rem;
}
.pixel-avatar {
  width: 120px;
  height: 120px;
  background:
    linear-gradient(var(--void-2), var(--void-2)) content-box,
    repeating-conic-gradient(var(--blue) 0% 25%, var(--teal) 0% 50%) 0 0 / 20px 20px;
  border: 2px solid var(--ink);
}
.about-terminal p { margin: 0 0 .7rem; font-size: .85rem; }
.about-terminal p:last-child { margin-bottom: 0; }

@media (max-width: 560px) {
  .about-grid { grid-template-columns: 1fr; }
  .pixel-avatar { margin: 0 auto; }
}

/* ============================================
   LINKS
   ============================================ */
.link-list { list-style: none; padding: 0; margin: 1.6rem 0; font-size: .9rem; }
.link-list li { margin-bottom: .5rem; }

.button-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.pixel-button-88 {
  width: 88px;
  height: 31px;
  border: 2px solid var(--ink);
  background: var(--blue);
  color: var(--mint);
  font-family: var(--font-display);
  font-size: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.1;
  padding: 2px;
}

/* ============================================
   404 PAGE
   ============================================ */
.error-page {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem;
}
.error-window { max-width: 480px; width: 100%; }
.error-code {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 12vw, 4rem);
  color: var(--mint);
  text-shadow: 3px 3px 0 var(--blue), 6px 6px 0 var(--ink);
  margin: 0 0 .3rem;
}
.error-msg { font-size: .9rem; margin-bottom: 1.4rem; }

/* ============================================
   FOOTER
   ============================================ */
.pixel-divider {
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--blue) 0 10px,
    var(--teal) 10px 20px,
    var(--mint) 20px 30px
  );
}
.site-footer { padding: 1.6rem 1.2rem 2.5rem; }
.footer-row {
  max-width: 900px;
  margin: 1.2rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.hit-counter {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #000;
  border: 1px solid var(--blue);
  padding: .35rem .6rem;
}
.hit-label { font-size: .65rem; color: var(--teal); }
.hit-digits {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--mint);
  background: #111;
  padding: .1rem .3rem;
}
.footer-note { font-size: .75rem; opacity: .7; margin: 0; }

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .type-line::after { animation: none; }
  .scrap-card, .pixel-btn { transition: none; }
  .bg-parallax { display: none; }
  body { cursor: auto; }
}

/* ============================================
   SITE-WIDE MAXIMALIST RETRO DESKTOP TREATMENT
   applies everywhere — uses each page's own
   theme colors via the existing CSS variables
   ============================================ */
body {
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.02) 0 2px, transparent 2px 40px),
    radial-gradient(circle at 20% 10%, rgba(153,143,199,.12), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(83,145,126,.14), transparent 45%);
}

.window {
  border: 3px solid var(--ink);
  box-shadow:
    3px 3px 0 var(--mint),
    6px 6px 0 var(--teal),
    9px 9px 0 rgba(0,0,0,.6);
}

.window-titlebar {
  background: linear-gradient(90deg, var(--blue), var(--lavender), var(--teal));
  background-size: 200% 100%;
  animation: chrome-shift 5s ease-in-out infinite;
  border-bottom: 3px solid var(--ink);
}
@keyframes chrome-shift {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}
.window-dots i {
  width: 11px; height: 11px;
  border: 2px solid var(--ink);
  background: linear-gradient(135deg, #fff, var(--mint));
}

.pixel-title {
  text-shadow:
    2px 2px 0 var(--teal),
    4px 4px 0 var(--blue),
    6px 6px 0 var(--lavender),
    8px 8px 0 var(--ink);
}

.pixel-btn {
  border-width: 3px;
  border-top-color: #fff;
  border-left-color: #fff;
  border-right-color: var(--ink);
  border-bottom-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.pixel-btn:active {
  border-top-color: var(--ink);
  border-left-color: var(--ink);
  border-right-color: #fff;
  border-bottom-color: #fff;
}

.app-tile {
  border-width: 3px;
  border-top-color: #fff;
  border-left-color: #fff;
  border-right-color: var(--ink);
  border-bottom-color: var(--ink);
  background: linear-gradient(160deg, var(--void-2), var(--blue) 140%);
  box-shadow: 4px 4px 0 rgba(0,0,0,.7);
}
.app-tile:hover {
  box-shadow: 6px 6px 0 rgba(0,0,0,.7);
}
.tile-icon {
  filter: drop-shadow(2px 2px 0 var(--ink));
}

.currently-item {
  border: 2px solid var(--teal);
  background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,.03) 8px 16px);
}

.section-heading .tag {
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

/* scrapbook cards + vinyl sleeves + pixel buttons pick up the same beveled edge */
.scrap-card {
  border-width: 2px;
  border-top-color: #fff;
  border-left-color: #fff;
  border-right-color: var(--ink);
  border-bottom-color: var(--ink);
}
.vinyl-sleeve {
  border-width: 3px;
  box-shadow: 4px 4px 0 var(--mint), 7px 7px 0 rgba(0,0,0,.6);
}
.pixel-button-88 {
  border-width: 3px;
  border-top-color: #fff;
  border-left-color: #fff;
  border-right-color: var(--ink);
  border-bottom-color: var(--ink);
}
.dice-result {
  border-width: 3px;
  border-top-color: #fff;
  border-left-color: #fff;
  border-right-color: var(--ink);
  border-bottom-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .window-titlebar { animation: none; }
}

/* ============================================
   SCROLL REVEAL
   applied via JS to key elements site-wide
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(60px) scale(.93);
  filter: blur(8px);
  transition:
    opacity .9s cubic-bezier(.16,.84,.44,1),
    transform .9s cubic-bezier(.16,.84,.44,1),
    filter .9s cubic-bezier(.16,.84,.44,1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

/* dramatic hero title entrance */
.pixel-title {
  opacity: 0;
  transform: scale(1.35);
  filter: blur(14px);
  transition:
    opacity 1s cubic-bezier(.16,.84,.44,1),
    transform 1s cubic-bezier(.16,.84,.44,1),
    filter 1s cubic-bezier(.16,.84,.44,1);
}
.pixel-title.title-in {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

/* ============================================
   MAGNETIC HOVER
   applied via JS to buttons, tiles, nav links
   ============================================ */
.magnetic {
  transition: transform .3s cubic-bezier(.2,.9,.25,1.3);
  will-change: transform;
  display: inline-block;
}

/* ============================================
   PAGE TRANSITION WIPE
   ============================================ */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: linear-gradient(160deg, var(--void), var(--void-2) 60%, var(--blue));
  transform: translateY(0%);
  transition: transform .68s cubic-bezier(.86,0,.07,1);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-transition.is-hidden { transform: translateY(-100%); }

.page-transition-text {
  font-family: var(--font-display);
  font-size: clamp(.9rem, 3vw, 1.3rem);
  color: var(--mint);
  text-shadow: 0 0 14px var(--mint), 0 0 3px #fff;
  opacity: 0;
  letter-spacing: 2px;
  transition: opacity .25s ease;
  animation: glitch-flicker 1.4s steps(1) infinite;
}
.page-transition:not(.is-hidden) .page-transition-text { opacity: 1; }
@keyframes glitch-flicker {
  0%, 89%, 100% { opacity: 1; transform: translate(0,0); }
  90% { opacity: .4; transform: translate(-2px, 1px); }
  91% { opacity: 1; transform: translate(2px, -1px); }
  92% { opacity: .6; transform: translate(0,0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .pixel-title { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .magnetic { transition: none !important; transform: none !important; }
  .page-transition { transition: none !important; }
  .page-transition-text { animation: none !important; }
}