:root {
  --bg: #070b14;
  --bg-2: #0c1424;
  --panel: #101b2f;
  --panel-2: #162641;
  --ink: #f7fbff;
  --muted: #aebfd6;
  --cyan: #4bdcff;
  --cyan-2: #2194ca;
  --purple: #8e63d7;
  --purple-2: #5c337f;
  --gold: #ffd85a;
  --green: #6ce6a4;
  --line: #31547c;
  --shadow: #02050a;
  --pixel: "Press Start 2P", "Courier New", monospace;
  --body: "VT323", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(75,220,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142,99,215,.02) 1px, transparent 1px),
    radial-gradient(circle at 50% -10%, #14223d 0%, var(--bg) 46%);
  background-size: 32px 32px, 32px 32px, auto;
  font-family: var(--body);
  font-size: 24px;
  line-height: 1.35;
  overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; }

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  opacity: .08;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.25) 0,
    rgba(255,255,255,.25) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: overlay;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(18px, 4vw, 64px);
  background: rgba(7,11,20,.93);
  border-bottom: 4px solid #0b0f17;
  box-shadow: 0 4px 0 var(--line), 0 8px 20px rgba(0,0,0,.4);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  object-position: top;
  image-rendering: pixelated;
  border: 3px solid var(--cyan);
  background: #07101c;
  box-shadow: 3px 3px 0 var(--shadow);
}
.brand strong,
.brand small { display: block; }
.brand strong {
  font-family: var(--pixel);
  font-size: 13px;
  letter-spacing: .05em;
}
.brand small {
  margin-top: 5px;
  color: var(--cyan);
  font-size: 15px;
  letter-spacing: .08em;
}

.main-nav { display: flex; gap: 8px; }
.main-nav a,
.menu-toggle {
  font-family: var(--pixel);
  font-size: 10px;
  text-decoration: none;
  background: #0f1a2d;
  border: 2px solid #39597c;
  padding: 12px 14px;
  box-shadow: 3px 3px 0 #03060b;
}
.main-nav a:hover,
.main-nav a:focus-visible {
  color: #06121d;
  background: var(--cyan);
  border-color: #aef1ff;
  transform: translate(-1px,-1px);
  box-shadow: 4px 4px 0 #03060b;
}
.menu-toggle {
  display: none;
  color: var(--ink);
  cursor: pointer;
}

.hero {
  position: relative;
  min-height: 690px;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 4px solid var(--cyan-2);
  background:
    linear-gradient(180deg, rgba(15,26,45,.3), rgba(7,11,20,.96)),
    radial-gradient(circle at 50% 30%, #243458 0%, #0a1120 58%, #05080f 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background: repeating-linear-gradient(45deg, transparent 0 14px, rgba(75,220,255,.025) 14px 16px);
}
.hero-character {
  position: absolute;
  z-index: -2;
  bottom: 0;
  width: clamp(320px, 34vw, 560px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 18px 0 rgba(0,0,0,.28)) drop-shadow(0 24px 34px rgba(0,0,0,.62));
  pointer-events: none;
}
.hero-character-left {
  left: max(-70px, calc(50% - 760px));
}
.hero-character-right {
  right: max(-55px, calc(50% - 750px));
  transform: scaleX(-1);
}
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7,11,20,.12) 0%, rgba(7,11,20,.4) 28%, rgba(7,11,20,.83) 45%, rgba(7,11,20,.83) 55%, rgba(7,11,20,.4) 72%, rgba(7,11,20,.12) 100%),
    linear-gradient(180deg, transparent 55%, rgba(7,11,20,.92) 100%);
}

.pixel-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(20,37,64,.96), rgba(11,22,40,.96));
  border: 4px solid #d8ecff;
  box-shadow:
    0 0 0 4px #31547c,
    0 0 0 8px #07101c,
    10px 12px 0 rgba(0,0,0,.38);
}
.pixel-panel::after {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(127,197,255,.24);
}

.hero-panel {
  width: min(610px, calc(100% - 48px));
  padding: 38px 42px 40px;
  text-align: center;
}
.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--cyan);
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: .12em;
}
.cursor { color: var(--gold); }
.hero h1,
.section h2,
.skill h3,
.chapter-copy h3,
.inventory-card h3 {
  margin: 0;
  font-family: var(--pixel);
  line-height: 1.25;
  text-shadow: 3px 3px 0 #04101b;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 72px);
  letter-spacing: .02em;
  color: #ffffff;
  text-shadow: 4px 4px 0 #04101b, 0 0 18px rgba(255,255,255,.12);
}
.hero-tagline {
  margin: 20px 0 10px;
  font-family: var(--pixel);
  font-size: 11px;
  line-height: 1.8;
  color: #fff8c9;
}
.hero-tagline span { color: var(--cyan); }
.hero-copy { color: var(--muted); max-width: 44ch; margin: 14px auto 24px; }
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }

.gba-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 13px 18px;
  font-family: var(--pixel);
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: #172844;
  border: 3px solid #d9ecff;
  box-shadow: 0 0 0 3px #3c5d84, 5px 6px 0 #03060b;
  transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
}
.gba-button::before {
  content: "▶";
  margin-right: 9px;
  color: var(--gold);
}
.gba-button:hover,
.gba-button:focus-visible {
  transform: translate(-2px,-2px);
  background: #223b63;
  box-shadow: 0 0 0 3px #4bdcff, 7px 8px 0 #03060b;
}
.gba-button.primary {
  color: #06131b;
  background: linear-gradient(180deg, #8ff1ff, #41d4ef);
  border-color: #e9fdff;
  box-shadow: 0 0 0 3px #187aa6, 5px 6px 0 #03060b;
}
.gba-button.primary::before { color: #6b338e; }
.gba-button.primary:hover { background: linear-gradient(180deg, #fff39b, #ffd85a); }
.gba-button.full { width: 100%; }

.section {
  padding: 96px clamp(20px, 5vw, 76px);
  max-width: 1440px;
  margin: 0 auto;
}
.section-heading { max-width: 840px; margin-bottom: 44px; }
.section-heading.centered { margin-left: auto; margin-right: auto; text-align: center; }
.section h2 { font-size: clamp(25px, 4vw, 44px); }
.section-heading p:last-child { color: var(--muted); font-size: 25px; }

.shop-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 34px;
}
.inventory-card { padding: 34px; }
.inventory-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  margin-bottom: 26px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-family: var(--pixel);
  font-size: 9px;
}
.status { color: var(--green); }
.status i {
  display: inline-block;
  width: 9px; height: 9px;
  margin-right: 7px;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}
.inventory-card h3 { font-size: clamp(22px, 3vw, 36px); color: var(--gold); }
.inventory-card > p { color: var(--muted); }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 28px 0;
}
.stat-grid div {
  padding: 14px;
  border: 2px solid #2c4c70;
  background: rgba(4,10,19,.55);
}
.stat-grid span,
.stat-grid strong { display: block; }
.stat-grid span { color: var(--cyan); font-family: var(--pixel); font-size: 8px; margin-bottom: 8px; }
.stat-grid strong { font-size: 20px; font-weight: 400; }

.mascot-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 18px;
  min-height: 460px;
}
.mascot-card img {
  width: 100%;
  max-height: 325px;
  object-fit: contain;
  align-self: center;
  filter: drop-shadow(0 8px 0 rgba(0,0,0,.3));
}
.mascot-card > div {
  position: relative;
  z-index: 2;
  padding: 15px 16px 4px;
  background: rgba(6,13,25,.9);
  border-top: 2px solid var(--purple);
}
.dialogue-name { color: var(--gold); font-family: var(--pixel); font-size: 9px; }
.mascot-card p { margin: 8px 0 0; }

.chapter-section { padding-top: 72px; }
.chapter-card {
  display: grid;
  grid-template-columns: 390px minmax(0,1fr) 180px;
  align-items: stretch;
  min-height: 410px;
  overflow: hidden;
}
.chapter-portrait {
  align-self: center;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: pixelated;
  padding: 10px;
  background: #a8cfa0;
  border-right: 4px solid #6d53a0;
}
.chapter-copy { padding: 35px 36px; }
.chapter-label { color: var(--gold); font-family: var(--pixel); font-size: 9px; }
.chapter-copy h3 { margin-top: 12px; font-size: 22px; }
.chapter-copy p { color: var(--muted); max-width: 60ch; }
.chapter-menu {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  padding: 28px;
  background: #0a1321;
  border-left: 3px solid #284967;
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.8;
}
.chapter-menu .selected { color: var(--gold); }

.about-grid {
  display: grid;
  grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr);
  gap: 42px;
  align-items: center;
}
.portrait-frame { overflow: hidden; padding-top: 24px; }
.portrait-frame img {
  display: block;
  width: min(100%, 430px);
  margin: 0 auto;
  image-rendering: pixelated;
}
.nameplate {
  position: relative;
  z-index: 2;
  padding: 16px;
  color: #08131c;
  background: linear-gradient(90deg, var(--cyan), #8cecff);
  font-family: var(--pixel);
  font-size: 9px;
  text-align: center;
  border-top: 4px solid #d9fbff;
}
.about-copy { padding: 38px; }
.about-copy p { color: var(--muted); }
.about-copy strong { color: var(--gold); font-weight: 400; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 22px;
}
.skill { padding: 27px 22px 24px; min-height: 250px; }
.skill > span {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  color: #08131c;
  background: var(--gold);
  border: 3px solid #fff0a8;
  box-shadow: 3px 3px 0 #593d00;
  font-family: var(--pixel);
  font-size: 10px;
}
.skill h3 { font-size: 13px; color: var(--cyan); }
.skill p { color: var(--muted); font-size: 21px; }

.contact-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 35px;
  padding: 35px 38px;
}
.contact-box h2 { font-size: clamp(22px, 3vw, 34px); }
.contact-box p { margin-bottom: 0; color: var(--muted); }

.site-footer {
  padding: 42px clamp(20px, 5vw, 76px) 50px;
  border-top: 4px solid #223c5b;
  background: #03060c;
  color: var(--muted);
  text-align: center;
}
.site-footer > div:first-child { display: grid; gap: 6px; }
.site-footer strong { color: var(--ink); font-family: var(--pixel); font-size: 13px; }
.site-footer span { color: var(--cyan); }
.footer-links { display: flex; justify-content: center; gap: 18px; margin: 20px 0; }
.footer-links a { color: var(--gold); font-family: var(--pixel); font-size: 9px; text-decoration: none; }
.footer-links a:hover { color: var(--cyan); }
.site-footer small { font-size: 17px; }

@media (max-width: 1080px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .skill:last-child { grid-column: 1 / -1; }
  .chapter-card { grid-template-columns: 320px 1fr; }
  .chapter-menu { display: none; }
}

@media (max-width: 820px) {
  body { font-size: 21px; }
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 16px;
    right: 16px;
    padding: 12px;
    background: #07101c;
    border: 3px solid var(--line);
    flex-direction: column;
  }
  .main-nav.open { display: flex; }
  .main-nav a { text-align: center; }
  .brand strong { font-size: 10px; }
  .brand small { font-size: 13px; }

  .hero { min-height: 670px; align-items: end; padding-bottom: 58px; }
  .hero-character {
    width: clamp(220px, 48vw, 330px);
    bottom: auto;
    top: 18px;
  }
  .hero-character-left { left: -52px; }
  .hero-character-right { right: -46px; }
  .hero-vignette {
    background: linear-gradient(180deg, rgba(7,11,20,.05), rgba(7,11,20,.94) 51%, rgba(7,11,20,1) 72%);
  }
  .hero-panel { padding: 28px 24px 30px; }
  .hero h1 { font-size: clamp(34px, 11vw, 56px); }

  .section { padding: 72px 20px; }
  .shop-grid,
  .about-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .mascot-card { min-height: 0; }
  .mascot-card img { max-height: 260px; }
  .chapter-card { grid-template-columns: 1fr; }
  .chapter-portrait { height: 300px; border-right: 0; border-bottom: 4px solid #6d53a0; object-position: center; }
  .chapter-copy { padding: 28px 25px 32px; }
  .skills-grid { grid-template-columns: 1fr; }
  .skill:last-child { grid-column: auto; }
  .contact-box { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  .site-header { padding: 8px 12px; }
  .brand img { width: 48px; height: 48px; }
  .brand small { display: none; }
  .menu-toggle { padding: 10px 11px; }
  .pixel-panel { box-shadow: 0 0 0 3px #31547c, 0 0 0 6px #07101c, 6px 7px 0 rgba(0,0,0,.38); }
  .hero-panel { width: calc(100% - 26px); }
  .hero-character {
    width: 205px;
    top: 24px;
    opacity: .95;
  }
  .hero-character-left { left: -58px; }
  .hero-character-right { right: -58px; }
  .hero-actions { display: grid; }
  .gba-button { width: 100%; }
  .section h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
