
:root {
  --bg: #061015;
  --bg-soft: #09171d;
  --panel: rgba(9, 20, 26, 0.9);
  --panel-2: rgba(12, 24, 30, 0.95);
  --panel-soft: rgba(15, 30, 38, 0.72);
  --line: rgba(101, 229, 213, 0.15);
  --line-strong: rgba(239, 201, 118, 0.22);
  --gold: #d7b36c;
  --gold-strong: #f2d28b;
  --teal: #42cdbf;
  --teal-strong: #7cefe2;
  --text: #f4f1e8;
  --muted: #a4b7b5;
  --danger: #e48b8b;
  --success: #7bd4a8;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --radius-sm: 16px;
  --max: 1180px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(66, 205, 191, 0.10), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(239, 201, 118, 0.07), transparent 25%),
    linear-gradient(180deg, #050b0f 0%, #071116 42%, #09161c 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; }
.shell { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.section { padding: 76px 0; }
.section.compact { padding: 56px 0; }
.eyebrow {
  color: var(--teal-strong);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .75rem;
  font-weight: 800;
}
h1, h2, h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.08;
}
h1 { font-size: clamp(2.35rem, 4.2vw, 3.5rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.85rem, 3.2vw, 2.8rem); letter-spacing: -.025em; }
h3 { font-size: 1.38rem; }
p { margin: 0; }
.lede {
  margin-top: 20px;
  max-width: 760px;
  font-size: 1.08rem;
  color: #cfdbd8;
}
.subtle { color: var(--muted); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(5,10,13,.9), rgba(5,10,13,.72));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.topbar,
.railbar {
  border: 1px solid rgba(239, 201, 118, 0.12);
  background: linear-gradient(180deg, rgba(12, 18, 24, .98), rgba(8, 13, 18, .98));
  box-shadow: var(--shadow);
}
.topbar {
  border-radius: 18px 18px 10px 10px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}
.railbar {
  margin-top: 8px;
  border-radius: 10px 10px 18px 18px;
  padding: 10px 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(239, 201, 118, .32);
  background: radial-gradient(circle at 50% 50%, rgba(242, 210, 139, .18), rgba(66, 205, 191, .1));
  box-shadow: 0 0 24px rgba(66, 205, 191, .12);
  flex: 0 0 auto;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-copy strong { display: block; letter-spacing: .04em; }
.brand-copy span {
  display: block;
  color: var(--muted);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.nav-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.nav-links a,
.rail-link {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: .93rem;
  color: #d9e2e0;
}
.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,.05);
  color: var(--text);
}
.utility-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.utility-link {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.07);
  color: var(--muted);
  font-size: .84rem;
}
.utility-link:hover { color: var(--text); border-color: rgba(239, 201, 118, .18); }
.rail-link {
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.05);
  font-size: .86rem;
  color: #d5dfdd;
}
.rail-link strong {
  display: block;
  font-size: .76rem;
  color: var(--gold-strong);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.rail-link span { display: block; margin-top: 2px; }
.rail-link:hover, .rail-link.active {
  border-color: rgba(239, 201, 118, .26);
  background: rgba(255,255,255,.05);
}
.nav-actions { display: flex; gap: 8px; align-items: center; }
.menu-button { display: none; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(239, 201, 118, .44);
  background: linear-gradient(180deg, #f0cf88, #c69849);
  color: #0a1116;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(173, 128, 49, .18);
  transition: transform .16s ease, filter .16s ease;
}
.button:hover { transform: translateY(-1px); filter: brightness(1.04); }
.button.ghost {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-color: rgba(66, 205, 191, .18);
  box-shadow: none;
}
.button.small { min-height: 38px; padding: 8px 14px; font-size: .9rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.hero-home { padding: 56px 0 54px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 26px;
  align-items: stretch;
}
.hero-panel,
.text-panel,
.metric-panel,
.story-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(9, 20, 25, .94), rgba(7, 16, 20, .96));
  box-shadow: var(--shadow);
}
.hero-panel {
  position: relative;
  padding: 38px;
  overflow: hidden;
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(66,205,191,.13), transparent 35%);
}
.hero-panel > * { position: relative; }
.hero-copy-block {
  max-width: 640px;
}
.hero-copy-block h1 {
  max-width: 14ch;
  font-size: clamp(2.6rem, 4.4vw, 3.9rem);
  line-height: 1.03;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.hero-stats {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.hero-stat {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
}
.hero-stat strong { display: block; font-size: 1.38rem; color: var(--gold-strong); }
.hero-stat span { color: var(--muted); font-size: .91rem; }
.art-frame {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  border-radius: 28px;
  border: 1px solid rgba(66, 205, 191, .16);
  background: #051117;
  box-shadow: var(--shadow);
}
.art-frame img { width: 100%; height: 100%; object-fit: cover; }
.art-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4,10,13,.08), rgba(4,10,13,.38));
}

.page-banner {
  position: relative;
  padding: 72px 0 50px;
  overflow: hidden;
}
.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4,10,13,.36), rgba(4,10,13,.82));
}
.page-banner .shell { position: relative; z-index: 1; }
.page-banner .banner-card h1 {
  max-width: 16ch;
  font-size: clamp(2.25rem, 3.9vw, 3.35rem);
  line-height: 1.04;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.banner-card {
  max-width: 790px;
  padding: 30px 32px;
  border-radius: 24px;
  border: 1px solid rgba(66,205,191,.14);
  background: rgba(6, 12, 16, .5);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.breadcrumb { margin-bottom: 14px; color: #cad4d3; font-size: .92rem; }
.banner-home { background: radial-gradient(circle at top left, rgba(66,205,191,.14), transparent 28%); }
.banner-codex { background: url('assets/codex-runes.jpg') center/cover no-repeat; }
.banner-mistveil { background: url('assets/mistveil-lanterns.png') center/cover no-repeat; }
.banner-soundscapes { background: url('assets/soundscapes-harp.png') center 18%/cover no-repeat; }
.banner-store { background: url('assets/store-trove.png') center/cover no-repeat; }
.banner-about { background: url('assets/about-study.png') center/cover no-repeat; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.section-head h2 {
  max-width: 19ch;
  font-size: clamp(1.85rem, 2.8vw, 2.6rem);
  line-height: 1.08;
  text-wrap: balance;
}
.section-head p { margin-top: 10px; color: var(--muted); max-width: 670px; }
.card-grid,
.feature-grid,
.product-grid,
.library-grid,
.path-grid,
.mosaic-grid,
.deck-grid {
  display: grid;
  gap: 18px;
}
.card-grid,
.product-grid,
.library-grid,
.deck-grid { grid-template-columns: repeat(3, 1fr); }
.feature-grid { grid-template-columns: repeat(4, 1fr); }
.path-grid { grid-template-columns: repeat(3, 1fr); }
.mosaic-grid { grid-template-columns: 1.1fr .9fr; }
.art-card,
.product,
.library-item,
.path-card,
.feature,
.deck-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(10, 22, 27, .94), rgba(8, 16, 20, .96));
  box-shadow: 0 16px 44px rgba(0,0,0,.22);
}
.art-card {
  position: relative;
  overflow: hidden;
  min-height: 360px;
}
.art-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.art-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4,10,13,.12), rgba(4,10,13,.82));
}
.card-body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 22px;
}
.card-body p { color: #d2dcda; margin-top: 10px; }
.card-link, .text-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--gold-strong);
  font-weight: 800;
}
.feature,
.deck-card,
.path-card,
.library-item {
  padding: 20px;
}
.feature strong, .path-card strong, .deck-card strong { display: block; margin-bottom: 8px; color: var(--gold-strong); }
.feature span, .path-card p, .deck-card p, .library-item p { color: var(--muted); }
.deck-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
}
.deck-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .42;
}
.deck-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4,10,13,.18), rgba(4,10,13,.86));
}
.deck-card .deck-copy { position: relative; z-index: 2; }
.split-panel {
  display: grid;
  grid-template-columns: .96fr 1.04fr;
  gap: 24px;
  align-items: stretch;
}
.text-panel {
  padding: 30px;
}
.text-panel ul,
.story-panel ul,
.guide-content ul,
.guide-content ol,
.product-list,
.purchase-list {
  margin: 16px 0 0;
  padding-left: 18px;
  color: #d4deda;
}
.text-panel li + li,
.story-panel li + li,
.guide-content li + li,
.product-list li + li,
.purchase-list li + li { margin-top: 8px; }
.story-panel {
  padding: 28px;
}
.story-panel + .story-panel { margin-top: 18px; }
.visual-stack {
  display: grid;
  gap: 18px;
}
.small-frame {
  min-height: 250px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #061116;
}
.small-frame img { width: 100%; height: 100%; object-fit: cover; }

.newsletter {
  padding: 34px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  border-radius: 26px;
  border: 1px solid rgba(239,201,118,.22);
  background: linear-gradient(120deg, rgba(66,205,191,.08), rgba(239,201,118,.10));
  box-shadow: var(--shadow);
}
.newsletter form { display: flex; gap: 10px; }
.newsletter input,
.search-input,
.filter-select {
  min-height: 44px;
  padding: 10px 16px;
  color: var(--text);
  border-radius: 999px;
  border: 1px solid rgba(66,205,191,.16);
  background: rgba(4, 10, 13, .68);
  outline: none;
}
.newsletter input { min-width: 260px; }
.newsletter input:focus,
.search-input:focus { border-color: rgba(239,201,118,.42); }

.library-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  margin: 0 0 30px;
}
.filter-select { min-width: 170px; appearance: none; }
.library-item .meta {
  color: var(--teal-strong);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.library-item h3 { margin-top: 8px; }
.library-item p { margin-top: 10px; }
.library-item:hover {
  transform: translateY(-2px);
  border-color: rgba(239,201,118,.24);
}

.guide-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
.guide-toc {
  position: sticky;
  top: 138px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(7, 16, 20, .86);
}
.guide-toc > strong { display: block; margin-bottom: 14px; color: var(--gold-strong); }
.guide-toc a {
  display: block;
  padding: 8px 0;
  color: #d8e0de;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.guide-toc a:last-child { border-bottom: 0; }
.guide-media {
  margin-bottom: 18px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(66,205,191,.16);
}
.guide-content section {
  margin-bottom: 18px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(9, 20, 25, .86);
}
.guide-content h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 14px; }
.guide-content h3 { margin: 18px 0 10px; }
.callout {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(66,205,191,.18);
  background: rgba(66,205,191,.06);
  color: #d7e2df;
}
.callout.danger { border-color: rgba(228,139,139,.22); background: rgba(228,139,139,.06); }
.callout.success { border-color: rgba(123,212,168,.24); background: rgba(123,212,168,.07); }
.role-switcher {
  display: inline-flex;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
}
.role-switcher button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.role-switcher button.active { background: var(--gold); color: #091015; font-weight: 800; }
.role-content { display: none; }
.role-content.visible { display: block; }
.encounter {
  margin-top: 16px;
  border-radius: 16px;
  border: 1px solid rgba(66,205,191,.15);
  overflow: hidden;
  background: rgba(255,255,255,.02);
}
.encounter > button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 0;
  background: rgba(255,255,255,.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.encounter-panel { display: none; padding: 18px; }
.encounter.open .encounter-panel { display: block; }

.store-hero {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 24px;
  align-items: stretch;
}
.featured-offer {
  padding: 30px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,22,27,.94), rgba(8,16,20,.97));
  box-shadow: var(--shadow);
}
.price-note {
  display: inline-flex;
  margin-top: 16px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(239,201,118,.2);
  color: var(--gold-strong);
  background: rgba(255,255,255,.03);
  font-weight: 700;
}
.purchase-flow {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}
.flow-step {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
}
.flow-step strong { display: block; color: var(--gold-strong); margin-bottom: 6px; }
.product { overflow: hidden; }
.product-cover {
  aspect-ratio: 16 / 10;
  background-position: center;
  background-size: cover;
  position: relative;
}
.product-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4,10,13,.02), rgba(4,10,13,.30));
}
.product-body { padding: 20px; }
.product-body p { margin-top: 10px; color: var(--muted); }
.product-price { margin-top: 14px; color: var(--gold-strong); font-weight: 800; }
.product-list { font-size: .95rem; }
.comparison-table {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,22,27,.94), rgba(8,16,20,.97));
  box-shadow: var(--shadow);
}
.comparison-row,
.comparison-head {
  display: grid;
  grid-template-columns: 1.1fr .9fr .9fr .9fr;
}
.comparison-head {
  background: rgba(255,255,255,.04);
  color: var(--gold-strong);
  font-weight: 700;
}
.comparison-row + .comparison-row { border-top: 1px solid rgba(255,255,255,.05); }
.comparison-head div,
.comparison-row div { padding: 14px 16px; }

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 0 44px;
}
.site-footer { margin-top: 34px; border-top: 1px solid rgba(255,255,255,.05); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; color: #d1dcda; }
.copyright { margin-top: 10px; color: var(--muted); font-size: .9rem; }

@media (max-width: 1080px) {
  .topbar,
  .store-hero,
  .hero-grid,
  .split-panel,
  .guide-layout,
  .newsletter,
  .library-toolbar,
  .mosaic-grid { grid-template-columns: 1fr; }
  .card-grid,
  .product-grid,
  .library-grid,
  .deck-grid,
  .path-grid,
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-toc { position: static; }
  .comparison-head,
  .comparison-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .site-header { padding-top: 8px; }
  .topbar { padding: 12px; }
  .menu-button { display: inline-flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: start;
  }
  .nav-links.open { display: flex; }
  .utility-links { justify-content: start; }
  .hero-home { padding-top: 42px; }
  .hero-copy-block h1 {
    max-width: 15ch;
    font-size: clamp(2.2rem, 10vw, 2.7rem);
    line-height: 1.04;
  }
  .page-banner .banner-card h1 {
    max-width: 17ch;
    font-size: clamp(2rem, 8.8vw, 2.45rem);
    line-height: 1.06;
  }
  .section-head h2 {
    max-width: 21ch;
    font-size: clamp(1.75rem, 7.2vw, 2.15rem);
  }
  .hero-panel,
  .text-panel,
  .story-panel,
  .featured-offer,
  .banner-card,
  .newsletter { padding: 22px; }
  .hero-stats,
  .card-grid,
  .feature-grid,
  .product-grid,
  .library-grid,
  .path-grid,
  .deck-grid,
  .mosaic-grid { grid-template-columns: 1fr; }
  .art-frame { min-height: 360px; }
  .newsletter form { flex-direction: column; }
  .newsletter input { min-width: 0; width: 100%; }
  .comparison-head,
  .comparison-row { grid-template-columns: 1fr; }
  .comparison-head div:first-child { display: none; }
  .comparison-row div { padding: 10px 16px; }
  .comparison-row div::before {
    content: attr(data-label);
    display: block;
    color: var(--gold-strong);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 4px;
  }
  .footer-grid { flex-direction: column; align-items: flex-start; }
}


/* Dense dropdown header pass */
.site-header {
  padding: 7px 0 0;
  background: linear-gradient(180deg, rgba(3, 7, 10, .97), rgba(5, 11, 15, .92));
  border-bottom: 1px solid rgba(239, 201, 118, .10);
}
.dense-header { position: relative; }
.topbar {
  min-height: 72px;
  padding: 6px 12px;
  grid-template-columns: 198px minmax(0, 1fr) auto;
  gap: 10px;
  border-radius: 14px 14px 8px 8px;
  border-color: rgba(239, 201, 118, .14);
  background:
    linear-gradient(180deg, rgba(11, 17, 22, .99), rgba(6, 11, 15, .99)),
    radial-gradient(circle at 50% 0%, rgba(66, 205, 191, .07), transparent 50%);
}
.main-logo {
  width: 190px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.main-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(66, 205, 191, .10));
}
.nav-links {
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
}
.nav-direct,
.nav-trigger {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #dbe4e2;
  font-size: .88rem;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}
.nav-trigger span { color: var(--gold-strong); font-size: .72rem; transform: translateY(-1px); }
.nav-direct:hover,
.nav-trigger:hover,
.nav-direct.active,
.nav-dropdown.active > .nav-trigger,
.nav-dropdown.open > .nav-trigger {
  color: var(--text);
  background: rgba(255,255,255,.055);
  box-shadow: inset 0 -1px 0 rgba(239, 201, 118, .24);
}
.nav-item { position: relative; display: flex; align-items: stretch; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 100;
  width: 282px;
  padding: 8px;
  border: 1px solid rgba(239, 201, 118, .17);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(10, 17, 22, .99), rgba(5, 11, 15, .99));
  box-shadow: 0 24px 60px rgba(0,0,0,.58);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -6px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  border-left: 1px solid rgba(239, 201, 118, .17);
  border-top: 1px solid rgba(239, 201, 118, .17);
  background: #0a1116;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.dropdown-menu a {
  position: relative;
  display: block;
  padding: 10px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
}
.dropdown-menu a:hover,
.dropdown-menu a:focus {
  background: rgba(66, 205, 191, .06);
  border-color: rgba(66, 205, 191, .12);
}
.dropdown-menu strong {
  display: block;
  color: var(--gold-strong);
  font-size: .88rem;
}
.dropdown-menu span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.header-action {
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.06);
  color: #aebfbc;
  font-size: .77rem;
  white-space: nowrap;
}
.header-action:hover { color: var(--text); border-color: rgba(239, 201, 118, .18); }
.quickbar {
  min-height: 39px;
  margin-top: 5px;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(66, 205, 191, .08);
  border-radius: 7px 7px 13px 13px;
  background: rgba(5, 10, 14, .96);
  box-shadow: 0 10px 32px rgba(0,0,0,.34);
}
.quick-link {
  min-width: 0;
  padding: 5px 12px;
  border-radius: 8px;
  border-left: 1px solid rgba(255,255,255,.05);
  color: #cbd7d4;
  text-align: center;
  line-height: 1.15;
}
.quick-link:first-child { border-left: 0; }
.quick-link:hover { background: rgba(255,255,255,.035); }
.quick-link strong {
  display: block;
  color: var(--gold-strong);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.quick-link span { display: block; margin-top: 2px; color: #a7b8b5; font-size: .74rem; white-space: nowrap; }
.footer-brand a {
  width: 194px;
  height: 100px;
  display: block;
}
.footer-brand img { width: 100%; height: 100%; object-fit: contain; }
.footer-brand .copyright { max-width: 620px; }

@media (max-width: 1120px) {
  .topbar { grid-template-columns: 176px minmax(0, 1fr) auto; }
  .main-logo { width: 166px; height: 72px; }
  .nav-direct, .nav-trigger { padding: 8px 8px; font-size: .82rem; }
  .header-action:first-child { display: none; }
}
@media (max-width: 900px) {
  .topbar { grid-template-columns: 150px 1fr auto; align-items: center; }
  .main-logo { width: 160px; height: 70px; }
  .nav-links {
    grid-column: 1 / -1;
    display: none;
    width: 100%;
    padding: 8px 0 3px;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-links.open { display: flex; }
  .nav-item { display: block; }
  .nav-direct, .nav-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 11px 12px;
  }
  .dropdown-menu {
    position: static;
    width: 100%;
    padding: 4px 6px 7px 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }
  .dropdown-menu::before { display: none; }
  .nav-dropdown:hover .dropdown-menu,
  .nav-dropdown:focus-within .dropdown-menu { display: none; }
  .nav-dropdown.open .dropdown-menu { display: block; }
  .header-action { display: none; }
  .menu-button { display: inline-flex; }
  .quickbar { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .quickbar::-webkit-scrollbar { display: none; }
  .quick-link { flex: 0 0 auto; }
}
@media (max-width: 560px) {
  .dense-header { width: min(100% - 16px, var(--max)); }
  .topbar { grid-template-columns: 132px 1fr auto; padding: 5px 8px; }
  .main-logo { width: 146px; height: 64px; }
  .quick-link { padding: 5px 9px; }
  .quick-link span { font-size: .7rem; }
  .footer-brand a { width: 172px; height: 88px; }
}


/* Spoiler-free campaign catalog */
.campaign-library-hero::before { background: linear-gradient(180deg, rgba(4,10,13,.28), rgba(4,10,13,.86)); }
.campaign-catalog { padding-top: 64px; }
.campaign-section {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(10,22,27,.96), rgba(7,16,20,.98));
  box-shadow: var(--shadow);
}
.campaign-visual { position: relative; min-height: 620px; overflow: hidden; }
.campaign-visual img { width: 100%; height: 100%; object-fit: cover; }
.campaign-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(4,10,13,.08), rgba(4,10,13,.58));
}
.campaign-status {
  position: absolute;
  left: 20px;
  top: 20px;
  z-index: 2;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(239,201,118,.28);
  background: rgba(5,11,15,.78);
  color: var(--gold-strong);
  font-weight: 800;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.campaign-copy { padding: 42px 38px; align-self: center; }
.campaign-hook { margin-top: 18px; color: #f1e6cc; font-family: Georgia, serif; font-size: 1.3rem; line-height: 1.45; }
.campaign-overview { margin-top: 18px; color: #cbd8d5; }
.enemy-preview-mini span {
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(66,205,191,.15);
  background: rgba(255,255,255,.03);
  color: #d6e2df;
  font-size: .84rem;
}
.enemy-preview-mini { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.enemy-preview-mini strong { width: 100%; margin-bottom: 4px; color: var(--gold-strong); }
.campaign-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.upcoming-campaign-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 34px;
  border: 1px solid rgba(239,201,118,.2);
  border-radius: 26px;
  background: linear-gradient(120deg, rgba(66,205,191,.08), rgba(239,201,118,.08));
  box-shadow: var(--shadow);
}

.campaign-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}
.campaign-detail-copy {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(10,22,27,.94), rgba(7,16,20,.97));
  box-shadow: var(--shadow);
}
.campaign-detail-art { min-height: 500px; overflow: hidden; border-radius: 26px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.campaign-detail-art img { width: 100%; height: 100%; object-fit: cover; }
.spoiler-shield {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid rgba(239,201,118,.22);
  border-radius: 18px;
  background: rgba(239,201,118,.06);
}
.spoiler-shield strong { color: var(--gold-strong); }
.spoiler-shield p { margin-top: 6px; color: #d5dfdc; }
.enemy-preview-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.enemy-preview-card {
  min-height: 250px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(11,23,29,.96), rgba(7,16,20,.98));
  box-shadow: 0 14px 38px rgba(0,0,0,.2);
}
.enemy-preview-card > span { color: var(--teal-strong); font-weight: 800; font-size: .78rem; letter-spacing: .12em; }
.enemy-preview-card h3 { margin-top: 42px; }
.enemy-preview-card p { margin-top: 12px; color: var(--muted); }
.featured-enemy { border-color: rgba(239,201,118,.3); background: linear-gradient(180deg, rgba(34,27,22,.96), rgba(10,17,20,.98)); }
.purchase-panel {
  margin-top: 24px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border: 1px solid rgba(239,201,118,.22);
  border-radius: 24px;
  background: linear-gradient(120deg, rgba(66,205,191,.06), rgba(239,201,118,.09));
  box-shadow: var(--shadow);
}
.purchase-panel p { margin-top: 8px; color: var(--muted); }

@media (max-width: 1080px) {
  .campaign-section,
  .campaign-detail-grid,
  .upcoming-campaign-panel { grid-template-columns: 1fr; }
  .campaign-visual { min-height: 440px; }
  .enemy-preview-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .campaign-copy, .campaign-detail-copy { padding: 24px; }
  .enemy-preview-grid { grid-template-columns: 1fr; }
  .enemy-preview-card { min-height: 0; }
  .enemy-preview-card h3 { margin-top: 20px; }
  .purchase-panel { flex-direction: column; align-items: flex-start; }
}


/* Homepage middle-section scale */
.home-flagship-section,
.race-home-section {
  padding-top: 58px;
  padding-bottom: 58px;
}
.home-flagship-section .art-frame {
  min-height: 430px;
}
.home-flagship-section .small-frame {
  min-height: 190px;
}
.home-flagship-section .story-panel {
  padding: 24px;
}
.home-flagship-section .story-panel + .story-panel {
  margin-top: 14px;
}
.home-flagship-section 

/* Playable races */
.race-home-section { background: radial-gradient(circle at 75% 45%, rgba(215,179,108,.08), transparent 30%); }
.race-home-grid {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 24px;
  align-items: stretch;
}
.race-home-art {
  min-height: 430px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #071116;
  box-shadow: var(--shadow);
}
.race-home-art img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.race-home-art img + img { border-left: 1px solid rgba(255,255,255,.08); }
.race-home-copy {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(16,27,29,.96), rgba(8,17,21,.98));
  box-shadow: var(--shadow);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.race-home-copy h3 { margin-top: 10px; font-size: clamp(1.8rem, 2.5vw, 2.55rem); }
.race-home-copy p { margin-top: 16px; color: #cfdbd8; }

.race-hero {
  position: relative;
  min-height: 800px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4,10,13,.92) 0%, rgba(4,10,13,.72) 42%, rgba(4,10,13,.16) 70%),
    url('assets/kitsune-female.png') 80% 18%/auto 115% no-repeat,
    linear-gradient(180deg, #251812, #071116 70%);
}
.race-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 45%, rgba(215,179,108,.16), transparent 32%);
  pointer-events: none;
}
.race-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4,10,13,.08), rgba(4,10,13,.72)); }
.race-hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: .85fr 1.15fr; gap: 28px; align-items: center; }
.race-hero-copy {
  padding: 34px;
  border: 1px solid rgba(239,201,118,.22);
  border-radius: 26px;
  background: rgba(5,11,14,.76);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.race-hero-portraits { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.race-hero-portraits figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(239,201,118,.18);
  border-radius: 24px;
  background: rgba(5,11,14,.72);
  box-shadow: var(--shadow);
}
.race-hero-portraits figure:first-child { transform: translateY(48px); }
.race-hero-portraits img { width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: top center; }
.race-hero-portraits figcaption { padding: 10px 14px; color: var(--muted); font-size: .84rem; text-align: center; }
.race-intro-grid, .balance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.race-body-copy { margin-top: 14px; color: #cfdbd8; }
.trait-layout { display: grid; grid-template-columns: 260px 1fr; gap: 22px; align-items: start; }
.trait-summary {
  position: sticky;
  top: 150px;
  padding: 20px;
  border: 1px solid rgba(239,201,118,.2);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(21,25,24,.96), rgba(8,17,21,.98));
  box-shadow: var(--shadow);
}
.trait-summary strong { display: block; margin-bottom: 14px; color: var(--gold-strong); }
.trait-summary span { display: block; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06); color: #d8e2df; }
.trait-summary span:last-child { border-bottom: 0; }
.trait-summary b { color: var(--teal-strong); margin-right: 6px; }
.trait-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.trait-rule {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(11,23,29,.96), rgba(7,16,20,.98));
}
.trait-rule h3 { color: var(--gold-strong); }
.trait-rule p { margin-top: 10px; color: #cfdbd8; }
.featured-rule { grid-column: 1 / -1; border-color: rgba(239,201,118,.24); }
.spirit-path-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.spirit-path {
  position: relative;
  overflow: hidden;
  padding: 30px;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(14,24,28,.98), rgba(7,16,20,.98));
  box-shadow: var(--shadow);
}
.ember-path { background: radial-gradient(circle at top right, rgba(213,96,50,.15), transparent 35%), linear-gradient(180deg, rgba(24,22,20,.98), rgba(8,16,20,.98)); }
.veil-path { background: radial-gradient(circle at top right, rgba(66,205,191,.16), transparent 35%), linear-gradient(180deg, rgba(11,25,30,.98), rgba(7,16,20,.98)); }
.path-symbol { position: absolute; right: 24px; top: 16px; font-size: 3rem; color: rgba(239,201,118,.25); }
.spirit-path h3 { margin-top: 10px; font-size: 2rem; }
.spirit-path p { margin-top: 16px; color: #d0dbd8; }
.path-levels { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.path-levels span { padding: 9px 11px; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; background: rgba(255,255,255,.04); color: #d7e1df; }
.path-levels b { color: var(--gold-strong); margin-right: 5px; }
.race-purchase {
  padding: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  border: 1px solid rgba(239,201,118,.22);
  border-radius: 26px;
  background: linear-gradient(120deg, rgba(215,179,108,.11), rgba(66,205,191,.07));
  box-shadow: var(--shadow);
}
.compatibility-note { padding-top: 20px; }
.compatibility-note p { padding: 16px 18px; border: 1px solid rgba(255,255,255,.06); border-radius: 16px; color: var(--muted); background: rgba(255,255,255,.025); }

.race-store-card {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(12,24,29,.97), rgba(7,16,20,.99));
  box-shadow: var(--shadow);
}
.race-store-art { min-height: 620px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.race-store-art img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.race-store-art img + img { border-left: 1px solid rgba(255,255,255,.08); }
.race-store-copy { padding: 38px; align-self: center; }
.race-store-copy p { margin-top: 12px; color: var(--muted); }

@media print {
  .site-header, .site-footer, .race-hero, .race-intro-grid, #spirit-paths + .section, .race-purchase, .compatibility-note, [data-print-button] { display: none !important; }
  body { background: #fff; color: #111; }
  #traits { padding: 0; }
  .trait-layout { display: block; }
  .trait-summary { position: static; box-shadow: none; border-color: #999; background: #fff; color: #111; margin-bottom: 16px; }
  .trait-summary span, .trait-rule p { color: #111; }
  .trait-rules { display: block; }
  .trait-rule { break-inside: avoid; margin-bottom: 10px; box-shadow: none; background: #fff; border-color: #999; }
  .spirit-path-grid { display: block; }
  .spirit-path { break-inside: avoid; margin-bottom: 10px; box-shadow: none; background: #fff; color: #111; border-color: #999; }
  .spirit-path p, .path-levels span { color: #111; }
}

@media (max-width: 1080px) {
  .race-home-grid, .race-hero-grid, .race-store-card, .trait-layout { grid-template-columns: 1fr; }
  .race-hero { min-height: auto; padding: 70px 0; background: linear-gradient(180deg, rgba(4,10,13,.35), rgba(4,10,13,.92)), url('assets/kitsune-female.png') center top/cover no-repeat; }
  .race-hero-portraits figure:first-child { transform: none; }
  .trait-summary { position: static; }
  .race-store-art { min-height: 480px; }
}
@media (max-width: 760px) {
  .race-home-art, .race-hero-portraits, .race-intro-grid, .balance-grid, .trait-rules, .spirit-path-grid, .race-store-art { grid-template-columns: 1fr; }
  .race-home-art, .race-store-art { min-height: 0; }
  .race-home-art img, .race-store-art img { aspect-ratio: 3/4; }
  .race-home-art img + img, .race-store-art img + img { border-left: 0; border-top: 1px solid rgba(255,255,255,.08); }
  .race-hero-portraits figure:last-child { display: none; }
  .race-purchase { flex-direction: column; align-items: flex-start; }
  .race-store-copy, .race-home-copy { padding: 24px; }
}

/* Ambient rune field ----------------------------------------------------- */
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.rune-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  contain: strict;
}

.rune-layer {
  position: absolute;
  width: min(68vw, 980px);
  aspect-ratio: 784 / 1168;
  background: url('assets/runes-transparent.png') center / contain no-repeat;
  mix-blend-mode: screen;
  filter:
    saturate(1.18)
    brightness(.98)
    drop-shadow(0 0 12px rgba(66, 205, 191, .22))
    drop-shadow(0 0 18px rgba(239, 201, 118, .16));
  transform-origin: center;
  will-change: transform, opacity;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 50%, rgba(0,0,0,.72) 72%, transparent 96%);
  mask-image: radial-gradient(ellipse at center, #000 50%, rgba(0,0,0,.72) 72%, transparent 96%);
}

.rune-layer.layer-one {
  top: -34vh;
  left: -16vw;
  opacity: .105;
  animation: runeDriftOne 112s ease-in-out infinite alternate;
}

.rune-layer.layer-two {
  top: 18vh;
  right: -22vw;
  width: min(58vw, 820px);
  opacity: .078;
  animation: runeDriftTwo 146s ease-in-out infinite alternate;
}

.rune-layer.layer-three {
  bottom: -46vh;
  left: 26vw;
  width: min(74vw, 1040px);
  opacity: .06;
  animation: runeDriftThree 178s ease-in-out infinite alternate;
}

@keyframes runeDriftOne {
  0% { transform: translate3d(-3%, -2%, 0) rotate(-7deg) scale(1.02); opacity: .075; }
  45% { transform: translate3d(3%, 5%, 0) rotate(-1deg) scale(1.08); opacity: .115; }
  100% { transform: translate3d(8%, 10%, 0) rotate(5deg) scale(1.13); opacity: .09; }
}

@keyframes runeDriftTwo {
  0% { transform: translate3d(5%, -5%, 0) rotate(11deg) scale(.98); opacity: .055; }
  50% { transform: translate3d(-4%, 4%, 0) rotate(4deg) scale(1.06); opacity: .09; }
  100% { transform: translate3d(-9%, 9%, 0) rotate(-3deg) scale(1.12); opacity: .065; }
}

@keyframes runeDriftThree {
  0% { transform: translate3d(-6%, 6%, 0) rotate(-12deg) scale(1.04); opacity: .04; }
  52% { transform: translate3d(2%, -2%, 0) rotate(-5deg) scale(1.1); opacity: .07; }
  100% { transform: translate3d(8%, -8%, 0) rotate(3deg) scale(1.16); opacity: .05; }
}

@media (max-width: 760px) {
  .rune-layer.layer-one {
    top: -12vh;
    left: -58vw;
    width: 138vw;
    opacity: .072;
  }

  .rune-layer.layer-two {
    top: 46vh;
    right: -66vw;
    width: 132vw;
    opacity: .05;
  }

  .rune-layer.layer-three {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rune-layer {
    animation: none !important;
    transform: none !important;
  }

  .rune-layer.layer-two,
  .rune-layer.layer-three {
    display: none;
  }

  .rune-layer.layer-one {
    opacity: .05;
  }
}

@media print {
  .rune-ambient { display: none !important; }
}


/* Codex resource showcases */
.codex-showcase-section {
  background: radial-gradient(circle at 18% 38%, rgba(66,205,191,.08), transparent 28%);
}
.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.resource-card,
.resource-feature {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(10,22,27,.96), rgba(7,16,20,.98));
  box-shadow: var(--shadow);
}
.resource-card-image {
  display: block;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: #050b0f;
}
.resource-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .25s ease;
}
.resource-card:hover .resource-card-image img,
.resource-preview:hover img { transform: scale(1.012); }
.resource-card-copy { padding: 22px; }
.resource-card-copy p,
.resource-copy p { margin-top: 12px; color: #cfdbd8; }
.resource-feature {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  align-items: stretch;
}
.resource-feature-wide { grid-template-columns: 1.3fr .7fr; }
.resource-preview {
  display: block;
  min-height: 480px;
  overflow: hidden;
  background: #050b0f;
}
.resource-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .25s ease;
}
.portrait-preview { min-height: 660px; }
.resource-copy {
  padding: 30px;
  align-self: center;
}
.resource-copy h3 { font-size: clamp(2rem, 3vw, 3rem); }
.resource-copy .product-list { margin-top: 18px; }
@media (max-width: 900px) {
  .resource-grid,
  .resource-feature,
  .resource-feature-wide { grid-template-columns: 1fr; }
  .resource-preview,
  .portrait-preview { min-height: 0; }
  .resource-preview img { height: auto; }
}

/* Kitsune race-guide companion ----------------------------------------- */
.kitsune-fox-playmate {
  position: fixed;
  right: 16px;
  bottom: 14px;
  width: clamp(124px, 13vw, 186px);
  aspect-ratio: 1 / 1;
  overflow: visible;
  z-index: 46;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(.92);
  transform-origin: center bottom;
  transition: opacity .35s ease, filter .22s ease;
  -webkit-tap-highlight-color: transparent;
}
.kitsune-fox-playmate.is-visible { opacity: 1; }
.kitsune-fox-playmate:focus-visible {
  outline: 2px solid var(--teal-strong);
  outline-offset: 5px;
}
.kitsune-fox-playmate:hover { filter: brightness(1.06); }
.kitsune-fox-playmate:active { filter: brightness(1.12); }
.kitsune-fox-playmate.reduced-motion {
  opacity: 1;
  transform: none;
  cursor: default;
}
.fox-stage {
  position: relative;
  display: block;
  line-height: 0;
  width: 100%;
  height: 100%;
  isolation: isolate;
  --fox-inner-x: 0px;
  --fox-inner-y: 0px;
  --fox-inner-scale-x: 1;
  --fox-inner-scale-y: 1;
  --fox-inner-rot: 0deg;
  transform: translate3d(var(--fox-inner-x), var(--fox-inner-y), 0) scale(var(--fox-inner-scale-x), var(--fox-inner-scale-y)) rotate(var(--fox-inner-rot));
  transform-origin: center bottom;
  will-change: transform;
}
.fox-pose,
.fox-aura,
.fox-trail {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fox-pose {
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0;
  transition: opacity .34s linear;
  filter:
    drop-shadow(0 16px 26px rgba(0, 0, 0, .22))
    drop-shadow(0 0 14px rgba(133, 225, 255, .22));
  will-change: opacity;
}
.fox-pose.active { opacity: 1; }
.fox-aura,
.fox-trail {
  border-radius: 50%;
  transform-origin: center center;
}
.fox-aura {
  z-index: 1;
  inset: 14% 11% 10% 11%;
  background: radial-gradient(circle, rgba(144, 232, 255, .22), rgba(95, 198, 255, .08) 36%, transparent 69%);
  filter: blur(15px);
  opacity: .42;
}
.fox-trail {
  z-index: 2;
  inset: 8% -16% -8% -16%;
  opacity: .28;
  background:
    radial-gradient(circle at 14% 38%, rgba(255,255,255,.92) 0 2px, transparent 3px),
    radial-gradient(circle at 75% 18%, rgba(128,226,255,.84) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 70%, rgba(255,255,255,.76) 0 2px, transparent 3px),
    radial-gradient(circle at 28% 82%, rgba(128,226,255,.8) 0 2px, transparent 3px),
    radial-gradient(circle at 58% 10%, rgba(255,255,255,.72) 0 1.5px, transparent 2.5px);
}
.kitsune-fox-playmate.is-idle {
  animation: none;
}
.kitsune-fox-playmate.is-idle .fox-aura {
  animation: foxAuraPulse 3.1s ease-in-out infinite;
}
.kitsune-fox-playmate.is-idle .fox-trail {
  animation: foxSparkleOrbit 3.6s linear infinite;
}
.kitsune-fox-playmate.is-playing .fox-aura {
  animation: foxAuraFlight 1s ease-in-out infinite;
}
.kitsune-fox-playmate.is-playing .fox-trail {
  opacity: .76;
  animation: foxSparkleFlight .82s linear infinite;
}
@keyframes foxCornerIdle {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  45% { transform: translate3d(-2px, -4px, 0) scale(1.012) rotate(-.6deg); }
  72% { transform: translate3d(1px, -2px, 0) scale(.998) rotate(.35deg); }
}
@keyframes foxAuraPulse {
  0%, 100% { opacity: .32; transform: scale(.95); }
  50% { opacity: .58; transform: scale(1.08); }
}
@keyframes foxAuraFlight {
  0%, 100% { opacity: .44; transform: scale(.95); }
  50% { opacity: .8; transform: scale(1.17); }
}
@keyframes foxSparkleOrbit {
  0% { transform: rotate(0deg) scale(.96); opacity: .2; }
  50% { transform: rotate(12deg) scale(1.04); opacity: .42; }
  100% { transform: rotate(24deg) scale(.98); opacity: .24; }
}
@keyframes foxSparkleFlight {
  0% { transform: translate3d(12px, 8px, 0) rotate(0deg) scale(.9); opacity: .34; }
  45% { opacity: .9; }
  100% { transform: translate3d(-26px, 18px, 0) rotate(22deg) scale(1.14); opacity: .22; }
}
@media (max-width: 900px) {
  .kitsune-fox-playmate {
    right: 10px;
    bottom: 10px;
    width: clamp(96px, 25vw, 142px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .kitsune-fox-playmate,
  .fox-aura,
  .fox-trail {
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  .kitsune-fox-playmate { display: none !important; }
}

/* Visibility safeguard for the race companion */
button.kitsune-fox-playmate[data-fox-guide] { display: block !important; visibility: visible !important; }
button.kitsune-fox-playmate[data-fox-guide].is-visible { opacity: 1 !important; }


/* Persistent background music control --------------------------------- */
.site-audio-player {
  position: fixed;
  left: 16px;
  bottom: 14px;
  z-index: 52;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 9px 10px 9px 13px;
  border: 1px solid rgba(239, 201, 118, .24);
  border-radius: 999px;
  background: rgba(5, 12, 16, .9);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .34);
  backdrop-filter: blur(14px);
  color: var(--text);
}
.site-audio-player[hidden] { display: none !important; }
.site-audio-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.site-audio-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--gold-strong);
  background: radial-gradient(circle, rgba(66,205,191,.16), rgba(239,201,118,.08));
  border: 1px solid rgba(66,205,191,.16);
}
.site-audio-copy {
  min-width: 0;
}
.site-audio-title,
.site-audio-status {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-audio-title {
  font-size: .8rem;
  color: #f0e8d6;
  font-weight: 700;
}
.site-audio-status {
  margin-top: 1px;
  font-size: .7rem;
  color: var(--muted);
}
.site-audio-toggle {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(66,205,191,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  font-size: .77rem;
}
.site-audio-toggle:hover {
  border-color: rgba(239,201,118,.32);
  background: rgba(255,255,255,.07);
}
.site-audio-player.is-muted .site-audio-icon {
  opacity: .65;
  filter: grayscale(.2);
}
.site-audio-player.is-paused-for-soundscapes {
  border-color: rgba(66,205,191,.19);
}
.site-audio-player.is-paused-for-soundscapes .site-audio-icon {
  color: var(--teal-strong);
}
@media (max-width: 760px) {
  .site-audio-player {
    left: 10px;
    bottom: 10px;
    max-width: calc(100vw - 130px);
    padding: 8px 9px;
  }
  .site-audio-title { display: none; }
  .site-audio-status { max-width: 120px; }
  .site-audio-toggle { padding-inline: 9px; }
}
@media print {
  .site-audio-player { display: none !important; }
}


/* Legal center --------------------------------------------------------- */
.banner-legal {
  background:
    linear-gradient(90deg, rgba(4, 12, 15, .96), rgba(5, 17, 20, .78)),
    url('assets/codex-runes.jpg') center / cover;
}
.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.legal-card,
.legal-document {
  border: 1px solid rgba(125, 209, 199, .2);
  background: rgba(5, 17, 20, .88);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.legal-card { padding: 28px; }
.legal-card h2 { font-size: clamp(1.65rem, 2.6vw, 2.35rem); }
.legal-card p { margin: 12px 0 18px; color: #cedbd8; }
.legal-document {
  max-width: 920px;
  margin-inline: auto;
  padding: clamp(26px, 4vw, 48px);
}
.legal-document h2 {
  margin-top: 30px;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
}
.legal-document h2:first-of-type { margin-top: 8px; }
.legal-document p,
.legal-document li { color: #d2dedb; }
.legal-document p { margin-top: 11px; }
.legal-document ul { margin-top: 12px; padding-left: 1.25rem; }
.legal-document li + li { margin-top: 8px; }
.legal-updated,
.legal-note {
  color: var(--muted) !important;
  font-size: .93rem;
}
.legal-attribution {
  padding: 18px;
  border-left: 3px solid var(--teal-strong);
  border-radius: 0 14px 14px 0;
  background: rgba(94, 203, 195, .07);
  overflow-wrap: anywhere;
}
.disabled-link {
  opacity: .58;
  cursor: not-allowed;
  filter: saturate(.55);
}
.footer-links { flex-wrap: wrap; }
@media (max-width: 760px) {
  .legal-grid { grid-template-columns: 1fr; }
  .legal-card, .legal-document { border-radius: 18px; }
}
