:root {
  --poke-ink: #16181d;
  --poke-muted: #626874;
  --poke-paper: #ffffff;
  --poke-surface: #f3f5f7;
  --poke-yellow: #f5c928;
  --poke-red: #d93d37;
  --poke-blue: #2563a8;
  --poke-cyan: #35a6b8;
  --poke-line: #20242a;
  --poke-font: "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--poke-ink);
  background: var(--poke-surface);
  font-family: var(--poke-font);
  line-height: 1.55;
  letter-spacing: 0;
}
a { color: inherit; }
img { max-width: 100%; }
button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }

.g-nav {
  position: sticky;
  top: 0;
  z-index: 170;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  color: #f4f1e9;
  background: rgba(7, 19, 31, .97);
  border-bottom: 1px solid rgba(224, 180, 88, .25);
}
.nav-brand {
  color: #e0b458;
  font-family: "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  padding: 8px 13px;
  border-radius: 6px;
  color: rgba(244, 241, 233, .72);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav-links a.active { color: #07131f; background: #e0b458; }
.mobile-nav-button,
.mobile-nav-overlay,
.mobile-nav-menu { display: none; }

.pokemon-subnav {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px max(28px, calc((100vw - 1320px) / 2));
  color: var(--poke-ink);
  background: #fff;
  border-bottom: 2px solid var(--poke-line);
}
.pokemon-title {
  min-width: max-content;
  margin-right: auto;
  font-size: 21px;
  font-weight: 900;
}
.pokemon-title a { text-decoration: none; }
.collection-tabs {
  display: inline-flex;
  border: 2px solid var(--poke-line);
  background: #fff;
}
.collection-tabs a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  border-right: 1px solid var(--poke-line);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.collection-tabs a:last-child { border-right: 0; }
.collection-tabs a:hover { background: var(--poke-surface); }
.collection-tabs a.active { background: var(--poke-yellow); }
.pokemon-count {
  min-width: max-content;
  font-size: 13px;
  font-weight: 800;
}
.pokemon-count strong { font-size: 22px; }

.pokemon-shell { max-width: 1320px; margin: 0 auto; background: #fff; }
.pokemon-hero {
  position: relative;
  min-height: 430px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--poke-blue) url("images/pokemon/costume-maniacs.jpg") center / cover no-repeat;
  border-bottom: 2px solid var(--poke-line);
}
.pokemon-hero::before {
  content: "";
  position: absolute;
  inset: 0 48% 0 0;
  background: rgba(16, 20, 26, .9);
}
.pokemon-hero-copy {
  position: relative;
  z-index: 1;
  width: min(620px, 52%);
  padding: 54px 48px 50px;
  color: #fff;
}
.pokemon-kicker {
  margin: 0 0 12px;
  color: var(--poke-yellow);
  font-size: 13px;
  font-weight: 900;
}
.pokemon-hero h1 {
  margin: 0;
  max-width: 560px;
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1.07;
  letter-spacing: 0;
}
.pokemon-hero h1 span { display: block; color: var(--poke-yellow); }
.pokemon-hero-summary { margin: 20px 0 0; max-width: 530px; color: rgba(255, 255, 255, .78); }
.pokemon-hero-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  padding: 10px 20px;
  border: 2px solid #fff;
  color: var(--poke-ink);
  background: var(--poke-yellow);
  box-shadow: 4px 4px 0 #fff;
  font-weight: 900;
  text-decoration: none;
}

.pokemon-stats {
  min-height: 86px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 2px solid var(--poke-line);
  background: var(--poke-yellow);
}
.pokemon-stat {
  padding: 18px 24px;
  border-right: 1px solid rgba(32, 36, 42, .42);
}
.pokemon-stat:last-child { border-right: 0; }
.pokemon-stat strong { display: block; font-size: 24px; line-height: 1.1; }
.pokemon-stat span { font-size: 12px; font-weight: 800; }

.pokemon-projects { padding: 34px 36px 0; }
.pokemon-projects h2,
.pokemon-section h2,
.pokemon-related h2 {
  margin: 0 0 16px;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: 0;
}
.pokemon-project-buttons {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 2px solid var(--poke-line);
}
.pokemon-project-buttons button {
  min-height: 54px;
  border: 0;
  border-right: 1px solid var(--poke-line);
  padding: 9px 10px;
  color: var(--poke-ink);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}
.pokemon-project-buttons button:last-child { border-right: 0; }
.pokemon-project-buttons button:hover { background: var(--poke-surface); }
.pokemon-project-buttons button.active { color: #fff; background: var(--poke-red); }

.pokemon-section { padding: 44px 36px 0; }
.pokemon-toolbar {
  display: grid;
  grid-template-columns: minmax(250px, 1.3fr) repeat(5, minmax(130px, .75fr));
  gap: 10px;
  margin-bottom: 14px;
}
.pokemon-toolbar label { min-width: 0; }
.pokemon-toolbar span {
  display: block;
  margin-bottom: 5px;
  color: var(--poke-muted);
  font-size: 12px;
  font-weight: 800;
}
.pokemon-toolbar input,
.pokemon-toolbar select {
  width: 100%;
  min-height: 46px;
  border: 2px solid var(--poke-line);
  border-radius: 0;
  padding: 9px 11px;
  color: var(--poke-ink);
  background: #fff;
  outline: 0;
}
.pokemon-toolbar input:focus,
.pokemon-toolbar select:focus { box-shadow: 0 0 0 3px rgba(53, 166, 184, .35); }
.pokemon-result-count { margin: 0 0 16px; color: var(--poke-muted); font-size: 13px; font-weight: 700; }

.pokemon-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pokemon-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--poke-line);
  border-radius: 6px;
  color: var(--poke-ink);
  background: #fff;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.pokemon-card:hover { transform: translateY(-3px); box-shadow: 6px 6px 0 var(--poke-cyan); }
.pokemon-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 2px solid var(--poke-line);
  background: var(--poke-surface);
}
.pokemon-card-media img { width: 100%; height: 100%; object-fit: cover; }
.pokemon-card-series {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 9px;
  max-width: calc(100% - 18px);
  padding: 4px 7px;
  border: 1px solid var(--poke-line);
  color: var(--poke-ink);
  background: var(--poke-yellow);
  font-size: 10px;
  font-weight: 900;
}
.pokemon-image-fallback {
  width: 100%;
  height: 100%;
  min-height: 190px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 38px 18px 18px;
  color: var(--poke-ink);
  background: #edf0f3;
  text-align: center;
}
.pokemon-image-fallback::before {
  content: "";
  width: 78px;
  height: 16px;
  border-top: 8px solid var(--poke-yellow);
  border-bottom: 8px solid var(--poke-blue);
  transform: skew(-22deg);
}
.pokemon-image-fallback .fallback-number { font-size: 11px; font-weight: 900; }
.pokemon-image-fallback strong { font-size: 22px; }
.pokemon-image-fallback span:last-child { color: var(--poke-muted); font-size: 12px; font-weight: 700; }
.pokemon-card-copy { padding: 15px 15px 17px; }
.pokemon-card-type { margin: 0 0 5px; color: var(--poke-red); font-size: 10px; font-weight: 900; }
.pokemon-card h3 { margin: 0 0 7px; font-size: 19px; line-height: 1.35; letter-spacing: 0; }
.pokemon-card-original {
  min-height: 38px;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--poke-muted);
  font-size: 12px;
}
.pokemon-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.pokemon-card-tags span {
  padding-bottom: 1px;
  border-bottom: 2px solid var(--poke-cyan);
  font-size: 10px;
  font-weight: 800;
}
.pokemon-load-row { display: flex; justify-content: center; padding: 28px 0 44px; }
.pokemon-load-row button {
  min-width: 190px;
  min-height: 46px;
  border: 2px solid var(--poke-line);
  border-radius: 0;
  color: var(--poke-ink);
  background: var(--poke-yellow);
  box-shadow: 4px 4px 0 var(--poke-line);
  font-weight: 900;
}
.pokemon-load-row button[hidden] { display: none; }
.pokemon-empty { grid-column: 1 / -1; padding: 60px 20px; border: 2px dashed var(--poke-line); color: var(--poke-muted); text-align: center; }

.pokemon-footer { padding: 28px 24px; color: #fff; background: var(--poke-ink); font-size: 12px; text-align: center; }

.pokemon-breadcrumb { padding: 26px 36px 0; color: var(--poke-blue); font-size: 13px; font-weight: 800; }
.pokemon-breadcrumb a { text-decoration: none; border-bottom: 1px solid currentColor; }
.pokemon-detail-layout {
  display: grid;
  grid-template-columns: minmax(390px, .9fr) minmax(460px, 1.1fr);
  gap: 42px;
  padding: 26px 36px 20px;
}
.pokemon-detail-image {
  min-height: 500px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--poke-line);
  background: var(--poke-surface);
  box-shadow: 9px 9px 0 var(--poke-yellow);
}
.pokemon-detail-image img { width: 100%; height: 100%; max-height: 540px; object-fit: contain; }
.pokemon-detail-copy { padding-top: 8px; }
.pokemon-eyebrow { margin: 0 0 9px; color: var(--poke-red); font-size: 12px; font-weight: 900; }
.pokemon-detail-copy h1 { margin: 0; font-size: clamp(34px, 4vw, 54px); line-height: 1.12; letter-spacing: 0; }
.pokemon-detail-original { margin: 12px 0 20px; color: var(--poke-muted); font-weight: 700; }
.pokemon-detail-summary { margin: 0 0 20px; padding-left: 14px; border-left: 5px solid var(--poke-yellow); }
.pokemon-detail-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 2px solid var(--poke-line); }
.pokemon-detail-specs > div { min-width: 0; padding: 12px 8px 12px 0; border-bottom: 1px solid #c8cdd3; }
.pokemon-detail-specs dt { color: var(--poke-muted); font-size: 11px; font-weight: 800; }
.pokemon-detail-specs dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 800; }
.pokemon-detail-notes { margin-top: 22px; padding: 16px 18px; border-left: 5px solid var(--poke-cyan); background: #edf7f8; }
.pokemon-detail-notes h2 { margin: 0 0 7px; font-size: 15px; }
.pokemon-detail-notes p { margin: 0; color: #3d454c; font-size: 13px; line-height: 1.75; white-space: pre-line; }
.pokemon-detail-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.pokemon-primary-link,
.pokemon-secondary-link { min-height: 44px; display: inline-flex; align-items: center; padding: 9px 16px; font-weight: 900; text-decoration: none; }
.pokemon-primary-link { border: 2px solid var(--poke-line); color: #fff; background: var(--poke-red); box-shadow: 3px 3px 0 var(--poke-line); }
.pokemon-secondary-link { color: var(--poke-blue); border-bottom: 2px solid var(--poke-blue); }
.pokemon-related { padding: 38px 36px 48px; }
.pokemon-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

@media (max-width: 1120px) {
  .nav-links { gap: 2px; }
  .nav-links a { padding-inline: 9px; font-size: 12px; }
  .pokemon-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pokemon-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pokemon-project-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pokemon-project-buttons button:nth-child(3) { border-right: 0; }
  .pokemon-project-buttons button:nth-child(-n+3) { border-bottom: 1px solid var(--poke-line); }
  .pokemon-detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  body { padding-top: calc(58px + env(safe-area-inset-top)); }
  .g-nav {
    position: fixed;
    inset: 0 0 auto;
    min-height: calc(58px + env(safe-area-inset-top));
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  }
  .nav-brand { justify-self: center; font-size: 18px; }
  .nav-links { display: none; }
  .mobile-nav-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(224, 180, 88, .55);
    border-radius: 6px;
    color: #e0b458;
    background: rgba(255, 255, 255, .02);
  }
  .mobile-nav-spacer { display: block; width: 42px; height: 42px; }
  .mobile-menu-icon { position: relative; width: 20px; height: 14px; }
  .mobile-menu-icon span { position: absolute; left: 0; width: 20px; height: 2px; background: currentColor; transition: top .2s ease, transform .2s ease, opacity .2s ease; }
  .mobile-menu-icon span:nth-child(1) { top: 0; }
  .mobile-menu-icon span:nth-child(2) { top: 6px; }
  .mobile-menu-icon span:nth-child(3) { top: 12px; }
  .g-nav.mobile-menu-open .mobile-menu-icon span:nth-child(1) { top: 6px; transform: rotate(45deg); }
  .g-nav.mobile-menu-open .mobile-menu-icon span:nth-child(2) { opacity: 0; }
  .g-nav.mobile-menu-open .mobile-menu-icon span:nth-child(3) { top: 6px; transform: rotate(-45deg); }
  .mobile-nav-overlay {
    position: fixed;
    inset: calc(58px + env(safe-area-inset-top)) 0 0;
    z-index: 160;
    display: block;
    opacity: 0;
    pointer-events: none;
    background: rgba(3, 10, 17, .6);
    transition: opacity .2s ease;
  }
  .mobile-nav-menu {
    position: fixed;
    z-index: 165;
    top: calc(66px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    display: grid;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    border: 1px solid rgba(224, 180, 88, .3);
    border-radius: 6px;
    padding: 8px;
    background: rgba(5, 16, 27, .99);
    box-shadow: 0 22px 50px rgba(0, 0, 0, .4);
    transition: opacity .2s ease, transform .2s ease;
  }
  .mobile-nav-overlay.is-open,
  .mobile-nav-menu.is-open { opacity: 1; pointer-events: auto; }
  .mobile-nav-menu.is-open { transform: none; }
  .mobile-nav-menu a { padding: 12px 14px; border-radius: 4px; color: rgba(244, 241, 233, .78); font-size: 14px; font-weight: 800; text-decoration: none; }
  .mobile-nav-menu a[aria-current="page"] { color: #07131f; background: #e0b458; }
  .current-page-tag { float: right; font-size: 11px; }

  .pokemon-subnav { min-height: auto; padding: 14px 18px; flex-wrap: wrap; gap: 10px; }
  .pokemon-title { width: 100%; }
  .collection-tabs { max-width: 100%; overflow-x: auto; }
  .collection-tabs a { white-space: nowrap; }
  .pokemon-count { margin-left: auto; }
  .pokemon-hero { min-height: 560px; align-items: flex-start; background-position: 58% bottom; background-size: auto 58%; background-color: #d9eef3; background-repeat: no-repeat; }
  .pokemon-hero::before { inset: 0 0 auto; height: 47%; background: var(--poke-ink); }
  .pokemon-hero-copy { width: 100%; padding: 34px 22px; }
  .pokemon-hero h1 { font-size: clamp(42px, 13vw, 58px); }
  .pokemon-hero-summary { font-size: 14px; }
  .pokemon-stats { grid-template-columns: repeat(2, 1fr); }
  .pokemon-stat:nth-child(2) { border-right: 0; }
  .pokemon-stat:nth-child(-n+2) { border-bottom: 1px solid rgba(32, 36, 42, .42); }
  .pokemon-projects,
  .pokemon-section,
  .pokemon-related { padding-left: 20px; padding-right: 20px; }
  .pokemon-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pokemon-toolbar label:first-child { grid-column: 1 / -1; }
  .pokemon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pokemon-breadcrumb { padding: 20px 20px 0; }
  .pokemon-detail-layout { gap: 26px; padding: 22px 20px; }
  .pokemon-detail-image { min-height: 360px; }
  .pokemon-related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .pokemon-title { font-size: 19px; }
  .pokemon-count { display: none; }
  .collection-tabs { width: 100%; }
  .collection-tabs a { flex: 1; justify-content: center; padding-inline: 9px; font-size: 12px; }
  .pokemon-hero { min-height: 590px; background-size: auto 54%; }
  .pokemon-hero::before { height: 52%; }
  .pokemon-hero-copy { padding: 30px 20px; }
  .pokemon-hero-link { width: 100%; }
  .pokemon-project-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pokemon-project-buttons button,
  .pokemon-project-buttons button:nth-child(3) { border-right: 1px solid var(--poke-line); border-bottom: 1px solid var(--poke-line); }
  .pokemon-project-buttons button:nth-child(even) { border-right: 0; }
  .pokemon-project-buttons button:nth-last-child(-n+2) { border-bottom: 0; }
  .pokemon-toolbar { grid-template-columns: 1fr; }
  .pokemon-toolbar label:first-child { grid-column: auto; }
  .pokemon-grid { grid-template-columns: 1fr; }
  .pokemon-card { display: grid; grid-template-columns: 42% 1fr; }
  .pokemon-card-media { aspect-ratio: auto; min-height: 178px; border-bottom: 0; border-right: 2px solid var(--poke-line); }
  .pokemon-image-fallback { min-height: 176px; padding: 40px 10px 12px; }
  .pokemon-image-fallback::before { width: 58px; }
  .pokemon-card h3 { font-size: 17px; }
  .pokemon-detail-copy h1 { font-size: 38px; }
  .pokemon-detail-specs { grid-template-columns: 1fr; }
}
