@font-face {
  font-family: 'Cormorant Garamond';
  src: url('assets/cormorant-garamond.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('assets/dm-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #101410;
  --surface: #181e18;
  --surface-strong: #1d251c;
  --surface-hover: #222b20;
  --line: #323c30;
  --line-soft: #293229;
  --text: #ecebdf;
  --muted: #a9b0a1;
  --subtle: #929e8e;
  --accent: #c4d8a9;
  --olive: #89a67a;
  --gold: #d3b479;
  --rust: #d39a86;
  --heading: 'Cormorant Garamond', Georgia, serif;
  --body: 'DM Sans', system-ui, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { min-width: 280px; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 68% 0, #1d271b 0, transparent 39rem), var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled, input:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
a, button, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #d6ebba; outline-offset: 4px; }
[hidden] { display: none !important; }
svg { display: block; width: 1.15em; height: 1.15em; }
p, h1, h2, h3 { margin: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 20;
  padding: .6rem 1rem;
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.shell { width: min(1280px, calc(100% - 96px)); margin-inline: auto; }

.site-header {
  background: rgb(16 20 16 / 85%);
  border-bottom: 1px solid var(--line-soft);
}
.header-layout {
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.wordmark {
  display: flex;
  align-items: center;
  width: fit-content;
  gap: 10px;
  color: #eeeddf;
  font: 700 1.8rem/1 var(--heading);
  letter-spacing: .025em;
}
.wordmark img { flex: 0 0 auto; }
.site-nav {
  height: 100%;
  display: flex;
  align-items: stretch;
  gap: 1.9rem;
}
.site-nav a {
  display: flex;
  align-items: center;
  padding: 0 .1rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: .92rem;
}
.site-nav a:hover, .site-nav a[aria-current] { color: var(--accent); }
.site-nav a[aria-current] { border-color: var(--olive); }
.voice-credit {
  display: flex;
  align-items: center;
  gap: .55rem;
  justify-self: end;
  color: var(--accent);
  background: #1b2419;
  border: 1px solid #384632;
  border-radius: 999px;
  padding: .43rem .75rem;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}
.voice-credit [data-icon] { color: #9ab589; }

.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 35px 0 25px;
}
.page-intro h1 {
  font: 600 clamp(2.8rem, 5.2vw, 4.65rem)/.97 var(--heading);
  letter-spacing: -.033em;
}
.page-intro p { margin-top: 11px; color: var(--muted); line-height: 1.55; }
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.category-nav a {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--line);
  padding: .62rem 1rem;
  border-radius: 99px;
  color: var(--muted);
  background: #181e18;
  font-weight: 600;
  font-size: .9rem;
  min-height: 42px;
  white-space: nowrap;
}
.category-nav a:hover { background: var(--surface-hover); color: var(--text); }
.category-nav a[aria-current] {
  color: #172114;
  background: var(--accent);
  border-color: var(--accent);
}
.category-nav a svg { width: 1rem; height: 1rem; }

.archive-layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}
.library {
  background: #151a15;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 14px 14px;
  min-width: 0;
}
.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin: 0 5px 13px;
}
.library-heading h2 {
  font: 700 1.55rem/1 var(--heading);
  letter-spacing: -.01em;
}
.library-count {
  min-width: 25px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  height: 24px;
  padding-inline: .35rem;
  color: var(--accent);
  background: #283426;
  font: 600 .78rem var(--body);
}
.library-search {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 40px;
  background: #101510;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding-inline: .65rem;
  color: var(--subtle);
}
.library-search:focus-within { border-color: #7e9a72; }
.library-search input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: .89rem;
  min-height: 38px;
}
.library-search input::placeholder { color: #97a192; }
.entry-list {
  margin-top: 10px;
  max-height: 438px;
  overflow: auto;
  scrollbar-color: #4b5c45 transparent;
  scrollbar-width: thin;
}
.entry-group {
  margin: 11px 8px 7px;
  color: var(--subtle);
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.entry-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 12px;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ccd0c4;
  font-size: .89rem;
  font-weight: 600;
}
.entry-link:hover { background: #20281e; color: var(--text); }
.entry-link[aria-current] {
  border-color: #4e6746;
  background: #283725;
  color: #e4efd7;
}
.entry-emblem {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: #a8bd9b;
  background: #252f23;
  border: 1px solid #3e4b38;
  border-radius: 8px;
}
.entry-link[aria-current] .entry-emblem {
  color: #d3e6ba;
  background: #374c31;
  border-color: #576f4e;
}
.entry-indicator { color: #becfb2; }
.entry-indicator svg { width: 12px; height: 12px; transform: rotate(-90deg); }
.mobile-entry { display: none; }
.library-empty {
  padding: 1rem .5rem .3rem;
  font-size: .9rem;
  color: var(--muted);
}

.content { min-width: 0; }
.hero {
  position: relative;
  min-height: 306px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  background: #202b20;
  border: 1px solid #465342;
  border-radius: var(--radius);
  padding: 31px 35px;
}
.hero-image, .hero::after { position: absolute; inset: 0; z-index: -1; }
.hero-image {
  background-position: center 52%;
  background-size: cover;
}
.hero-image[data-art="square"] { background-image: url('assets/square.webp'); }
.hero-image[data-art="bell"] { background-image: url('assets/bell.webp'); }
.hero-image[data-art="crypt"] { background-image: url('assets/crypt.webp'); background-position: center 53%; }
.hero-image[data-art="cells"] { background-image: url('assets/crypt.webp'); background-position: center 67%; filter: sepia(.34) brightness(.78); }
.hero-image[data-art="weather"] { background-image: url('assets/weather.webp'); }
.hero::after {
  content: '';
  background: linear-gradient(90deg, #0d150eea 0%, #111a11c9 33%, #111a1142 65%, #111a1108 100%),
    linear-gradient(0deg, #0c140deb 0%, #0c140d23 54%, transparent 100%);
}
.hero-copy { position: relative; width: min(620px, 85%); }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #c8d8ba;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero-eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #a4c38f;
  transform: rotate(45deg);
}
.hero[data-accent="rust"] .hero-eyebrow { color: #ecc1ad; }
.hero[data-accent="rust"] .hero-eyebrow::before { background: #cd9a83; }
.hero h2 {
  font: 600 clamp(2.6rem, 5.4vw, 4.55rem)/.92 var(--heading);
  letter-spacing: -.034em;
  text-wrap: balance;
  margin: 10px 0 12px;
}
.hero-description {
  max-width: 35rem;
  color: #d1d8ca;
  font-size: 1rem;
  line-height: 1.5;
}
.hero-alias {
  margin-top: 7px;
  color: #c2cbb8;
  font: 500 .85rem/1.35 var(--body);
}
.hero-icon {
  align-self: flex-start;
  display: grid;
  place-items: center;
  margin-left: auto;
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  color: #d2e2c6;
  background: #182318b3;
  border: 1px solid #84967d7a;
  border-radius: 11px;
}
.hero-icon svg { width: 21px; height: 21px; }

.scene-section { margin-top: 23px; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 12px;
}
.section-heading h2, .section-heading h3 {
  font: 700 1.8rem/1.08 var(--heading);
  letter-spacing: -.01em;
}
.section-heading > span { color: var(--muted); font-size: .83rem; white-space: nowrap; }
.scene-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.scene-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.audio-card {
  display: grid;
  align-content: start;
  gap: .65rem;
  padding: .92rem;
}
.scene-stage {
  display: flex;
  align-items: center;
  gap: .48rem;
  color: #b6ce9f;
  font: 700 1.55rem/1.1 var(--heading);
}
.scene-stage svg { width: .9rem; height: .9rem; }
.scene-stage[data-color="gold"] { color: var(--gold); }
.scene-stage[data-color="rust"] { color: var(--rust); }
.scene-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .4rem .8rem; }
.scene-actions > span, .audio-empty, .audio-status { color: var(--muted); font-size: .9rem; }
.audio-slot { min-height: 3rem; display: grid; align-items: center; }
.audio-slot audio { width: 100%; max-width: 100%; height: 45px; }
.audio-status { margin-top: .65rem; }
.audio-import {
  position: relative;
  display: inline-flex;
  width: fit-content;
  min-height: 36px;
  align-items: center;
  gap: .35rem;
  padding: .32rem .55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  font-size: .87rem;
  cursor: pointer;
}
.audio-import:hover { background: #243323; border-color: #698363; }
.audio-import:focus-within { outline: 2px solid #d6ebba; outline-offset: 3px; }
.pack-import { background: #263723; border-color: #4a6544; }

.entry-reference {
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #141a14;
  color: var(--muted);
}
.entry-reference > summary {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 13px 15px;
  list-style: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
}
.entry-reference > summary::-webkit-details-marker { display: none; }
.entry-reference > summary:hover, .entry-reference[open] > summary { color: var(--text); }
.entry-reference > summary .chevron { margin-left: auto; }
.entry-reference[open] > summary .chevron { transform: rotate(180deg); }
.reference-body {
  padding: 1px 15px 16px;
  line-height: 1.6;
  font-size: .92rem;
}
.reference-body > p { margin: .25rem 0 .75rem; }
.reference-body h3 { font-size: .92rem; color: var(--text); margin-top: .8rem; }
.reference-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .4rem; }
.reference-links a, .source-card a, .site-footer a { color: var(--accent); }
.reference-links a:hover, .source-card a:hover, .site-footer a:hover { text-decoration: underline; }
.scenario-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin: .45rem 0 1rem; }
.scenario-buttons a {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 42px;
  padding: .2rem .55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #202a1f;
}
.scenario-buttons a:hover { border-color: #778d6e; color: var(--accent); }
.scenario-buttons a[aria-current="page"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }

.sources-page { margin-top: 2px; }
.scope {
  max-width: 50rem;
  border-left: 2px solid var(--olive);
  margin: 0 0 24px;
  padding: .05rem 0 .05rem 1rem;
  color: var(--muted);
  line-height: 1.65;
}
.scope p + p { margin-top: .55rem; }
.source-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.source-card {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.source-card p { margin-top: .5rem; color: var(--muted); line-height: 1.5; font-size: .94rem; }
.source-card p.source-publisher { margin: 0 0 .38rem; font-size: .81rem; color: #bec9b7; }
.source-card h2 { font: 700 1.5rem/1.1 var(--heading); }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1rem;
  padding: 23px 0 20px;
  color: var(--subtle);
  font-size: .83rem;
  line-height: 1.5;
}

@media (max-width: 1050px) {
  .shell { width: calc(100% - 60px); }
  .archive-layout { grid-template-columns: 234px minmax(0, 1fr); gap: 17px; }
  .hero { min-height: 275px; padding: 27px; }

}

@media (max-width: 760px) {
  .shell { width: calc(100% - 36px); }
  .header-layout { height: 60px; grid-template-columns: 1fr auto; gap: 1rem; }
  .site-nav { justify-self: end; gap: 1.15rem; }
  .voice-credit { display: none; }
  .wordmark { font-size: 1.57rem; gap: 6px; }
  .wordmark img { width: 31px; height: 31px; }
  .page-intro { display: block; padding: 26px 0 19px; }
  .page-intro p { margin-top: 8px; }
  .category-nav { gap: 6px; margin-bottom: 14px; }
  .category-nav a { padding-inline: .69rem; font-size: .84rem; min-height: 38px; }
  .archive-layout { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .library {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 10px;
    row-gap: 8px;
    padding: 11px;
  }
  .library-heading { grid-column: 1 / -1; margin: 1px 3px 4px; }
  .library-heading h2 { font-size: 1.35rem; }
  .library-search { padding-inline: .5rem; grid-row: 2; grid-column: 2; }
  .library-search input, .mobile-entry select { font-size: 1rem; }
  .entry-list { display: none; }
  .mobile-entry { position: relative; display: block; grid-row: 2; grid-column: 1; }
  .mobile-entry select {
    appearance: none;
    width: 100%;
    height: 40px;
    color: var(--accent);
    background: #263422;
    border: 1px solid #50674a;
    border-radius: 8px;
    padding: 0 24px 0 9px;
    text-overflow: ellipsis;
  }
  .mobile-entry > span { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); pointer-events: none; }
  .mobile-entry > span svg { width: 13px; height: 13px; }
  .library-empty { grid-column: 1 / -1; padding-block: .35rem; }
  .hero { min-height: 230px; padding: 20px; }
  .hero-icon { height: 37px; width: 37px; flex-basis: 37px; }
  .hero-icon svg { width: 17px; height: 17px; }
  .scene-section { margin-top: 17px; }
  .scene-grid { gap: 8px; }
  .source-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scene-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 455px) {
  .shell { width: calc(100% - 26px); }
  .page-intro h1 { font-size: clamp(2.45rem, 11vw, 3.2rem); }
  .page-intro p { font-size: .94rem; }
  .hero { min-height: 206px; padding: 17px; }
  .hero h2 { font-size: clamp(2.35rem, 11vw, 3.15rem); }
  .hero-description { font-size: .92rem; }
  .hero-icon { display: none; }
  .hero-copy { width: 100%; }
  .hero::after { background: linear-gradient(90deg, #0d150ee4, #111a1125), linear-gradient(0deg, #0c140df5, transparent 94%); }
  .section-heading h2 { font-size: 1.54rem; }
  .scene-grid, .source-card-grid { grid-template-columns: 1fr; }
  .site-nav { gap: .56rem; }
  .site-nav a { font-size: .75rem; white-space: nowrap; }
  .header-layout { gap: .5rem; }
  .wordmark { font-size: 1.36rem; }
  .wordmark img { width: 26px; height: 26px; }
  .scene-actions { gap: .35rem .5rem; }
  .scene-actions > span { font-size: .8rem; }
  .site-footer { font-size: .8rem; }
}

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