:root {
  color-scheme: light;
  --paper: #f8f6f1;
  --white: #fffdf8;
  --ink: #211b29;
  --muted: #605967;
  --muted-purple: #665486;
  --line: #e5dfdf;
  --purple: #693bc9;
  --purple-dark: #5229ae;
  --purple-light: #efe8fc;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1rem; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #a77bf3; outline-offset: 4px; }
img { display: block; max-width: 100%; }
.shell { width: min(100% - 7rem, 82.5rem); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: .5rem; left: .5rem; z-index: 10; padding: .75rem; background: var(--white); }

.site-header { border-bottom: 1px solid var(--line); }
.topbar { min-height: 4.75rem; display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.65rem; font-weight: 700; letter-spacing: -.09em; line-height: 1; text-decoration: none; }
.brand-period { color: var(--purple); margin-left: -.48rem; }
.brand-icon { position: relative; width: 1.35rem; height: 1.35rem; flex: none; color: var(--purple); }
.brand-icon::before {
  position: absolute;
  content: "";
  width: .29rem;
  height: .29rem;
  top: .53rem;
  left: .53rem;
  border-radius: .035rem;
  background: currentColor;
  box-shadow: 0 -.5rem currentColor, 0 -.25rem currentColor, -.25rem 0 currentColor, -.5rem 0 currentColor, .25rem 0 currentColor, .5rem 0 currentColor, 0 .25rem currentColor, 0 .5rem currentColor;
}
.topbar-actions { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem); }
.topbar nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem); }
.topbar nav a { min-height: 2.75rem; display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; font-size: .925rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.topbar nav a:hover, .topbar nav a[aria-current] { color: var(--purple-dark); }
.language-switch { display: inline-flex; align-items: center; gap: .15rem; flex: none; padding: .2rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--white); }
.language-switch button { min-height: 2rem; padding: .2rem .5rem; border: 0; border-radius: .38rem; background: transparent; color: var(--muted); font-size: .875rem; font-weight: 700; }
.language-switch button:hover, .language-switch button[aria-pressed="true"] { color: var(--purple-dark); background: var(--purple-light); }
.bookmark-icon { --bookmark-bg: var(--paper); position: relative; display: inline-block; color: inherit; width: .8rem; height: 1rem; flex: none; background: currentColor; clip-path: polygon(0 0,100% 0,100% 100%,50% 72%,0 100%); }
.bookmark-icon::after { position: absolute; content: ""; inset: 1.5px 1.5px 2.6px; background: var(--bookmark-bg); clip-path: inherit; }
.book-icon { position: relative; display: inline-block; flex: none; width: 1.1rem; height: .97rem; }
.book-icon::before, .book-icon::after { content: ""; position: absolute; width: 53%; height: 100%; border: 1.5px solid currentColor; }
.book-icon::before { left: 0; border-radius: 4px 2px 2px 2px; transform: skewY(8deg); }
.book-icon::after { right: 0; border-radius: 2px 4px 2px 2px; transform: skewY(-8deg); }

.hero { min-height: 29rem; min-height: clamp(29rem, 38vw, 34rem); position: relative; display: flex; align-items: center; isolation: isolate; overflow: hidden; border-radius: 1rem; margin-top: 1.65rem; background: #161428; color: #fff9f4; }
.hero-image, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-image { object-fit: cover; object-position: center 10%; }
.hero::after { content: ""; background: linear-gradient(90deg, rgba(14,12,28,.96) 0%, rgba(18,14,31,.88) 29%, rgba(23,18,35,.46) 58%, rgba(17,14,29,.08) 100%); }
.hero-copy { width: min(100%, 39rem); padding: 3.2rem clamp(2rem, 5.3vw, 5.4rem); padding-right: 1rem; }
.eyebrow { margin: 0 0 .9rem; display: flex; align-items: center; gap: .55rem; color: #e6d5ff; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; font-size: .8125rem; }
.eyebrow-diamond { width: .5rem; height: .5rem; background: #d8b4ff; transform: rotate(45deg); border-radius: 1px; }
.hero h1 { font-family: var(--serif); font-size: clamp(3.4rem, 7vw, 6.7rem); line-height: 1.05; font-weight: 600; letter-spacing: -.071em; margin: 0 0 .85rem; text-wrap: balance; }
.hero-genres { margin: 0; color: #e7d5fa; font-size: .95rem; font-weight: 700; }
.hero-description { color: #ece3ef; line-height: 1.65; margin: 1.2rem 0 1.65rem; max-width: 25rem; font-size: 1.075rem; }
.hero-actions, .dialog-actions { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.button { border: 1px solid transparent; min-height: 2.85rem; padding: .72rem 1.05rem; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border-radius: .55rem; font-weight: 700; text-decoration: none; font-size: .925rem; }
.button-primary { background: var(--purple); color: #fff; }
.button-primary:hover { background: var(--purple-dark); }
.button-ghost { border-color: #d9c9e681; color: #fff9f4; background: #1d13285c; }
.button-ghost:hover { background: #f7e4ff24; }
.button-outline { border-color: var(--line); background: var(--white); }
.button-outline:hover { border-color: var(--purple); color: var(--purple-dark); }

.age-gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 1.25rem;
  background: linear-gradient(115deg, #100d21b8, #21183270), url("./assets/hollow-pines-hero.webp") center / cover no-repeat #161428;
}
.age-card { width: min(100%, 30rem); padding: clamp(1.15rem, 5vw, 2.45rem); border: 1px solid #ebe4eb; border-radius: 1rem; background: var(--paper); box-shadow: 0 1.5rem 4.5rem #110b229c; }
.age-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }
.age-card h1 { margin: 1.7rem 0 1.3rem; font: 600 clamp(2.15rem, 7vw, 3.05rem) / 1.12 var(--serif); letter-spacing: -.055em; text-wrap: balance; }
.age-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.age-actions .button:disabled { cursor: default; opacity: .55; }
.age-note { margin: .85rem 0 0; color: var(--muted); font-size: .9rem; }

.catalogue { padding: 3.2rem 0 4.2rem; scroll-margin-top: 1rem; min-height: 20rem; }
.catalogue-heading { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; }
.catalogue h2 { font-family: var(--serif); font-size: clamp(2rem, 4.15vw, 3.25rem); font-weight: 600; letter-spacing: -.055em; margin: 0; line-height: 1.12; }
.catalogue-heading p { margin: .65rem 0 0; color: var(--muted); }
.search { display: flex; align-items: center; gap: .65rem; border: 1px solid var(--line); border-radius: .6rem; min-width: min(16rem, 100%); padding: 0 .85rem; background: var(--white); color: var(--muted); }
.search:focus-within { outline: 2px solid #a77bf3; outline-offset: 2px; }
.search input { min-width: 0; width: 100%; padding: .75rem 0; background: none; outline: none; border: 0; color: var(--ink); font-size: .925rem; }
.search input:focus-visible { outline: none; }
.search-icon { display: inline-block; position: relative; width: .8rem; height: .8rem; margin-right: .2rem; border: 1.5px solid currentColor; border-radius: 50%; flex: none; }
.search-icon::after { content: ""; width: .38rem; height: 1.5px; background: currentColor; position: absolute; right: -.28rem; bottom: -.12rem; transform: rotate(47deg); }
.filters { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.4rem 0 1.45rem; }
.filter { min-height: 2.4rem; padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--muted); font-size: .9rem; font-weight: 700; }
.filter[aria-pressed="true"] { border-color: var(--purple-light); color: var(--purple-dark); background: var(--purple-light); }
.filter:hover { border-color: var(--purple); color: var(--purple-dark); }
.story-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.9rem, 2.4vw, 2rem); row-gap: 2rem; }
.story { min-width: 0; }
.cover { position: relative; isolation: isolate; aspect-ratio: 4 / 5; border-radius: .65rem; overflow: hidden; background: #20142e; box-shadow: 0 .28rem 1rem #28173719; }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .32s ease; }
.cover:has(.cover-target:hover) img { transform: scale(1.035); }
.cover-target { position: absolute; inset: 0; width: 100%; border: 0; background: linear-gradient(175deg, #120b2491, transparent 32%); }
.cover-target:focus-visible { outline-offset: -5px; }
.status, .save { position: absolute; top: .7rem; }
.status { left: .7rem; max-width: calc(100% - 3.9rem); padding: .28rem .52rem; border-radius: .28rem; background: #241b39ed; color: #fbf2ff; font-size: .79rem; font-weight: 700; pointer-events: none; }
.status[data-available="true"] { background: #efe2ff; color: #482483; }
.save { --bookmark-bg: #242039; right: .7rem; display: grid; place-items: center; width: 2.45rem; height: 2.45rem; border: 1px solid #ecdef473; border-radius: .45rem; color: #fff; background: #242039; }
.save .bookmark-icon { --bookmark-bg: #242039; }
.save:hover, .save[aria-pressed="true"] { color: #e9cfff; border-color: #d5a5ff; }
.save[aria-pressed="true"] .bookmark-icon::after { display: none; }
.story-genres { color: var(--muted-purple); font-size: .875rem; font-weight: 700; margin: .9rem 0 .35rem; }
.story h3 { font-family: var(--serif); letter-spacing: -.045em; font-size: clamp(1.35rem, 2.25vw, 1.9rem); font-weight: 600; line-height: 1.16; margin: 0; }
.story-title { padding: 0; background: transparent; border: none; text-align: left; letter-spacing: inherit; }
.story-title:hover { color: var(--purple-dark); }
.story-tagline { color: var(--muted); line-height: 1.55; font-size: .95rem; margin: .4rem 0 0; }
.story-energy { display: flex; align-items: baseline; gap: .4rem; margin: .65rem 0 0; color: #77460f; font-size: .875rem; font-weight: 700; line-height: 1.4; }
.energy-bolt { display: inline-block; flex: none; width: .8rem; height: .95rem; align-self: start; margin-top: .12rem; background: #a45b14; clip-path: polygon(57% 0, 10% 54%, 42% 54%, 30% 100%, 94% 36%, 59% 36%, 73% 0); }
.cover-energy {
  position: absolute;
  right: .7rem;
  bottom: .7rem;
  display: grid;
  place-items: center;
  width: 2.45rem;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #fff2c2;
  background: #a6a2ae;
  background: conic-gradient(#ffd54f var(--energy-level, 0%), #a6a2ae var(--energy-level, 0%));
  box-shadow: 0 .18rem .5rem #130d2260;
  pointer-events: none;
}
.cover-energy::before { content: ""; position: absolute; inset: 3px; border-radius: inherit; background: #241e32; }
.cover-energy .energy-bolt { position: relative; width: .85rem; height: 1.05rem; align-self: center; margin: 0; background: currentColor; }
.empty { border: 1px dashed #d6c8df; border-radius: .7rem; padding: 2rem; text-align: center; }
.empty p { color: var(--muted); margin: 0 0 1rem; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 5.25rem; }
.footer-inner .brand { font-size: 1.4rem; }
.footer-inner p { color: var(--muted); font-size: .9rem; margin: 0; }

dialog { width: min(38rem, calc(100% - 1.6rem)); max-height: calc(100% - 1.6rem); overflow: auto; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: .9rem; padding: 0; box-shadow: 0 1.5rem 5rem #1c0d38a0; }
dialog::backdrop { background: #150f2cb3; }
.dialog-close { position: sticky; top: .65rem; float: right; margin: .65rem .65rem -3.1rem 0; z-index: 1; }
.dialog-close button { display: grid; place-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 50%; width: 2.45rem; height: 2.45rem; font-size: 1.5rem; line-height: 1; }
.dialog-close button:hover { background: var(--purple-light); }
.dialog-info, .reader { padding: clamp(1.25rem, 6vw, 2.7rem); }
.dialog-banner { width: 100%; height: 12rem; object-fit: cover; object-position: center 42%; background: #231c35; }
.dialog-kicker { color: var(--purple-dark); font-size: .9rem; font-weight: 700; }
.dialog-info h2, .reader h2 { font-family: var(--serif); font-size: clamp(2rem, 7vw, 3.15rem); line-height: 1.12; letter-spacing: -.06em; margin: .55rem 0 1.1rem; font-weight: 600; }
.dialog-copied { color: var(--muted); line-height: 1.65; margin: 0 0 1.25rem; }
.dialog-info .story-energy { margin: 0 0 1rem; }
.dialog-info .story-energy:has(+ .energy-note) { margin-bottom: .35rem; }
.energy-note { color: var(--muted); line-height: 1.55; font-size: .9rem; margin: 0 0 1.25rem; }
.reader { padding-top: 2.75rem; }
.reader > p:not(.dialog-kicker), .reader output { font-size: 1.075rem; line-height: 1.75; }
.reader output { display: block; padding: 1rem; margin: 1.15rem 0 0; border-left: 3px solid var(--purple); background: var(--purple-light); border-radius: .25rem; }
.reader output:empty { display: none; }
.choice-list { display: grid; gap: .5rem; margin: 1.35rem 0; }
.choice-list button { justify-content: start; text-align: left; }
.choice-list button[aria-pressed="true"] { border-color: var(--purple); background: var(--purple-light); color: var(--purple-dark); }

@media (max-width: 64rem) {
  .shell { width: calc(100% - 4rem); }
  .hero-copy { padding-left: clamp(2rem, 5.5vw, 4rem); }
}
@media (max-width: 46rem) {
  .shell { width: calc(100% - 2rem); }
  .topbar { min-height: 4.25rem; }
  .hero { min-height: 28rem; margin-top: 1rem; }
  .hero-image { object-position: 62% center; }
  .hero::after { background: linear-gradient(90deg, #140f23d9 0%, #170e24aa 52%, #21172748 100%), linear-gradient(0deg, #140f2375, transparent 55%); }
  .hero-copy { padding: 2rem 1.3rem; }
  .hero h1 { text-wrap: initial; }
  .catalogue { padding-top: 2.45rem; }
  .catalogue-heading { align-items: stretch; flex-direction: column; gap: 1.15rem; }
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status, .save { top: .4rem; }
  .status { left: .4rem; }
  .save { right: .4rem; }
  .cover-energy { right: .4rem; bottom: .4rem; }
}
@media (max-width: 32rem) {
  .topbar { flex-wrap: wrap; gap: 0 .5rem; padding-block: .45rem .15rem; }
  .topbar-actions { display: contents; }
  .topbar nav { order: 3; width: 100%; }
  .topbar nav a { min-height: 2.5rem; }
  .topbar .language-switch { margin-left: auto; }
}
@media (max-width: 24rem) {
  .brand { font-size: 1.4rem; }
  .topbar nav { gap: .6rem; }
  .topbar nav a { font-size: .875rem; }
  .topbar nav .bookmark-icon { display: none; }
  .hero h1 { font-size: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
