/* ==========================================================
   Naman Chandak | Trainer Portfolio
   Block 1: theme tokens, navbar, title screen
   ========================================================== */

/* ---------- Fonts (self-hosted, both SIL Open Font License) ---------- */
@font-face {
  font-family: "Press Start 2P";
  src: url("assets/fonts/press-start-2p-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url("assets/fonts/vt323-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --font-display: "Press Start 2P", "Courier New", monospace;
  --font-body: "VT323", "Courier New", monospace;

  --px: 4px;              /* one "pixel" of border / shadow */
  --nav-h: 68px;
  --maxw: 1120px;

  /* Day mode: Game Boy greens */
  --bg: #d6e4a6;
  --bg-grid: rgba(30, 70, 32, 0.07);
  --panel: #eef5cf;
  --panel-2: #c4d78a;
  --ink: #1b3d1c;
  --muted: #3f6b2f;
  --line: #1b3d1c;
  --accent: #d62f3b;
  --accent-ink: #ffffff;
  --focus: #1a54d8;
  --sky: #bcd47e;
  --sky-2: #a9c46a;
  --ground: #7da447;
  --ground-2: #5f8a3a;
  --shade: rgba(27, 61, 28, 0.22);
  --bar: #3f8f2e;
  --field: #ffffff;
}

[data-theme="night"] {
  --bg: #0e1022;
  --bg-grid: rgba(120, 140, 255, 0.07);
  --panel: #181b36;
  --panel-2: #232850;
  --ink: #e9eeff;
  --muted: #a3afe0;
  --line: #5c6bd6;
  --accent: #ff4d6d;
  --accent-ink: #0e1022;
  --focus: #3df5c6;
  --sky: #1b2048;
  --sky-2: #232a5e;
  --ground: #1f6f66;
  --ground-2: #175450;
  --shade: rgba(0, 0, 0, 0.45);
  --bar: #3df5c6;
  --field: #0e1022;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 8px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  transition: background-color 0.2s steps(3), color 0.2s steps(3);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.8rem 1rem;
  font-family: var(--font-display);
  font-size: 0.65rem;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 0 0 var(--px) var(--line);
}
.skip-link:focus { top: 1rem; }

/* ---------- Pixel box helper: notched corners, no border-radius ---------- */
.px-box,
.dialog,
.screen,
.hud,
.card,
.chat,
.dex-tools,
.dex-search input,
.chat__form input,
.msg,
.filter,
.entry,
.entry__icon,
.move,
.port,
.pfp,
.badge__plate,
.btn {
  border: 0;
  border-radius: 0;
  box-shadow:
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line),
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: var(--px);
  padding: 1rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
  user-select: none;
  /* Add a chunky bottom shade for a "pressable" look */
  box-shadow:
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line),
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line),
    inset 0 calc(var(--px) * -1) 0 0 var(--shade);
  transition: transform 0.08s steps(2);
}
.btn:hover { background: var(--panel-2); }
.btn:active {
  transform: translateY(var(--px));
  box-shadow:
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line),
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line);
}

.btn--start {
  color: var(--accent-ink);
  background: var(--accent);
}
.btn--start:hover { background: var(--accent); filter: brightness(1.1); }

.btn--ghost { background: transparent; }

.btn--small {
  padding: 0.75rem 0.9rem;
  font-size: 0.6rem;
}

.btn__cursor {
  width: 0.7rem;
  height: 0.7rem;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  animation: blink 1s steps(1) infinite;
}

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--panel);
  border-bottom: var(--px) solid var(--line);
}
.nav__inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.8rem;
}
.nav__ball {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Crect x='1' y='0' width='6' height='1' fill='%23111'/%3E%3Crect x='0' y='1' width='8' height='6' fill='%23111'/%3E%3Crect x='1' y='7' width='6' height='1' fill='%23111'/%3E%3Crect x='1' y='1' width='6' height='3' fill='%23e63946'/%3E%3Crect x='1' y='4' width='6' height='2' fill='%23fff'/%3E%3Crect x='0' y='3' width='8' height='1' fill='%23111'/%3E%3Crect x='3' y='2' width='2' height='3' fill='%23111'/%3E%3Crect x='3.5' y='3' width='1' height='1' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
}

[data-theme="night"] .nav__ball {
  filter: drop-shadow(1px 0 0 #e9eeff) drop-shadow(-1px 0 0 #e9eeff) drop-shadow(0 1px 0 #e9eeff) drop-shadow(0 -1px 0 #e9eeff);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav__link {
  position: relative;
  padding: 0.8rem 0.75rem;
  font-family: var(--font-display);
  font-size: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.nav__link:hover { color: var(--accent); }
/* Active link gets the same selection arrow the title screen uses */
.nav__link.is-active::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: 8px;
  height: 10px;
  margin-top: -5px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.nav__link.is-active { padding-left: 1.15rem; }

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-icon {
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Crect x='3' y='0' width='2' height='1'/%3E%3Crect x='3' y='7' width='2' height='1'/%3E%3Crect x='0' y='3' width='1' height='2'/%3E%3Crect x='7' y='3' width='1' height='2'/%3E%3Crect x='2' y='2' width='4' height='4'/%3E%3Crect x='1' y='1' width='1' height='1'/%3E%3Crect x='6' y='1' width='1' height='1'/%3E%3Crect x='1' y='6' width='1' height='1'/%3E%3Crect x='6' y='6' width='1' height='1'/%3E%3C/svg%3E");
}
[data-theme="night"] .theme-icon {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Crect x='2' y='0' width='4' height='1'/%3E%3Crect x='1' y='1' width='3' height='1'/%3E%3Crect x='0' y='2' width='3' height='4'/%3E%3Crect x='1' y='6' width='3' height='1'/%3E%3Crect x='2' y='7' width='4' height='1'/%3E%3Crect x='5' y='5' width='3' height='2'/%3E%3C/svg%3E");
}

.nav__burger {
  display: none;
  width: 48px;
  height: 44px;
  padding: 0;
  background: var(--panel);
  border: 0;
  cursor: pointer;
  box-shadow:
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line),
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav__burger span {
  display: block;
  width: 22px;
  height: 4px;
  background: var(--ink);
}
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Hero / title screen ---------- */
.hero {
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: center;
  padding: 3rem 1.25rem 4rem;
}
.hero__inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 3.5rem;
  align-items: center;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.hero__version {
  font-family: var(--font-display);
  font-size: 0.6rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.hero__title {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 0.9rem + 3.9vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: 0;
  /* Hard pixel drop-shadow instead of a soft blur */
  text-shadow: 4px 4px 0 var(--panel-2);
}
.hero__role {
  margin-top: 1.25rem;
  font-size: 1.7rem;
  color: var(--muted);
}

/* Dialog box with typewriter text */
.dialog {
  position: relative;
  width: 100%;
  max-width: 34rem;
  margin: 2rem var(--px) 2rem;
  padding: 1.1rem 2.6rem 1.1rem 1.4rem;
  min-height: calc(3 * 1.25 * 1.7rem + 2.2rem);
  background: var(--panel);
  cursor: pointer;
}
.dialog--static {
  cursor: default;
  min-height: 0;
  margin: var(--px);
}
.dialog__text {
  font-size: 1.7rem;
  line-height: 1.25;
}
.dialog__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.dialog__next {
  position: absolute;
  right: 1rem;
  bottom: 0.9rem;
  width: 14px;
  height: 10px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  opacity: 0;
}
.dialog__next.is-visible {
  opacity: 1;
  animation: blink 0.9s steps(1) infinite;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}

/* Battle-style stage on the right */
.hero__stage {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: var(--px);
  min-width: 0;
}

.screen {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--sky);
}
.screen__sky {
  position: absolute;
  inset: 0 0 38% 0;
  background:
    linear-gradient(var(--sky-2), var(--sky-2)) 0 70% / 100% 16% no-repeat,
    var(--sky);
}
.screen__ground {
  position: absolute;
  inset: 62% 0 0 0;
  background:
    repeating-linear-gradient(90deg, var(--ground-2) 0 16px, transparent 16px 48px) 0 0 / 100% 8px no-repeat,
    var(--ground);
  border-top: var(--px) solid var(--line);
}
.screen__sprite {
  position: absolute;
  left: 50%;
  bottom: 31%;
  width: clamp(110px, 34%, 170px);
  transform: translateX(-50%);
  z-index: 2;
  animation: bob 1.2s steps(1) infinite;
}
.screen__sprite svg {
  width: 100%;
  height: auto;
  shape-rendering: crispEdges;
}
.screen__shadow {
  position: absolute;
  left: 50%;
  bottom: 27%;
  width: clamp(90px, 32%, 150px);
  height: 14px;
  transform: translateX(-50%);
  background: var(--shade);
  z-index: 1;
}

/* Stats panel */
.hud {
  margin: 0;
  padding: 0.25rem 1.25rem;
  background: var(--panel);
}
.hud__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 2px dashed var(--shade);
}
.hud__row:last-child { border-bottom: 0; }
.hud dt,
.rows dt {
  font-family: var(--font-display);
  font-size: 0.55rem;
  line-height: 1.5;
  color: var(--muted);
}
.hud dd,
.rows dd {
  margin: 0;
  font-size: 1.6rem;
  text-align: right;
}

/* ---------- Placeholder sections (replaced in later blocks) ---------- */
.section {
  padding: 5rem 1.25rem;
}
.section--stub { min-height: 70vh; }
.section__inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.section__title {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.1rem, 0.8rem + 1.6vw, 1.8rem);
  line-height: 1.3;
}


/* ---------- Shared bits ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.lead {
  max-width: 52rem;
  margin: -0.5rem 0 2rem;
  font-size: 1.6rem;
  color: var(--muted);
}
.sub-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 3rem;
  align-items: start;
}
.about__side {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  min-width: 0;
}

.card {
  margin: var(--px);
  padding: 1.5rem 1.5rem 0.75rem;
  background: var(--panel);
}
.card__top {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px dashed var(--shade);
}
.pfp {
  flex: none;
  width: 116px;
  aspect-ratio: 1;
  margin: var(--px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px 0 0;
  background: linear-gradient(var(--sky) 0 74%, var(--ground) 74%);
}
.pfp svg {
  width: 74%;
  height: auto;
  shape-rendering: crispEdges;
}
.card__name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  line-height: 1.5;
}
.card__sub {
  margin-top: 0.4rem;
  font-size: 1.6rem;
  color: var(--muted);
}
.rows { margin: 0; }

.dialog--bio { cursor: default; padding-right: 1.4rem; }
.dialog--bio .dialog__text + .dialog__text { margin-top: 0.9rem; }

/* Training log: a real sequence, so it is a timeline */
.log {
  list-style: none;
  margin: 0 0 0 12px;
  padding: 0 0 0 1.5rem;
  border-left: var(--px) solid var(--line);
}
.log li {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 1rem;
  padding-bottom: 1.1rem;
}
.log li:last-child { padding-bottom: 0; }
.log li::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - var(--px) - 6px);
  top: 0.25rem;
  width: 14px;
  height: 14px;
  background: var(--accent);
  box-shadow: 0 0 0 var(--px) var(--line);
}
.log__year {
  font-family: var(--font-display);
  font-size: 0.7rem;
  min-width: 3.6rem;
}
.log__text { flex: 1 1 14rem; font-size: 1.6rem; }

/* Badge case */
.badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}
.badge { text-align: center; }
.badge__plate {
  width: 84px;
  height: 84px;
  margin: var(--px) auto 0.9rem;
  display: grid;
  place-items: center;
  background: #eef5cf;
}
.badge__plate svg {
  width: 52px;
  height: auto;
  shape-rendering: crispEdges;
}
.badge__name {
  font-family: var(--font-display);
  font-size: 0.55rem;
  line-height: 1.5;
}
.badge__desc {
  margin-top: 0.3rem;
  font-size: 1.3rem;
  line-height: 1.1;
  color: var(--muted);
}

/* ---------- Skills ---------- */
.moves {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}
.move {
  margin: var(--px);
  padding: 1.1rem 1.1rem 1.2rem;
  background: var(--panel);
}
.move__name {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.4;
}
.move__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  min-height: 1.6rem;
}
.chip {
  display: inline-block;
  padding: 0.25rem 0.5rem 0.2rem;
  font-size: 1.2rem;
  line-height: 1;
  color: #101418;
  box-shadow: 0 0 0 2px #101418;
  margin: 2px;
}
.chip--lang { background: #8db4ff; }
.chip--web { background: #ffb85c; }
.chip--tool { background: #9be15d; }
.chip--learning { background: var(--accent); color: var(--accent-ink); }

.move__meter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.pips {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  padding: 3px;
  background: var(--line);
}
.pip {
  height: 14px;
  background: var(--panel);
}
.pip.is-on {
  background: var(--bar);
  transition: background-color 0.01s steps(1) calc(var(--i) * 70ms);
}
.move__lvl {
  font-size: 1.4rem;
  min-width: 3.2rem;
  text-align: right;
}

/* ---------- Contact ---------- */
.dialog--contact { max-width: calc(46rem - 2 * var(--px)); margin-bottom: 2rem; }
.ports {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 46rem;
}
.port {
  margin: var(--px);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  background: var(--panel);
}
.port__info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}
.port__label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--muted);
}
.port__value {
  font-size: 1.7rem;
  overflow-wrap: anywhere;
}
.port__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

/* ---------- Projects: Pokedex entries ---------- */
.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.75rem;
}
.entry {
  margin: var(--px);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  background: var(--panel);
}
.entry__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px dashed var(--shade);
}
.entry__no {
  font-family: var(--font-display);
  font-size: 0.65rem;
  line-height: 1.4;
  color: var(--muted);
}
.entry__icon {
  flex: none;
  width: 60px;
  height: 60px;
  margin: var(--px);
  display: grid;
  place-items: center;
  background: #eef5cf;
}
.entry__icon svg {
  width: 36px;
  height: auto;
  shape-rendering: crispEdges;
}
.entry__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.8rem;
  line-height: 1.5;
}
.entry__desc {
  margin-bottom: 1.1rem;
  font-size: 1.6rem;
}
.entry__tech {
  list-style: none;
  margin: auto 0 1.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.entry__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}
.chip--other { background: #d9d9ff; }

/* ---------- Project search + filter ---------- */
.dex-tools {
  margin: var(--px) var(--px) 2rem;
  padding: 1.25rem;
  display: grid;
  gap: 1.1rem;
  background: var(--panel);
}
.dex-search { display: grid; gap: 0.6rem; }
.dex-search label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  line-height: 1.5;
}
.dex-search input {
  width: calc(100% - 2 * var(--px));
  margin: 0 var(--px);
  padding: 0.7rem 0.9rem;
  font-family: var(--font-body);
  font-size: 1.7rem;
  color: var(--ink);
  background: var(--field);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.dex-search input::placeholder { color: var(--muted); opacity: 0.8; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
.filter {
  margin: var(--px);
  padding: 0.7rem 0.9rem;
  font-family: var(--font-display);
  font-size: 0.6rem;
  line-height: 1.3;
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
  box-shadow:
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line),
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line),
    inset 0 calc(var(--px) * -1) 0 0 var(--shade);
}
.filter:hover { background: var(--panel-2); }
.filter.is-active { background: var(--ink); color: var(--panel); }
[data-theme="night"] .filter.is-active { background: var(--bar); color: var(--accent-ink); }
.dex-count { font-size: 1.4rem; color: var(--muted); }
.entry[hidden] { display: none; }
.dex-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 0;
}
.dex-empty[hidden] { display: none; }
.dex-empty .dialog__text { flex: 1 1 14rem; }

/* ---------- Chatbot ---------- */
.chat {
  margin: var(--px);
  max-width: 46rem;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  background: var(--panel);
}
.chat__log {
  height: 22rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--sky);
  box-shadow: inset 0 0 0 var(--px) var(--line);
  padding: 1rem 1.1rem;
  scroll-behavior: auto;
}
.msg {
  position: relative;
  max-width: 88%;
  margin: var(--px);
  padding: 0.65rem 0.9rem 0.75rem;
  font-size: 1.6rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.msg__who {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.5rem;
  line-height: 1.4;
  color: var(--muted);
}
.msg--bot { align-self: flex-start; background: var(--panel); }
.msg--user { align-self: flex-end; background: var(--panel-2); }
.msg--error { align-self: flex-start; background: var(--panel); color: var(--ink); }
.msg--error .msg__who { color: var(--accent); }
.msg__retry { margin-top: 0.75rem; }
.msg__retry .btn { margin-left: 0; }
.msg--typing .msg__text::after {
  content: "...";
  display: inline-block;
  width: 1.5em;
  overflow: hidden;
  vertical-align: bottom;
  animation: dots 1s steps(4) infinite;
}
@keyframes dots {
  0% { width: 0; }
  100% { width: 1.5em; }
}

.chat__suggest { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; }
.suggest {
  margin: var(--px);
  padding: 0.5rem 0.7rem 0.45rem;
  font-family: var(--font-body);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink);
  background: var(--panel);
  border: 0;
  cursor: pointer;
  box-shadow:
    calc(var(--px) * -1) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line),
    0 calc(var(--px) * -1) 0 0 var(--line),
    0 var(--px) 0 0 var(--line);
}
.suggest:hover:not(:disabled) { background: var(--panel-2); }
.suggest:disabled, .chat__form button:disabled, .chat__form input:disabled { opacity: 0.55; cursor: not-allowed; }

.chat__form { display: flex; gap: 0.75rem; align-items: center; }
.chat__form input {
  flex: 1;
  min-width: 0;
  margin: var(--px);
  padding: 0.7rem 0.9rem;
  font-family: var(--font-body);
  font-size: 1.7rem;
  color: var(--ink);
  background: var(--field);
  border: 0;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.chat__form input::placeholder { color: var(--muted); opacity: 0.8; }

/* ---------- Footer ---------- */
.footer {
  padding: 2.25rem 1.25rem 2.75rem;
  border-top: var(--px) solid var(--line);
  background: var(--panel);
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 1.35rem;
  color: var(--muted);
}

/* ---------- Motion ---------- */
@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes bob {
  0%, 49%   { transform: translateX(-50%) translateY(0); }
  50%, 100% { transform: translateX(-50%) translateY(-6px); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .moves { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .about { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .card { max-width: 34rem; }
  .hero { min-height: 0; padding-top: 2.5rem; }
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .hero__stage { max-width: 30rem; }
}

@media (max-width: 860px) {
  .nav__burger { display: inline-flex; }

  .nav__links {
    position: absolute;
    top: calc(100% + var(--px));
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: var(--panel);
    border-bottom: var(--px) solid var(--line);
  }
  .nav__links.is-open { display: flex; }
  .nav__link {
    padding: 1.1rem 0.5rem 1.1rem 1.4rem;
    font-size: 0.7rem;
    border-bottom: 2px dashed var(--shade);
  }
  .nav__link:last-child { border-bottom: 0; }
  .nav__link.is-active { padding-left: 1.4rem; }
  .nav__link.is-active::before { left: 0.3rem; }
}

@media (max-width: 700px) {
  .moves { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
}

@media (max-width: 480px) {
  .chat__suggest { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.4rem; }
  .suggest { flex: none; white-space: nowrap; }
  .chat { padding: 1rem 0.9rem; }
  .chat__log { height: 20rem; padding: 0.8rem; }
  .msg { max-width: 94%; font-size: 1.5rem; }
  .moves { grid-template-columns: minmax(0, 1fr); }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 1.25rem 1.1rem 0.5rem; }
  .pfp { width: 96px; }
  .card__name { font-size: 0.75rem; }
  .port__actions { width: 100%; }
  .footer { padding: 2rem 1rem 2.5rem; }
  :root { --nav-h: 64px; }
  body { font-size: 1.4rem; }
  .nav__inner { padding: 0 1rem; }
  .nav__brand-text { display: none; }   /* ball only, saves room for the buttons */
  .theme-label { display: none; }
  .btn--small { padding: 0.75rem; }
  .hero { padding: 2rem 1rem 3rem; }
  .dialog { padding: 1rem 2.2rem 1rem 1.1rem; }
  .dialog__text { font-size: 1.55rem; }
  .btn { padding: 0.95rem 1rem; }
  .hud dd { font-size: 1.5rem; }
  .section { padding: 4rem 1rem; }
}

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