:root {
  color-scheme: light;
  --ink: #251c20;
  --panel: #fffdf9;
  --paper: #251c20;
  --muted: #75676b;
  --line: #e5d9ce;
  --gold: #7d293b;
  --deep: #f0e7dd;
  --background: #f7f1e8;
  --display: var(--font-display, Georgia), Georgia, serif;
  --body: var(--font-body, system-ui), system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f8eee5;
  --panel: #2b242a;
  --paper: #f8eee5;
  --muted: #bcb0b6;
  --line: #493941;
  --gold: #efb3a6;
  --deep: #181419;
  --background: #201b20;
}
* { box-sizing: border-box; }
body.storyclub-page, body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
}
a { color: inherit; text-underline-offset: .25em; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button, .primary {
  min-height: 44px;
  padding: .6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
}
button:hover, a:hover { color: var(--gold); }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #fffaf5;
  background: #681f2b;
  border-color: #681f2b;
  font-weight: 700;
  text-decoration: none;
}
.primary:hover { color: #fff; background: #8b3040; }
.mast {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem max(1rem, calc((100vw - 1200px) / 2));
  background: var(--background);
  border-bottom: 1px solid var(--line);
}
.mast .brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font-family: var(--display);
  line-height: 1.05;
  font-size: 1.15rem;
  text-decoration: none;
}
.brand strong { font-size: 1.4rem; font-weight: 600; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: #681f2b;
  color: #fff4e8;
  border-radius: 50%;
  font: 600 1.05rem Georgia,serif;
  letter-spacing: -.06em;
}
.mast nav { display: flex; align-items: center; gap: .25rem; }
.mast nav a { display: flex; gap: .35rem; align-items: center; padding: .6rem .75rem; text-decoration: none; font-size: .9rem; }
nav [aria-current="page"] { color: var(--gold); font-weight: 700; }
.theme-button { min-width: 44px; padding: .45rem; font-size: 1.25rem; }
main, footer { max-width: 1200px; margin: auto; padding: 2rem 1rem; }
.welcome { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.welcome p { margin: 0; max-width: 55ch; color: var(--muted); font-size: .9rem; }
.eyebrow { color: var(--gold); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 700; }
h1, h2, h3 { font-family: var(--display); color: inherit; font-weight: 600; line-height: 1.08; }
h1 { font-size: clamp(2.2rem, 5vw, 3.75rem); margin: .2rem 0 1rem; }
h2 { font-size: clamp(1.8rem, 3vw, 2.65rem); margin: .3rem 0 1.2rem; }
h3 { font-size: 1.5rem; margin: 0; }
section { margin: 2.5rem 0; scroll-margin-top: 100px; }
.search-form { display: flex; gap: .6rem; margin: 1.4rem 0 2rem; max-width: 650px; }
.search-form input { border-radius: 999px; }
input:not([type="checkbox"]), textarea, select {
  min-width: 0;
  width: 100%;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: .6rem;
  padding: .7rem .85rem;
}
input[type="search"] { border-radius: 999px; }
form { display: grid; gap: .8rem; }
form label { display: grid; gap: .3rem; font-size: .9rem; }
fieldset { border: 1px solid var(--line); border-radius: .6rem; }
fieldset label { display: inline-flex; align-items: center; min-height: 44px; gap: .5rem; margin-right: .8rem; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: #681f2b; }
textarea { min-height: 120px; resize: vertical; }
.spotlight { margin-top: 0; }
.spotlight-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.spotlight-heading h1 { margin-bottom: 0; }
.spotlight-heading .eyebrow { display: none; }
.spotlight-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1rem; }
.spotlight-video {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-width: 0;
  min-height: 195px;
  padding: 0;
  border: 0;
  border-radius: 1rem;
  background: #201b20;
  text-align: left;
  color: #fffaf5;
}
.spotlight-video:first-child { grid-row: span 2; min-height: 406px; }
.spotlight-video::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 20%, #17101566 48%, #171015f5 100%); }
.spotlight-video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.spotlight-video:hover { color: #fff; }
.spotlight-copy { display: flex; flex-direction: column; align-items: start; justify-content: end; gap: .6rem; min-height: inherit; padding: 1.3rem; }
.spotlight-channel { color: #fffaf5; background: #201b20b0; border-radius: .3rem; padding: .15rem .4rem; font-size: .7rem; }
.spotlight-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font: 600 1.45rem/1.1 var(--display); text-shadow: 0 1px 7px #000; }
.spotlight-video:first-child .spotlight-title { font-size: clamp(1.8rem, 3.2vw, 2.8rem); }
.spotlight-play { display: inline-flex; gap: .5rem; align-items: center; font-size: .8rem; color: #ffdfb5; font-weight: 700; }
.spotlight-count-1 { grid-template-columns: 1fr; }
.spotlight-count-2 .spotlight-video { grid-row: auto; min-height: 350px; }
.spotlight-count-1 .spotlight-video { min-height: 350px; }
.filters, .actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.filters { flex-wrap: nowrap; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.filters button { flex-shrink: 0; white-space: nowrap; }
.active, .filters button:hover { background: var(--gold); color: var(--background); border-color: var(--gold); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1.25rem; }
.card { min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: .8rem; padding: .85rem; background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; }
.card p { margin: 0; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; background: var(--deep); border-radius: .65rem; }
.card h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.card .actions { margin-top: auto; }
.card .actions button { font-size: .8rem; padding: .5rem .75rem; }
.cover { display: block; padding: 0; border: 0; border-radius: .65rem; background: var(--deep); overflow: hidden; }
small, .muted { color: var(--muted); font-size: .8rem; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: .8rem; padding: 1.5rem; }
.page-title { margin-bottom: 2rem; }
.page-title p { color: var(--muted); max-width: 65ch; }
.hero { display: flex; flex-direction: column; align-items: start; justify-content: center; gap: 1rem; min-height: 300px; padding: 2rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); margin: 0; }
.hero p { max-width: 60ch; }
.hero h1 { margin: 0; }
.hero .actions { display: flex; }
footer { display: flex; justify-content: space-between; align-items: start; gap: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; padding-top: 2rem; padding-bottom: 2rem; }
footer strong { color: var(--ink); font-family: var(--display); font-size: 1.5rem; }
footer p { max-width: 40ch; }
footer a { padding: .5rem; }
dialog { width: min(92vw, 820px); max-height: 90dvh; padding: 1.3rem; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 1rem; }
dialog::backdrop { background: #171015c9; }
dialog h2 { padding-right: 3rem; }
.close { float: right; position: sticky; top: 0; z-index: 1; padding: .4rem; min-width: 44px; }
body:has(dialog[open]) { overflow: hidden; }
.player { width: 100%; min-height: 200px; aspect-ratio: 16/9; margin: 1rem 0; border: 0; background: #171015; }
.article { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 70ch; }
.admin { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.admin form { align-content: start; }
#toast { position: fixed; z-index: 40; bottom: 1rem; right: 1rem; max-width: min(90vw, 400px); background: var(--ink); color: var(--background); border-radius: .6rem; padding: .8rem 1rem; box-shadow: 0 5px 20px #0002; }
#toast:empty { display: none; }
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .mast { min-height: 70px; padding: .7rem 1rem; }
  .mast nav a, .mast nav > button[data-act="account"] { display: none; }
  .mast nav { gap: .4rem; }
  .mast nav button { padding: .45rem .65rem; font-size: .8rem; }
  .mast .brand { font-size: 1rem; }
  .brand strong { font-size: 1.2rem; }
  .brand-mark { width: 40px; height: 40px; }
  main { padding: 1.4rem 1rem; }
  .welcome { flex-direction: column; align-items: start; gap: .4rem; }
  .welcome p { font-size: .85rem; }
  .search-form { margin: 1rem 0 1.5rem; }
  .search-form button { padding: .6rem .85rem; }
  .spotlight-heading { align-items: center; margin-bottom: .8rem; }
  .spotlight-heading h1 { font-size: 2.15rem; }
  .spotlight-heading > button { display: none; }
  .spotlight-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 88%; overflow-x: auto; scroll-snap-type: x mandatory; gap: .75rem; padding: 3px 2px 10px; scrollbar-width: thin; scrollbar-color: var(--gold) var(--line); }
  .spotlight-count-1 { grid-auto-columns: 100%; }
  .spotlight-video, .spotlight-video:first-child, .spotlight-count-1 .spotlight-video, .spotlight-count-2 .spotlight-video { grid-row: auto; min-height: 265px; scroll-snap-align: start; }
  .spotlight-video:first-child .spotlight-title, .spotlight-title { font-size: 1.65rem; }
  .spotlight-copy { padding: 1rem; }
  section { margin: 1.7rem 0; scroll-margin-top: 86px; }
  .grid { gap: 1rem; }
  .card { padding: .8rem; }
  .card h3 { font-size: 1.7rem; }
  .bottom-nav { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: .4rem .35rem calc(.4rem + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); }
  .bottom-nav a, .bottom-nav button { min-height: 48px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .05rem; padding: .2rem; background: transparent; border: 0; border-radius: .4rem; text-decoration: none; font-size: .65rem; color: var(--muted); }
  .bottom-nav [aria-hidden] { font-size: 1.45rem; line-height: 1.1; }
  .bottom-nav [aria-current] { color: var(--gold); }
  footer { flex-direction: column; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .hero { padding: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.storyclub-page .analytics-consent { bottom: 85px; background: var(--panel); color: var(--ink); border-color: var(--line); }
.storyclub-page .privacy-settings { bottom: 76px; background: var(--panel); color: var(--muted); }

.mast .brand > span:last-child { display: block; }
.storyclub-page .privacy-settings { position: static; display: block; margin: 0 1rem 6rem; }
@media (max-width: 760px) {
 .spotlight-heading h1 { font-size: 1.85rem; }
}
