/* ==========================================================================
   Aniimo Wiki — Theme
   Dual-layer system: dark navy chrome (Aniimo promo UI) + light airy page body
   Built to Ada's UI spec (aniimogame.net, 2026-09-15)
   ========================================================================== */

:root {
  /* --- Navy chrome --- */
  --navy-950: #101C2D;
  --navy-900: #17263A;
  --navy-850: #1D3048;
  --navy-800: #243A55;

  /* --- Page surfaces --- */
  --page-bg: #F6FAFD;
  --surface: #FFFFFF;
  --surface-blue: #F0F8FC;

  /* --- Text --- */
  --text-primary: #203247;
  --text-secondary: #65778A;
  --text-muted: #8FA0AF;

  /* --- Fantasy accents --- */
  --sky-blue: #63C7F1;
  --cyan: #5DE0EA;
  --soft-blue: #8BC8FF;
  --lavender: #9D8DF1;
  --violet: #786BEF;
  --pink: #F48AB0;
  --soft-pink: #FFB2CA;

  /* --- Nature --- */
  --grass: #72BA78;
  --leaf: #5EA46D;

  /* --- Borders --- */
  --border: #DCE9F1;
  --border-accent: #CDEAF4;

  /* --- Gradients --- */
  --grad-tri: linear-gradient(135deg, #F48AB0 0%, #9D8DF1 48%, #63C7F1 100%);
  --grad-cyan: linear-gradient(135deg, #63C7F1 0%, #5DE0EA 100%);

  /* --- Radii (spec §22) --- */
  --r-sm: 8px;
  --r-control: 12px;
  --r-card: 18px;
  --r-card-lg: 22px;
  --r-hero: 26px;

  /* --- Shadows (spec §23) --- */
  --shadow-card: 0 4px 18px rgba(25, 50, 70, 0.06);
  --shadow-card-hover: 0 6px 24px rgba(25, 55, 78, 0.10);
  --shadow-elevated: 0 10px 32px rgba(25, 50, 70, 0.10);

  /* --- Type --- */
  --font-head: 'Nunito Sans', 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* --- Layout --- */
  --container: 1220px;
  --header-h: 70px;

  /* --- Legacy aliases: the template's inline styles / older rules reference
         these. Map every one onto the new palette or search panel, breadcrumbs,
         tables and generic cards silently break. --- */
  --ink: var(--text-primary);
  --ink-soft: var(--text-secondary);
  --ink-faint: var(--text-muted);
  --paper: var(--page-bg);
  --paper-edge: var(--border);
  --sand: var(--surface-blue);
  --ocean: var(--sky-blue);
  --forest: var(--grass);
  --sunset: var(--pink);
  --clay: var(--lavender);
  --yellow: var(--gold, #E9C46A);
  --bg-card: var(--surface);
  --border-color: var(--border);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--page-bg);
  /* Spec §2: never a flat gray background — subtle environmental variation */
  background-image:
    radial-gradient(circle at 15% 5%, rgba(99, 199, 241, 0.08), transparent 28%),
    radial-gradient(circle at 90% 20%, rgba(244, 138, 176, 0.05), transparent 25%),
    radial-gradient(circle at 50% 95%, rgba(157, 141, 241, 0.045), transparent 30%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

img { max-width: 100%; height: auto; display: block; }
a { color: #2A93BC; text-decoration: none; }
a:hover { color: #1E7A9E; text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--text-primary);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.1rem; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--surface); color: var(--navy-900); padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ==========================================================================
   §3 HEADER / NAVIGATION — dark navy bar
   ========================================================================== */
.site-header {
  background: var(--navy-900);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid rgba(120, 210, 235, 0.16);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
}
.brand-text {
  font-family: var(--font-head);
  font-weight: 800; font-size: 1.16rem;
  color: #FFFFFF; letter-spacing: -0.01em;
  position: relative;
}
.brand-text em {
  font-style: normal;
  background: var(--grad-tri);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.header-nav {
  display: flex; align-items: center; gap: 2px;
  margin-left: auto; flex-wrap: nowrap;
}
.header-nav a {
  font-size: 0.875rem; font-weight: 600;
  color: #DCE8F4;
  padding: 8px 10px;
  text-decoration: none;
  border-radius: var(--r-sm);
  position: relative;
  white-space: nowrap;
  transition: color 180ms ease;
}
.header-nav a:hover { color: #FFFFFF; text-decoration: none; }
.header-nav a.active { color: #FFFFFF; }
/* active indicator: tiny gradient underline */
.header-nav a.active::after {
  content: '';
  position: absolute; left: 10px; right: 10px; bottom: 0;
  height: 2.5px; border-radius: 2px;
  background: var(--grad-tri);
  box-shadow: 0 0 8px rgba(99, 199, 241, 0.55);
}

.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  color: #DCE8F4; font-size: 1.35rem; line-height: 1; padding: 6px 8px;
}

/* Search (spec §3) */
.search-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--cyan); font-size: 1.2rem; padding: 6px 8px; flex-shrink: 0;
  line-height: 1;
}
.search-wrap { position: relative; flex-shrink: 0; }
.search-field {
  display: flex; align-items: center; gap: 8px;
  width: 260px; height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-control);
  padding: 0 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.search-field:focus-within {
  border-color: var(--sky-blue);
  box-shadow: 0 0 0 3px rgba(99, 199, 241, 0.14);
}
.search-field svg { flex-shrink: 0; color: var(--cyan); }
.search-field input {
  background: transparent; border: none; outline: none;
  color: #FFFFFF; font-family: var(--font-body); font-size: 0.85rem;
  width: 100%; min-width: 0;
}
.search-field input::placeholder { color: #A9B8C6; }

.search-panel {
  display: none;
  background: var(--navy-850);
  border-bottom: 1px solid rgba(120, 210, 235, 0.16);
  padding: 18px 0;
}
.search-panel.open { display: block; }
.search-panel-inner { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.search-results a {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: #DCE8F4; font-size: 0.9rem; text-decoration: none;
}
.search-results a:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.search-results .sr-cat {
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan); flex-shrink: 0; min-width: 74px;
}
.search-results .sr-desc { font-size: 0.76rem; color: #8FA4B8; display: block; }

/* ==========================================================================
   §4 HERO
   ========================================================================== */
.hero {
  max-width: var(--container);
  margin: 28px auto 0;
  padding: 0 24px;
}
.hero-card {
  position: relative;
  border-radius: var(--r-hero);
  overflow: hidden;
  min-height: 460px;
  display: flex; align-items: center;
  background: var(--navy-800);
  box-shadow: var(--shadow-elevated);
}
.hero-card > img.hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center 40%;
}
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(15, 28, 45, 0.80) 0%,
    rgba(15, 28, 45, 0.52) 35%,
    rgba(15, 28, 45, 0.08) 70%,
    transparent 100%);
}
.hero-content {
  position: relative; z-index: 2;
  padding: 52px 56px;
  max-width: 640px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: #75DDF0; margin-bottom: 14px;
}
.hero-content h1 {
  font-size: clamp(30px, 4.6vw, 54px);
  font-weight: 800; color: #FFFFFF;
  line-height: 1.12; margin: 0 0 16px;
  letter-spacing: -0.015em;
}
.hero-sub {
  font-size: 18px; line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 26px; max-width: 540px;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px;
  border-radius: 13px;
  font-family: var(--font-body); font-size: 0.92rem; font-weight: 700;
  cursor: pointer; text-decoration: none; border: 1px solid transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: #FFFFFF; color: var(--navy-900); }
.btn-primary:hover { color: var(--navy-900); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22); }
.btn-ghost {
  background: rgba(16, 28, 45, 0.42);
  color: #FFFFFF; border-color: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { color: #FFFFFF; background: rgba(16, 28, 45, 0.6); }
.btn-cyan { background: var(--grad-cyan); color: var(--navy-950); }
.btn-cyan:hover { color: var(--navy-950); box-shadow: 0 8px 22px rgba(93, 224, 234, 0.32); }

/* Spec §24 — magical decoration, sparse */
.sparkle { color: var(--pink); }

/* ==========================================================================
   §5 TYPOGRAPHY inside content
   ========================================================================== */
.content-wrapper {
  max-width: var(--container);
  margin: 0 auto;
  padding: 44px 24px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}
article.main-content { min-width: 0; }
.article-body { font-size: 16.5px; line-height: 1.75; color: var(--text-primary); max-width: 800px; }
.article-body h2 {
  font-size: 32px; font-weight: 800; color: var(--text-primary);
  margin: 52px 0 16px; scroll-margin-top: 92px;
  position: relative; padding-left: 0;
}
.article-body h2 > .anchor-link { margin-left: 8px; }
.article-body h3 {
  font-size: 22px; font-weight: 700; color: #304A61;
  margin: 34px 0 12px; scroll-margin-top: 92px;
}
.article-body h4 { font-size: 18px; font-weight: 700; color: #374F66; margin: 24px 0 8px; }
.article-body ul, .article-body ol { margin: 0 0 1.15rem; padding-left: 1.35rem; }
.article-body li { margin-bottom: 0.45rem; }
.article-body li > ul, .article-body li > ol { margin-top: 0.45rem; margin-bottom: 0.35rem; }
.article-body strong { font-weight: 700; color: #1A2A3B; }
.article-body code {
  font-size: 0.88em; background: var(--surface-blue); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px; color: #2C5C74;
}
.article-body > p, .article-body > ul, .article-body > ol { max-width: 760px; }

.anchor-link {
  color: var(--border-accent); font-weight: 400; text-decoration: none;
  opacity: 0; transition: opacity 160ms ease; font-size: 0.7em;
}
.article-body h2:hover .anchor-link, .article-body h3:hover .anchor-link { opacity: 1; }

/* decorative gradient bar before selected major headings (spec §13) */
/* H2 accent bar. Scoped + higher specificity so it beats the generic
   ".article-body h2 { padding-left: 0 }" rule — otherwise the bar overlaps
   the heading text (Ada 2026-09-15 #10). */
.article-body h2.h-accent,
.article-body h3.h-accent,
h2.h-accent, h3.h-accent {
  padding-left: 22px;
  position: relative;
}
.h-accent::before,
.article-body h2.h-accent::before,
.article-body h3.h-accent::before {
  content: '';
  position: absolute; left: 0; top: 0.26em;
  width: 5px; height: 26px; border-radius: 3px;
  background: linear-gradient(180deg, #5DE0EA 0%, #F48AB0 100%);
}
.article-body h2.h-accent { font-size: 32px; }
.h-accent.h-accent-lg::before { height: 32px; top: 0.2em; }

/* ==========================================================================
   §6 page header block (article top)
   ========================================================================== */
.page-head { max-width: 800px; }
.page-head h1 {
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 800; line-height: 1.14;
  margin: 0 0 16px; letter-spacing: -0.015em;
}
.page-lead {
  font-size: 17.5px; line-height: 1.65; color: var(--text-secondary);
  margin: 0 0 18px; max-width: 720px;
}

.breadcrumb {
  font-size: 0.8rem; color: #7B8D9D;
  margin: 22px 0 26px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.breadcrumb a { color: #7B8D9D; text-decoration: none; }
.breadcrumb a:hover { color: #26AFCF; text-decoration: none; }
.breadcrumb span { color: #344C61; font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.13em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 7px; margin-bottom: 14px;
}
.badge-guide  { background: #E7F7FD; color: #1E6E82; }
.badge-creature { background: #FDEFF5; color: #B25279; }
.badge-exploration { background: #F1EEFE; color: #5B4DC4; }
.badge-item   { background: #EFF8F1; color: #3E7A4C; }
.badge-quest  { background: #EAF3FD; color: #2B6296; }

.meta-row {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  font-size: 0.79rem; color: var(--text-muted);
  padding-bottom: 22px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.meta-row strong { color: var(--text-secondary); font-weight: 600; }

.article-hero {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 20px; margin: 0 0 28px;
  box-shadow: 0 0 0 1px var(--border), 0 8px 30px rgba(99, 199, 241, 0.13);
}
.img-caption {
  font-size: 0.79rem; color: var(--text-muted); margin: -20px 0 28px;
  text-align: center; font-style: italic;
}

/* ==========================================================================
   §12 TABLE OF CONTENTS
   ========================================================================== */
.toc {
  background: var(--surface-blue);
  border: 1px solid #D5EAF3;
  border-left: 3px solid #65CEE9;
  border-radius: 14px;
  padding: 18px 22px;
  margin: 0 0 34px;
  max-width: 800px;
}
.toc h2 {
  font-size: 0.72rem !important; font-weight: 800 !important;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: #42677F !important; margin: 0 0 10px !important;
  padding: 0 !important;
}
.toc h2::before { display: none !important; }
.toc ol { list-style: none; margin: 0 !important; padding: 0 !important; counter-reset: toc; }
.toc li { margin: 0 !important; counter-increment: toc; }
.toc li a {
  display: block; padding: 5px 0; font-size: 0.9rem;
  color: #42677F; text-decoration: none; border-left: 2px solid transparent;
  padding-left: 10px; margin-left: -11px;
}
.toc li a:hover { color: #26AFCF; text-decoration: none; }
.toc li a::before {
  content: counter(toc) '. ';
  color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 0.82em;
}
.toc ol ol { padding-left: 18px !important; margin-top: 2px !important; }
.toc ol ol li a::before { content: '– '; }
.toc-toggle {
  display: none; width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; padding: 0;
  font-family: var(--font-head); font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase; color: #42677F;
}

/* ==========================================================================
   §14 INFORMATION BOXES
   ========================================================================== */
.infobox {
  border-radius: 14px; padding: 16px 20px; margin: 22px 0;
  border: 1px solid; font-size: 15.5px; line-height: 1.68;
  max-width: 800px;
}
.infobox > :last-child { margin-bottom: 0; }
.infobox p { margin-bottom: 0.6rem; }
.infobox-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-size: 0.7rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 7px;
}
.infobox-tip    { background: #EFFAFD; border-color: #CBEAF2; }
.infobox-tip    .infobox-label { color: #55C8DE; }
.infobox-important { background: #FFF7FA; border-color: #F5D7E3; }
.infobox-important .infobox-label { color: #EE8AAE; }
.infobox-note   { background: #F5F3FE; border-color: #DDD8FA; }
.infobox-note   .infobox-label { color: #9587EA; }
.infobox-success { background: #F2FAF4; border-color: #D4ECD9; }
.infobox-success .infobox-label { color: #69B97A; }

/* ==========================================================================
   §15 TABLES
   ========================================================================== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  margin: 22px 0 28px;
  -webkit-overflow-scrolling: touch;
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.885rem; min-width: 560px; }
.table-wrap thead th {
  background: #EDF7FB; color: #304B60;
  font-family: var(--font-head); font-weight: 800; font-size: 0.76rem;
  letter-spacing: 0.07em; text-transform: uppercase;
  text-align: left; padding: 12px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table-wrap tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #E8F0F5;
  color: var(--text-secondary); vertical-align: middle;
}
.table-wrap tbody tr:nth-child(even) { background: #FAFCFD; }
.table-wrap tbody tr:hover { background: #F3F9FC; }
.table-wrap tbody tr:last-child td { border-bottom: none; }
.table-wrap td:first-child { color: var(--text-primary); font-weight: 600; }
.table-wrap td strong { color: var(--text-primary); font-weight: 700; }
.table-wrap img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; }
.table-wrap .dex-no {
  font-variant-numeric: tabular-nums; font-size: 0.78rem;
  color: var(--text-muted); font-weight: 700;
}

/* element chips used in dex tables */
.el {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  padding: 2px 9px; border-radius: 6px; white-space: nowrap;
  letter-spacing: 0.02em;
}
.el-holy     { background: #FBF6E4; color: #8A7420; }
.el-fire     { background: #FDEDE6; color: #B4522A; }
.el-ice      { background: #EAF6FC; color: #2C7BA4; }
.el-dark     { background: #EEECF6; color: #554A8C; }
.el-electric { background: #FDF7E3; color: #96780F; }
.el-grass    { background: #EDF8EF; color: #3D7C4B; }
.el-water    { background: #E8F3FC; color: #2A6E9E; }
.el-rock     { background: #F2EFEA; color: #6B5D48; }
.el-wind     { background: #EDF9F6; color: #327F6C; }

.role {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  padding: 2px 9px; border-radius: 6px;
}
.role-dps    { background: #FDECEC; color: #B0464A; }
.role-heal   { background: #EDF8EF; color: #3D7C4B; }
.role-support{ background: #EAF3FD; color: #2B6296; }
.role-break  { background: #FDF4E7; color: #9A6520; }
.role-regen  { background: #F0EEFB; color: #5B4DC4; }

.stage {
  display: inline-block; font-size: 0.7rem; font-weight: 700;
  padding: 2px 9px; border-radius: 6px;
}
.stage-lumin { background: #EFF7FC; color: #3A7096; }
.stage-gamma { background: #F1EEFE; color: #5B4DC4; }
.stage-nova  { background: #FDEFF5; color: #B25279; }

/* ==========================================================================
   §7 HOMEPAGE GUIDE CARDS
   ========================================================================== */
.section { margin: 68px 0 0; }
.section-head { max-width: 800px; margin-bottom: 26px; }
.section-head h2 {
  font-size: 33px; font-weight: 800; color: var(--text-primary);
  margin: 0 0 8px; letter-spacing: -0.012em;
  display: flex; align-items: center; gap: 10px;
}
.section-head .sparkle-lead { font-size: 0.62em; line-height: 1; }
.section-head p { font-size: 16px; color: #718498; margin: 0; max-width: 660px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: #BFE5F3;
  text-decoration: none;
}
.card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-blue); }
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 220ms ease;
}
.card:hover .card-media img { transform: scale(1.025); }
.card-body { padding: 19px 20px 21px; display: flex; flex-direction: column; flex: 1; }
.card-cat {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; margin-bottom: 8px;
}
.card-cat-guide      { color: #26AFCF; }
.card-cat-creature   { color: #D9628E; }
.card-cat-exploration{ color: #7869D8; }
.card-cat-item       { color: #4E9B60; }
.card-cat-quest      { color: #3E86C4; }
.card h3 {
  font-size: 21px; font-weight: 700; color: var(--text-primary);
  margin: 0 0 8px; line-height: 1.3;
}
.card p { font-size: 14.5px; color: var(--text-secondary); margin: 0; line-height: 1.6; }
.card-link-row { margin-top: auto; padding-top: 14px; font-size: 0.82rem; font-weight: 700; color: #26AFCF; }

/* Spec §8 FEATURED GUIDE — 55/45 horizontal */
.featured-card {
  display: grid; grid-template-columns: 55% 45%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.featured-card:hover {
  box-shadow: var(--shadow-card-hover); border-color: #BFE5F3; transform: translateY(-3px);
  text-decoration: none;
}
.featured-media { min-height: 340px; overflow: hidden; background: var(--surface-blue); }
.featured-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 220ms ease; }
.featured-card:hover .featured-media img { transform: scale(1.02); }
.featured-body { padding: 34px 36px; display: flex; flex-direction: column; justify-content: center; }
.featured-body h3 { font-size: 28px; font-weight: 800; margin: 0 0 12px; line-height: 1.22; }
.featured-body p { font-size: 15.5px; color: var(--text-secondary); margin: 0 0 18px; }
.grad-rule {
  width: 56px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #F48AB0 0%, #63C7F1 100%);
  margin-bottom: 18px;
}

/* ==========================================================================
   §16 CREATURE CARDS
   ========================================================================== */
.creature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
  gap: 18px;
  margin: 22px 0 30px;
}
.creature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.creature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); border-color: #BFE5F3; }
.creature-portrait {
  aspect-ratio: 1 / 1; overflow: hidden;
  background: linear-gradient(145deg, #F1F9FD, #F9F3FD);
  display: grid; place-items: center;
}
.creature-portrait img { width: 100%; height: 100%; object-fit: cover; }
.creature-body { padding: 14px 15px 16px; }
.creature-no { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; color: var(--text-muted); }
.creature-body h3 { font-size: 18px; font-weight: 700; margin: 3px 0 9px; }
.creature-tags { display: flex; gap: 5px; flex-wrap: wrap; }

/* ==========================================================================
   §17 FILTERS
   ========================================================================== */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 18px 0 20px; align-items: center;
}
.filter-chip {
  height: 36px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #EFF4F7; color: #526A7C;
  border: 1px solid transparent; border-radius: 10px;
  font-family: var(--font-body); font-size: 0.83rem; font-weight: 600;
  cursor: pointer; transition: all 170ms ease;
}
.filter-chip:hover { background: #E7EFF4; color: #3C5768; }
.filter-chip.active {
  background: linear-gradient(135deg, rgba(99,199,241,0.16), rgba(93,224,234,0.13));
  border-color: #72D1E5; color: #1E6E82; font-weight: 700;
}
.filter-label {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--text-muted);
  margin-right: 4px; align-self: center;
}

/* ==========================================================================
   §18 SIDEBAR
   ========================================================================== */
.sidebar { position: sticky; top: 92px; }
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.sidebar-card h3 {
  font-size: 18px; font-weight: 700; color: var(--text-primary);
  margin: 0 0 12px;
}
.sidebar-card ul { list-style: none; margin: 0; padding: 0; }
.sidebar-card li { margin-bottom: 11px; }
.sidebar-card li:last-child { margin-bottom: 0; }
.sidebar-card a { color: var(--text-secondary); font-size: 14.5px; text-decoration: none; display: block; }
.sidebar-card a:hover { color: #26AFCF; text-decoration: none; }
.side-item { display: flex; gap: 11px; align-items: flex-start; }
.side-item img {
  width: 70px; height: 50px; object-fit: cover;
  border-radius: 9px; flex-shrink: 0; border: 1px solid var(--border);
}
.side-item span { font-size: 14px; line-height: 1.45; }
.side-sub { font-size: 0.72rem; color: var(--text-muted); display: block; margin-top: 2px; }
.side-toc a { border-left: 2px solid var(--border); padding-left: 11px; margin-left: -2px; font-size: 0.85rem; }
.side-toc a:hover { border-left-color: var(--cyan); }

/* ==========================================================================
   §19 SEARCH RESULTS PAGE
   ========================================================================== */
.result-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 20px; margin-bottom: 14px;
  box-shadow: var(--shadow-card);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.result-card:hover { border-color: #BFE5F3; box-shadow: var(--shadow-card-hover); text-decoration: none; }
.result-card img { width: 112px; height: 72px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.result-card h3 { font-size: 18px; font-weight: 700; margin: 3px 0 6px; }
.result-card p { font-size: 14px; color: var(--text-secondary); margin: 0 0 7px; }
.result-date { font-size: 0.74rem; color: var(--text-muted); }

/* ==========================================================================
   §20 FOOTER
   ========================================================================== */
.site-footer {
  background: var(--navy-900);
  border-top: 1px solid rgba(120, 210, 235, 0.16);
  margin-top: 80px;
  padding: 52px 0 26px;
  color: #AFC0CF;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 180px; height: 2px;
  background: var(--grad-tri); opacity: 0.65; border-radius: 2px;
}
.footer-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 24px 34px;
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px;
}
.footer-brand { font-family: var(--font-head); font-weight: 800; font-size: 1.1rem; color: #FFFFFF; margin-bottom: 10px; }
.footer-brand em {
  font-style: normal; background: var(--grad-tri);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.footer-about { font-size: 0.83rem; line-height: 1.65; color: #AFC0CF; margin: 0; max-width: 300px; }
.footer-col strong {
  display: block; font-family: var(--font-head); font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase; color: #FFFFFF; margin-bottom: 12px;
}
.footer-col a { display: block; color: #AFC0CF; font-size: 0.85rem; padding: 3px 0; text-decoration: none; }
.footer-col a:hover { color: #72D9EA; text-decoration: none; }
.footer-bottom {
  max-width: var(--container); margin: 0 auto; padding: 20px 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem; color: #8296A8; line-height: 1.65;
}
.footer-bottom a { color: #AFC0CF; }

/* ==========================================================================
   §24 HOMEPAGE SYSTEM CARDS (non-navigation feature list)
   ========================================================================== */
.sys-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(286px, 1fr));
  gap: 16px; list-style: none; margin: 24px 0 0; padding: 0;
}
.sys-list li {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.sys-list h3 {
  font-size: 17px; font-weight: 700; margin: 0 0 6px;
  display: flex; align-items: center; gap: 9px;
}
.sys-icon {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(244,138,176,0.16), rgba(99,199,241,0.16));
  color: #5B7FA6;
}
.sys-list p { font-size: 14.5px; color: var(--text-secondary); margin: 0; line-height: 1.62; }

/* Inline link row (borderline cards moved out of the grid) */
.link-row { margin: 20px 0 0; font-size: 0.86rem; display: flex; flex-wrap: wrap; gap: 18px; }
.link-row a { font-weight: 700; color: #26AFCF; }

/* ==========================================================================
   §27 MOBILE
   ========================================================================== */
@media (max-width: 1024px) {
  .content-wrapper { grid-template-columns: minmax(0, 1fr) 272px; gap: 26px; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-media { min-height: 260px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 26px; }
}

@media (max-width: 860px) {
  .content-wrapper { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  /* Spec §27 + Ada's rule: mobile hides Related, keeps On This Page */
  .sidebar-card.side-related { display: none; }
  .toc { padding: 0; border-left-width: 3px; }
  .toc-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
  }
  .toc-toggle::after { content: '⌄'; font-size: 1rem; color: #65CEE9; }
  .toc.open .toc-toggle::after { content: '⌃'; }
  .toc-body { display: none; padding: 0 20px 16px; }
  .toc.open .toc-body { display: block; }
  .toc h2 { display: none; }
  .toc > h2 { display: none; }
}

@media (max-width: 780px) {
  :root { --header-h: 58px; }
  .header-inner { padding: 0 16px; gap: 12px; }
  .menu-toggle { display: block; }
  .search-wrap { display: none; }
  .header-nav {
    display: none;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--navy-850);
    flex-direction: column; align-items: stretch;
    padding: 10px 14px 16px; gap: 2px;
    border-bottom: 1px solid rgba(120, 210, 235, 0.16);
  }
  .header-nav.open { display: flex; }
  .header-nav a { padding: 11px 10px; font-size: 0.95rem; }
  .header-nav a.active::after { display: none; }
  .header-nav a.active { color: var(--cyan); }

  .container, .hero, .content-wrapper, .footer-inner, .footer-bottom { padding-left: 18px; padding-right: 18px; }
  .hero-card { min-height: 360px; border-radius: 20px; }
  .hero-content { padding: 30px 24px; }
  .hero-sub { font-size: 16px; }
  .btn { height: 44px; padding: 0 18px; font-size: 0.88rem; }

  .section { margin-top: 50px; }
  .section-head h2 { font-size: 25px; }
  .article-body h2 { font-size: 25px; margin-top: 44px; }
  .article-body h3 { font-size: 20px; }
  .article-body { font-size: 16.5px; }
  .card-grid { grid-template-columns: 1fr; gap: 18px; }
  .creature-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 13px; }
  .creature-body h3 { font-size: 16.5px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .result-card { flex-direction: column; }
  .result-card img { width: 100%; height: 150px; }
  .section-head h2 { font-size: 24px; }
  .featured-body { padding: 24px 22px; }
  .featured-body h3 { font-size: 23px; }
}

/* ==========================================================================
   §26 INTERACTION — reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   ADS (placeholders — Ada supplies per-site keys at monetization time)
   ========================================================================== */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  margin: 30px auto; min-height: 90px; max-width: 800px;
  background: var(--surface-blue); border: 1px dashed var(--border-accent);
  border-radius: 14px; color: var(--text-muted); font-size: 0.74rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* ==========================================================================
   v2 REFINEMENT PASS (Ada 2026-09-15) — wider composition, richer visuals,
   Aniimo accent system, homepage portal layout
   ========================================================================== */

/* ---------- Header: nav dropdown ("Guides") ---------- */
.header-nav { gap: 4px; }
.header-nav > a, .nav-drop-btn {
  font-size: 14.5px;
  padding: 9px 12px;
}
.nav-drop { position: relative; }
.nav-drop-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 600;
  color: #DCE8F4; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; gap: 5px;
  transition: color 180ms ease;
  position: relative;
}
.nav-drop-btn:hover, .nav-drop-btn.active { color: #FFFFFF; }
.nav-drop-btn.active::after {
  content: '';
  position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 2.5px; border-radius: 2px;
  background: var(--grad-tri);
  box-shadow: 0 0 8px rgba(99, 199, 241, 0.55);
}
.nav-caret { font-size: 0.62em; opacity: 0.75; }
.nav-drop-menu {
  display: none;
  position: absolute; top: calc(100% + 10px); left: 0;
  min-width: 258px;
  background: var(--navy-850);
  border: 1px solid rgba(120, 210, 235, 0.18);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 16px 40px rgba(16, 28, 45, 0.42);
  z-index: 120;
}
.nav-drop.open .nav-drop-menu { display: block; }
.nav-drop-menu a {
  display: block; padding: 10px 12px; border-radius: 9px;
  color: #DCE8F4; font-size: 14.5px; font-weight: 600; text-decoration: none;
}
.nav-drop-menu a:hover { background: rgba(255,255,255,0.07); color: #FFFFFF; text-decoration: none; }

/* Brand breathing room */
.brand { gap: 12px; margin-right: 10px; }
.brand-text { font-size: 1.22rem; }

/* Mobile: hamburger pinned hard right, vertically centred */
@media (max-width: 980px) {
  .header-inner { position: relative; }
  .header-nav { margin-left: 0; }
  .menu-toggle {
    margin-left: auto;                     /* push to far right */
    display: flex;                         /* centre the glyph in its box */
    align-items: center;
    justify-content: center;
    align-self: center;                    /* centre vertically in header */
    width: 42px; height: 38px;
    flex-shrink: 0;
  }
  .header-search { display: none; }
  .nav-drop-menu { position: static; display: block; min-width: 0; background: none;
    border: none; box-shadow: none; padding: 0 0 0 10px; }
  .nav-drop-btn { width: 100%; justify-content: flex-start; padding: 11px 10px; font-size: 0.95rem; }
  .nav-drop-btn.active::after { display: none; }
  .nav-drop-menu a { padding: 9px 10px; font-size: 0.9rem; opacity: 0.9; }
}

/* ---------- Section backgrounds (§9) ---------- */
.page-wrap { background: var(--page-bg); }
.section-band { background: #FFFFFF; }
.section-band-soft { background: linear-gradient(180deg, #F4FAFD 0%, #F8F6FD 100%); }
.section-band, .section-band-soft {
  padding: 58px 0;
  margin: 0;
}
.section-band .container, .section-band-soft .container { padding-left: 24px; padding-right: 24px; }
.section-tight { padding: 46px 0; }

/* ---------- Hero (§2, §3) ---------- */
.hero { max-width: var(--container); margin: 26px auto 0; padding: 0 24px; }
.hero-card { min-height: 466px; }
.hero-content { padding: 56px 60px; max-width: 660px; }
.hero-content h1 { font-size: clamp(34px, 4.4vw, 56px); }

.hero-ctas { gap: 14px; }
.hero-meta {
  display: flex; gap: 20px; flex-wrap: wrap; margin-top: 26px;
  font-size: 0.84rem; color: rgba(255,255,255,0.72);
}
.hero-meta strong { color: #FFFFFF; font-weight: 700; }
.hero-meta .dot { color: #75DDF0; }

/* Trailer reveal */
.hero-trailer-btn {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 24px;
  background: rgba(16,28,45,0.45); border: 1px solid rgba(255,255,255,0.38);
  color: #FFFFFF; height: 46px; padding: 0 20px; border-radius: 13px;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(6px); transition: background 200ms ease;
}
.hero-trailer-btn:hover { background: rgba(16,28,45,0.66); }
.hero-trailer-btn .play-tri {
  width: 0; height: 0; border-left: 9px solid currentColor;
  border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.hero-video-wrap { display: none; position: absolute; inset: 0; z-index: 5; background: var(--navy-950); }
.hero-video-wrap.open { display: block; }
.hero-video-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.hero-video-close {
  position: absolute; top: 14px; right: 14px; z-index: 6;
  background: rgba(16,28,45,0.72); color: #FFFFFF; border: 1px solid rgba(255,255,255,0.3);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  font-size: 1.1rem; line-height: 1; display: grid; place-items: center;
}
.hero-video-close:hover { background: var(--navy-950); }

/* ---------- Section head (§9, §8) ---------- */
.section-head { max-width: 780px; margin-bottom: 28px; }
.section-head h2 {
  font-size: 33px; font-weight: 800; letter-spacing: -0.012em;
  display: flex; align-items: center; gap: 11px; margin: 0 0 9px;
}
.section-head h2 .sparkle-lead { font-size: 0.6em; line-height: 1; }
.section-head p { font-size: 16.5px; color: #6B7F92; margin: 0; }
.section-head-flex {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 28px; max-width: none;
}
.section-head-flex > div { max-width: 720px; }
.section-more {
  font-size: 0.88rem; font-weight: 700; color: #26AFCF;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding-bottom: 3px;
}
.section-more:hover { text-decoration: none; color: #1E7A9E; }

/* ---------- Cards (§11) ---------- */
.card-grid { gap: 24px; }
.card-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  border-radius: var(--r-card);
  box-shadow: 0 6px 24px rgba(25, 55, 78, 0.06);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(25, 55, 78, 0.10);
  border-color: #BFE5F3;
}
.card:hover .card-media img { transform: scale(1.025); }
.card-body { padding: 20px 21px 22px; }
.card h3 { font-size: 21px; font-weight: 700; }
.card-media { position: relative; }
.card-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 0.63rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 7px;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(4px);
}
.card-badge.t-cyan { color: #16788F; }
.card-badge.t-pink { color: #B25279; }
.card-badge.t-lav  { color: #5B4DC4; }
.card-badge.t-green{ color: #3E7A4C; }
.card-badge.t-blue { color: #2B6296; }

/* Featured row (§12: 3 across) */
.featured-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
.featured-row .card h3 { font-size: 22px; }
.featured-row .card-body { padding: 22px 22px 24px; }

/* Large + small split (§12 beginner section) */
.split-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; align-items: stretch; }
.split-side { display: grid; grid-template-rows: repeat(3, 1fr); gap: 16px; }
.mini-card {
  display: flex; gap: 14px; align-items: center;
  background: #FFFFFF; border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 15px; text-decoration: none;
  box-shadow: 0 4px 16px rgba(25,55,78,0.05);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.mini-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(25,55,78,0.10); border-color: #BFE5F3; text-decoration: none; }
.mini-card img { width: 76px; height: 62px; object-fit: cover; border-radius: 11px; flex-shrink: 0; }
.mini-card-body { min-width: 0; }
.mini-card h3 { font-size: 16.5px; font-weight: 700; margin: 0 0 3px; color: var(--text-primary); }
.mini-card p { font-size: 13.5px; color: var(--text-secondary); margin: 0; line-height: 1.5; }

/* ---------- Explore Aniimo creature cards (§6) ---------- */
.creature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.creature-card {
  border-radius: var(--r-card);
  box-shadow: 0 4px 18px rgba(25, 50, 70, 0.06);
  text-decoration: none; display: block;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.creature-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(25,55,78,0.10); border-color: #BFE5F3; text-decoration: none; }
.creature-portrait {
  aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(145deg, #EEF9FD, #F8F3FD);
  position: relative;
}
.creature-portrait img { width: 100%; height: 100%; object-fit: cover; transition: transform 220ms ease; }
.creature-card:hover .creature-portrait img { transform: scale(1.04); }
.creature-body { padding: 14px 16px 16px; }
.creature-no { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; color: var(--text-muted); }
.creature-body h3 { font-size: 18px; font-weight: 700; margin: 3px 0 9px; color: var(--text-primary); }

/* Explore band uses the atmospheric gradient (§9) */
.band-explore { background: linear-gradient(180deg, #F4FAFD 0%, #F8F6FD 100%); }

/* ---------- FAQ (§5) ---------- */
.faq-list { max-width: 860px; margin: 0; }
.faq-item {
  background: #FFFFFF; border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 24px; margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(25,55,78,0.05);
}
.faq-item h3 {
  font-size: 17.5px; font-weight: 700; margin: 0 0 8px; color: var(--text-primary);
  display: flex; gap: 10px; align-items: flex-start;
}
.faq-item h3 .faq-q {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; margin-top: 1px;
  display: grid; place-items: center; font-size: 0.72rem; font-weight: 800;
  background: linear-gradient(135deg, rgba(99,199,241,0.18), rgba(244,138,176,0.18));
  color: #4A7A94;
}
.faq-item p { font-size: 15.5px; color: var(--text-secondary); margin: 0; line-height: 1.68; }
.faq-item p a { color: #2A93BC; }

/* Concept block — small intro, not a dominant section (§4) */
.concept-row {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 34px; align-items: center;
}
.concept-text h2 { font-size: 30px; font-weight: 800; margin: 0 0 14px; }
.concept-text p { font-size: 16.5px; line-height: 1.72; color: var(--text-secondary); margin: 0 0 14px; }
.concept-media img { width: 100%; border-radius: 22px; box-shadow: 0 10px 32px rgba(25,50,70,0.12); }
.sys-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.sys-pill {
  font-size: 0.78rem; font-weight: 700; padding: 7px 13px; border-radius: 9px;
  background: #FFFFFF; border: 1px solid var(--border-accent); color: #3C6178;
}

/* ---------- Dex filter bar (§13) ---------- */
.dex-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 20px 0 16px; padding: 14px 16px;
  background: var(--surface-blue); border: 1px solid #D5EAF3; border-radius: 14px;
}
.dex-toolbar label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted); margin-right: 2px;
}
.dex-search {
  flex: 1 1 240px; min-width: 180px; height: 38px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0 13px; font-family: var(--font-body); font-size: 0.88rem;
  color: var(--text-primary); background: #FFFFFF; outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.dex-search:focus { border-color: var(--sky-blue); box-shadow: 0 0 0 3px rgba(99,199,241,0.16); }
.dex-count { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }
.dex-count strong { color: var(--text-primary); }
.dex-empty { padding: 30px 16px; text-align: center; color: var(--text-muted); font-size: 0.92rem; }
.table-wrap table.sortable thead th { cursor: pointer; user-select: none; }
.table-wrap table.sortable thead th:hover { background: #E4F2F8; }
.table-wrap table.sortable thead th .sort-ind { opacity: 0.35; font-size: 0.85em; margin-left: 3px; }
.table-wrap table.sortable thead th.sorted .sort-ind { opacity: 1; color: #26AFCF; }

/* ---------- Article pages keep readable width (§13) ---------- */
.article-body { max-width: 800px; }
.content-wrapper { grid-template-columns: minmax(0, 1fr) 306px; gap: 34px; }

/* Section spacing inside article body */
.article-body > h2:first-child { margin-top: 0; }

/* ---------- Related guides as cards (§11 in sidebar, §2 request) ---------- */
.sidebar-card.side-related { padding: 18px 18px 20px; }
.sidebar-card.side-related ul { display: grid; gap: 10px; }
.related-card {
  display: flex; gap: 11px; align-items: center;
  background: #FFFFFF; border: 1px solid var(--border); border-radius: 13px;
  padding: 9px 11px; text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.related-card:hover {
  transform: translateY(-2px); border-color: #BFE5F3; text-decoration: none;
  box-shadow: 0 6px 18px rgba(25,55,78,0.09);
}
.related-card img { width: 62px; height: 46px; object-fit: cover; border-radius: 9px; flex-shrink: 0; }
.related-card span { font-size: 13.5px; font-weight: 600; color: var(--text-secondary); line-height: 1.4; }
.related-card:hover span { color: #26AFCF; }

/* ---------- Footer polish ---------- */
.footer-inner { grid-template-columns: 1.5fr repeat(3, 1fr); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .card-grid-4, .creature-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .featured-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 1024px) {
  .split-grid { grid-template-columns: 1fr; }
  .concept-row { grid-template-columns: 1fr; gap: 26px; }
  .concept-media { order: -1; }
  .card-grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .card-grid-4, .creature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .card-grid-3, .featured-row { grid-template-columns: 1fr; }
  .split-side { grid-template-rows: none; }
  .section-band, .section-band-soft { padding: 44px 0; }
  .hero-content { padding: 32px 26px; }
  .hero-card { min-height: 400px; }
  .section-head h2 { font-size: 26px; }
}
@media (max-width: 560px) {
  .creature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
  .creature-body h3 { font-size: 15.5px; }
  .hero-card { min-height: 370px; border-radius: 20px; }
  .hero-content h1 { font-size: 32px; }
  .hero-meta { font-size: 0.78rem; gap: 12px; }
  .mini-card img { width: 64px; height: 54px; }
  .faq-item { padding: 17px 18px; }
}


/* ---------- dex table: horizontal scroll on narrow screens, never page overflow ---------- */
.table-wrap { max-width: 100%; overflow-x: auto; }
@media (max-width: 780px) {
  .table-wrap table { min-width: 640px; }        /* keep columns readable, scroll instead of shrink */
  .dex-toolbar { padding: 12px 13px; gap: 8px; }
  .dex-toolbar .filter-label { width: 100%; margin-bottom: 2px; }
  .dex-search { flex: 1 1 100%; }
  .dex-count { margin-left: 0; }
}
@media (max-width: 560px) {
  .table-wrap table { min-width: 600px; }
}
