/* Whispering Bookcase
   Palette and mood are taken straight from the channel badge and banner: candlelit
   wood, aged parchment, gold sparkle, with the dragon's green as the one cool accent.
   One page, no framework, no third-party requests. */

/* ---------- fonts (self-hosted; both families are variable, so one file per subset
               covers every weight we use) ---------- */
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/ebgaramond-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/ebgaramond-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- tokens ---------- */
:root {
  --ink:        #17110c;
  --ink-soft:   #211810;
  --wood:       #3a2618;
  --wood-lit:   #5b3d26;
  --parchment:  #f5e9d0;
  --parchment-dim: #cbb894;
  --gold:       #e8b93d;
  --gold-deep:  #b8892a;
  --sage:       #4f8a5b;  /* the dragon green from the badge; unused, kept for future accents */

  --serif: 'EB Garamond', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans:  'Nunito', ui-rounded, 'Segoe UI', system-ui, -apple-system, sans-serif;

  --measure: 68rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 14px;
  --shadow: 0 18px 44px rgb(0 0 0 / 0.45);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--parchment);
  font: 400 clamp(1.02rem, 0.55vw + 0.92rem, 1.16rem)/1.7 var(--sans);
  /* A faint warm vignette so the deep brown never reads as flat black. */
  background-image:
    radial-gradient(120% 70% at 50% 0%, #2a1d13 0%, transparent 60%),
    radial-gradient(90% 60% at 50% 100%, #241a11 0%, transparent 70%);
  background-attachment: fixed;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-underline-offset: 0.18em; }
a:hover { color: #f6d375; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--gold); color: var(--ink); font-weight: 700;
  padding: 0.75rem 1.25rem; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: min(92svh, 780px);
  padding: clamp(3rem, 9vh, 6rem) var(--pad);
  text-align: center;
}

.hero__bg {
  position: absolute; inset: 0; z-index: -2;
  background-image: var(--hero-lqip);
  background-size: cover;
  background-position: center 42%;
}
/* The full-size plate is layered over the inlined blurred placeholder, so the hero
   has colour on the first paint instead of a black rectangle. */
.hero__bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image: image-set(url('/assets/img/hero.avif') type('image/avif'),
                              url('/assets/img/hero.jpg')  type('image/jpeg'));
  background-size: cover;
  background-position: center 42%;
}

.hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  /* Enough to hold white text at AA over the brightest part of the plate, but not so
     much that the bookcase turns into brown mud — the artwork is the point. The bottom
     stop is opaque so the hero dissolves into the page rather than ending on a seam. */
  background:
    radial-gradient(65% 55% at 50% 46%, rgb(23 17 12 / 0.12) 0%, rgb(23 17 12 / 0.62) 100%),
    linear-gradient(to bottom, rgb(23 17 12 / 0.42) 0%, rgb(23 17 12 / 0.12) 40%,
                    rgb(23 17 12 / 0.72) 84%, var(--ink) 100%);
}

.hero__inner { max-width: 46rem; }

.hero__badge {
  width: clamp(112px, 17vw, 172px);
  height: auto;
  margin: 0 auto clamp(1rem, 3vh, 1.75rem);
  border-radius: 50%;
  border: 3px solid rgb(232 185 61 / 0.55);
  box-shadow: 0 0 0 6px rgb(23 17 12 / 0.5), var(--shadow);
}

.hero__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.9rem, 11vw, 6rem);
  line-height: 0.94;
  letter-spacing: 0.005em;
  margin: 0;
  color: #fdf4e0;
  text-shadow: 0 2px 18px rgb(0 0 0 / 0.75), 0 0 60px rgb(232 185 61 / 0.22);
}
.hero__title span { display: block; }

.hero__tagline {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  font-style: italic;
  color: #e9d9b6;
  margin: 1.1rem auto 0;
  max-width: 34ch;
}

.hero__actions {
  display: flex; flex-wrap: wrap; gap: 0.85rem;
  justify-content: center;
  margin: clamp(1.75rem, 4vh, 2.5rem) 0 0;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font: 700 1rem/1 var(--sans);
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn--gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #2a1c08;
  box-shadow: 0 8px 22px rgb(184 137 42 / 0.35);
}
.btn--gold:hover { color: #2a1c08; transform: translateY(-2px); }
.btn--ghost {
  border-color: rgb(232 185 61 / 0.55);
  color: var(--parchment);
  background: rgb(23 17 12 / 0.45);
}
.btn--ghost:hover { border-color: var(--gold); color: #fff; transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) {
  .btn:hover { transform: none; }
}

/* ---------- sparkles ---------- */
.sparkles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.sparkles i {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px 2px rgb(232 185 61 / 0.7);
  opacity: 0;
  animation: twinkle 5.5s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.6); }
  45%      { opacity: 0.9; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .sparkles i { animation: none; opacity: 0.5; }
}

/* ---------- sections ---------- */
.section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 8vh, 5.5rem) var(--pad) 0;
}

.section__h {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.65rem, 4vw, 2.4rem);
  color: var(--gold);
  text-align: center;
  margin: 0 0 clamp(1.5rem, 4vh, 2.25rem);
  display: flex; align-items: center; gap: 1rem;
}
/* Thin gold rules either side of the heading — a shelf line. */
.section__h::before, .section__h::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgb(232 185 61 / 0.45), transparent);
}
.section__h span { flex: 0 1 auto; }

/* ---------- panels ---------- */
.panel {
  /* Prose is capped at 62ch for readability; without a matching cap on the box the
     text hugs the left of a 68rem panel and leaves a dead margin on the right. */
  max-width: 54rem;
  margin-inline: auto;
  background: linear-gradient(180deg, #241a12, #1c150e);
  border: 1px solid rgb(232 185 61 / 0.22);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 4vw, 2.25rem);
  box-shadow: var(--shadow);
}

.prose p { margin: 0 0 1.1em; max-width: 62ch; }
.prose p:last-child { margin-bottom: 0; }

.panel__ages {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
  border-top: 1px solid rgb(232 185 61 / 0.22);
  padding-top: 1rem;
  margin-top: 1.4rem !important;
}

/* ---------- video card ---------- */
.story { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }

.player, .story iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.player {
  position: relative;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--wood);
  border: 1px solid rgb(232 185 61 / 0.25);
  font: inherit;
  color: inherit;
}
.player img { width: 100%; height: 100%; object-fit: cover; }

.player::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgb(23 17 12 / 0.55), transparent 55%);
  transition: opacity 0.2s ease;
}

.player__play {
  position: absolute; inset: 0; margin: auto;
  width: 84px; height: 84px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.5);
  z-index: 1;
  transition: transform 0.18s ease;
}
.player__play::before {
  content: '';
  border-style: solid;
  border-width: 15px 0 15px 25px;
  border-color: transparent transparent transparent #2a1c08;
  margin-left: 6px;
}
.player:hover .player__play, .player:focus-visible .player__play { transform: scale(1.09); }
@media (prefers-reduced-motion: reduce) {
  .player:hover .player__play, .player:focus-visible .player__play { transform: none; }
}

.story__meta { text-align: center; }
.story__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: #fdf4e0;
}
.story__date {
  font-size: 0.92rem;
  color: var(--parchment-dim);
  margin: 0 0 1rem;
}
.story__blurb { margin: 0 auto; max-width: 60ch; color: #e2d3b4; }

/* ---------- grid of older stories ---------- */
.grid {
  display: grid;
  gap: clamp(1.1rem, 2.5vw, 1.75rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  list-style: none;
  margin: 0; padding: 0;
}
.card { display: flex; flex-direction: column; gap: 0.75rem; }
.card .player__play { width: 58px; height: 58px; }
.card .player__play::before { border-width: 10px 0 10px 17px; margin-left: 4px; }
.card__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.25;
  margin: 0;
  color: #f2e6cc;
}
.card__date { font-size: 0.84rem; color: var(--parchment-dim); margin: 0; }

/* ---------- footer ---------- */
.footer {
  margin-top: clamp(3.5rem, 9vh, 6rem);
  padding: clamp(2.5rem, 6vh, 3.5rem) var(--pad) clamp(2rem, 5vh, 3rem);
  text-align: center;
  border-top: 1px solid rgb(232 185 61 / 0.18);
  background: linear-gradient(to bottom, transparent, rgb(58 38 24 / 0.35));
}
.footer__mark { margin: 0 auto 0.9rem; border-radius: 50%; opacity: 0.9; }
.footer__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--gold);
  margin: 0 0 0.35rem;
}
.footer__contact { margin: 0 0 1.1rem; color: var(--parchment-dim); }
.footer__legal { font-size: 0.84rem; color: #9b8a6d; margin: 1.4rem 0 0; }

.socials {
  display: flex; justify-content: center; gap: 0.7rem;
  list-style: none; margin: 0 0 0.5rem; padding: 0;
}
.socials a {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgb(232 185 61 / 0.35);
  color: var(--parchment);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.socials a:hover { background: rgb(232 185 61 / 0.15); border-color: var(--gold); }
.socials svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- wider screens ---------- */
@media (min-width: 52rem) {
  .story--latest { grid-template-columns: 1.55fr 1fr; align-items: center; }
  .story--latest .story__meta { text-align: left; }
  .story--latest .story__blurb { margin-inline: 0; }
}
