/* Der Sternenfuchs. Lotti's room at night: window panes are glass, every section lights one star. See DESIGN.md. */

@font-face { font-family: "Fredoka"; src: url("/fonts/Fredoka.woff2") format("woff2"); font-weight: 300 700; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/Nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --night-0: #050617;
  --night-1: #0b0e2f;
  --navy: #1b1f4b;
  --royal: #2b44d6;
  --violet: #5b2aa8;
  --wine: #a0122f;
  --gold: #ffd76a;
  --gold-deep: #e0972a;
  --cream: #fff8ea;
  --muted: #bcc0e6;
  --line: rgba(255, 248, 234, 0.15);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.11);

  --f-display: "Fredoka", ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --f-text: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --t-xl: clamp(2.1rem, 1.25rem + 3.7vw, 4.4rem);
  --t-l: clamp(1.4rem, 1.15rem + 1.1vw, 2.05rem);
  --t-m: clamp(1.1rem, 1.04rem + 0.35vw, 1.3rem);
  --t-body: clamp(1rem, 0.97rem + 0.18vw, 1.125rem);
  --t-s: 0.92rem;
  --t-xs: 0.82rem;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 76rem;
  --r: 1.5rem;
  --ease: cubic-bezier(0.16, 0.84, 0.3, 1);
}

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

/* no global smooth scrolling: keyboard focus must land at once. In-page links glide via site.js. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 6.25rem; color-scheme: dark; background: var(--night-1); }

body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; color: var(--cream); font: 400 var(--t-body) / 1.6 var(--f-text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
main { flex: 1 0 auto; }
main:focus { outline: none; }

/* The night sky: fixed behind everything. Royal blue from the window side, violet and a little dark red low down. */
body::before {
  content: ""; position: fixed; inset: 0; height: 100lvh; z-index: -2; pointer-events: none;
  background:
    radial-gradient(110% 65% at 88% -8%, rgba(43, 68, 214, 0.6), transparent 62%),
    radial-gradient(85% 55% at -12% 38%, rgba(91, 42, 168, 0.55), transparent 64%),
    radial-gradient(75% 45% at 105% 104%, rgba(160, 18, 47, 0.34), transparent 62%),
    linear-gradient(180deg, var(--night-0), var(--night-1) 46%, #131a55);
}
body::after {
  content: ""; position: fixed; inset: 0; height: 100lvh; z-index: -1; pointer-events: none; opacity: 0.85;
  background-image:
    radial-gradient(1.4px 1.4px at 7% 14%, #fff8ea 50%, transparent 52%),
    radial-gradient(1px 1px at 19% 63%, #fff8ea 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 28% 31%, #ffd76a 50%, transparent 52%),
    radial-gradient(1px 1px at 37% 82%, #fff8ea 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 46% 9%, #fff8ea 50%, transparent 52%),
    radial-gradient(1px 1px at 55% 47%, #fff8ea 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 63% 72%, #ffd76a 50%, transparent 52%),
    radial-gradient(1px 1px at 71% 22%, #fff8ea 50%, transparent 52%),
    radial-gradient(1.3px 1.3px at 79% 56%, #fff8ea 50%, transparent 52%),
    radial-gradient(1px 1px at 86% 88%, #fff8ea 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 93% 37%, #fff8ea 50%, transparent 52%),
    radial-gradient(1px 1px at 12% 91%, #fff8ea 50%, transparent 52%);
}

::selection { background: var(--gold); color: var(--navy); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 0.5rem; }

img { max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; padding: 0.7rem 1rem; border-radius: 99px; background: var(--gold); color: var(--navy); font: 600 1rem var(--f-display); text-decoration: none; }
.skip:focus { top: 0.6rem; }

/* The star: outline while dark, gold with a halo once lit. */
.star { display: block; fill: none; stroke: currentColor; stroke-width: 1.7; overflow: visible; transition: fill 0.5s, stroke 0.5s, filter 0.6s, scale 0.6s var(--ease), rotate 0.6s var(--ease); }
.star--on, .is-lit > .star, .is-lit .sec__star, html:not(.js) .sky .star, html:not(.js) .sec__star { fill: var(--gold); stroke: var(--gold); filter: drop-shadow(0 0 0.4rem rgba(255, 215, 106, 0.75)); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; view-transition-name: top; }
.top::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(9, 11, 40, 0.92); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); border-bottom: 1px solid var(--line); }
/* desktop: brand | nav centred | ceiling stars. The nav stays in the same place on every page. */
.top__bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1rem; height: 3.75rem; width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.top__bar .brand { justify-self: start; }
.top__bar .sky { justify-self: end; }

.brand { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; font: 600 1.14rem/1 var(--f-display); letter-spacing: 0.01em; text-decoration: none; white-space: nowrap; }
.brand .star { width: 1.45rem; height: 1.45rem; }
@media (hover: hover) { .brand:hover .star { rotate: 36deg; scale: 1.35; filter: drop-shadow(0 0 0.7rem rgba(255, 215, 106, 1)); } }
.brand:focus-visible .star { rotate: 36deg; scale: 1.35; filter: drop-shadow(0 0 0.7rem rgba(255, 215, 106, 1)); }

.nav { display: flex; gap: clamp(1.1rem, 2.4vw, 2rem); }
.nav a { padding: 0.75rem 0; font: 600 0.98rem/1 var(--f-text); text-decoration: none; }
/* phones: the four links get their own row under the brand, the ceiling stars stay top right */
@media (max-width: 51.99rem) {
  .top__bar { grid-template-columns: 1fr auto; height: auto; column-gap: 0.5rem; row-gap: 0; padding-top: 0.2rem; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 0.75rem; margin-top: -0.35rem; }
  .nav a { padding: 0.6rem 0 0.7rem; font-size: 0.93rem; }
  .sky { grid-column: 2; grid-row: 1; }
}

/* underline that draws in gold: nav and footer */
.draw { background: linear-gradient(var(--gold) 0 0) left 88% / 0% 2px no-repeat; transition: background-size 0.45s var(--ease); }
@media (hover: hover) { .draw:hover { background-size: 100% 2px; } }
.draw:focus-visible, .draw[aria-current] { background-size: 100% 2px; }

/* the ceiling: five stars, one per section */
.sky { display: flex; gap: 0.1rem; margin: 0 -0.35rem 0 0; padding: 0; list-style: none; }
.sky a { display: grid; place-items: center; width: 1.9rem; height: 2.75rem; color: rgba(255, 248, 234, 0.5); }
.sky .star { width: 1.1rem; height: 1.1rem; }
.sky a[aria-current] .star { scale: 1.3; }
@media (hover: hover) { .sky a:hover .star { scale: 1.45; rotate: 36deg; stroke: var(--gold); } }
.sky a:focus-visible .star { scale: 1.45; rotate: 36deg; stroke: var(--gold); }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.55em; min-height: 3.25rem; padding: 0.7em 1.35em; border: 0; border-radius: 99px; font: 600 1.06rem/1.1 var(--f-display); letter-spacing: 0.01em; text-decoration: none; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: box-shadow 0.5s var(--ease), background-color 0.35s, translate 0.25s var(--ease), scale 0.25s var(--ease); }
.btn .star { flex: none; width: 1.15em; height: 1.15em; }
.btn--gold { background: var(--gold); color: var(--navy); box-shadow: inset 0 -3px 0 rgba(224, 151, 42, 0.6), 0 0 0 0 rgba(255, 215, 106, 0); }
.btn--gold .star { fill: var(--navy); stroke: var(--navy); filter: none; }
.btn--glass { background: var(--glass-strong); color: var(--cream); box-shadow: inset 0 0 0 1px rgba(255, 248, 234, 0.3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
@media (hover: hover) {
  .btn--gold:hover { box-shadow: inset 0 -3px 0 rgba(224, 151, 42, 0.6), 0 0 0 6px rgba(255, 215, 106, 0.2), 0 0 3rem 0.35rem rgba(255, 215, 106, 0.6); }
  .btn--glass:hover { background-color: rgba(255, 255, 255, 0.22); box-shadow: inset 0 0 0 1px rgba(255, 215, 106, 0.9), 0 0 2.2rem 0 rgba(255, 215, 106, 0.3); }
  .btn:hover .star { rotate: 36deg; scale: 1.3; }
  .btn--glass:hover .star { fill: var(--gold); stroke: var(--gold); }
}
.btn--gold:focus-visible { box-shadow: inset 0 -3px 0 rgba(224, 151, 42, 0.6), 0 0 0 6px rgba(255, 215, 106, 0.2), 0 0 3rem 0.35rem rgba(255, 215, 106, 0.6); }
.btn--glass:focus-visible { background-color: rgba(255, 255, 255, 0.22); }
.btn:focus-visible .star { rotate: 36deg; scale: 1.3; }
.btn--glass:focus-visible .star { fill: var(--gold); stroke: var(--gold); }
@media (hover: hover) { .btn:hover { translate: 0 -2px; } }
.btn:focus-visible { translate: 0 -2px; }
.btn:active { translate: 0 2px; scale: 0.98; }

/* inline links: underline at rest, a band of light on hover */
.link { text-decoration: none; font-weight: 700; background: linear-gradient(rgba(255, 215, 106, 0.9) 0 0) left bottom / 100% 2px no-repeat; transition: background-size 0.4s var(--ease), color 0.3s; padding-bottom: 0.08em; }
@media (hover: hover) { .link:hover { background-size: 100% 100%; color: var(--navy); } }
.link:focus-visible { background-size: 100% 100%; color: var(--navy); }

/* ---------- hero ---------- */
.hero { position: relative; padding-block: clamp(1.4rem, 3.4vw, 3rem) clamp(2.5rem, 6vw, 5rem); }
.hero__stars { position: absolute; inset: 0; pointer-events: none; overflow: clip; }
.tw { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); fill: var(--gold); opacity: 0.35; animation: twinkle 4.6s ease-in-out var(--d) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.2; scale: 0.8; } 50% { opacity: 0.95; scale: 1.15; } }

.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); container-type: inline-size; position: relative; }
.pill { justify-self: start; margin: 0 0 0.9rem; padding: 0.5em 0.95em; border-radius: 99px; background: var(--gold); color: var(--navy); font: 600 0.8rem/1 var(--f-display); letter-spacing: 0.09em; text-transform: uppercase; }
.mega { position: relative; z-index: 2; margin: 0 0 0.3em -0.04em; font: 700 14.6cqi/0.9 var(--f-display); font-stretch: 88%; letter-spacing: -0.012em; color: var(--gold); text-shadow: 0 0.035em 0 rgba(224, 151, 42, 0.55), 0 0 0.6em rgba(255, 215, 106, 0.28); }
.mega span { display: block; white-space: nowrap; }
.lede { margin: 0 0 1.4rem; max-width: 33rem; font-size: var(--t-m); line-height: 1.5; }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero__copy { margin-bottom: 2rem; }

/* the three volumes on a little shelf under the buttons: buying stays up front */
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; max-width: 30rem; margin: 1.75rem 0 0; padding: 1.1rem 0 0; list-style: none; border-top: 1px solid var(--line); }
.shelf a { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; min-height: 2.75rem; text-decoration: none; }
.shelf img { display: block; height: 4.6rem; width: auto; border-radius: 0.3rem; box-shadow: 0 0.7rem 1.4rem -0.6rem rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08); transition: translate 0.5s var(--ease), rotate 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.shelf span { color: var(--muted); font: 600 var(--t-xs)/1.2 var(--f-display); letter-spacing: 0.04em; transition: color 0.3s; }
.shelf b { display: block; color: var(--cream); font-size: 1rem; letter-spacing: 0; }
@media (hover: hover) {
  .shelf a:hover img { translate: 0 -0.35rem; rotate: -3deg; box-shadow: 0 1.1rem 1.6rem -0.6rem rgba(0, 0, 0, 0.9), 0 0 2rem -0.2rem rgba(255, 215, 106, 0.55); }
  .shelf a:hover b { color: var(--gold); }
}
.shelf a:focus-visible img { translate: 0 -0.35rem; rotate: -3deg; }
.shelf a:focus-visible b { color: var(--gold); }
@media (min-width: 40rem) {
  .shelf a { flex-direction: row; align-items: center; gap: 0.7rem; }
  .shelf img { height: 4.6rem; }
}
@media (max-width: 39.99rem) { .shelf img { height: 6.2rem; } }

.window { position: relative; margin: 0; }
.window__pane { position: relative; aspect-ratio: 1 / 1.06; overflow: clip; border-radius: 999px 999px var(--r) var(--r); border: 3px solid var(--gold); background: var(--navy); box-shadow: 0 0 0 0.6rem rgba(255, 255, 255, 0.055), 0 2.2rem 4.5rem -1.4rem rgba(0, 0, 0, 0.75), 0 0 6rem -0.5rem rgba(255, 215, 106, 0.28); }
.window__pane img { display: block; width: 100%; height: 100%; object-fit: cover; scale: 1.07; animation: hover-outside 11s ease-in-out infinite alternate; }
@keyframes hover-outside { from { translate: 0 1.7%; } to { translate: 0 -1.7%; } }
/* the pane: a reflection across the glass */
.window__pane::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(118deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 26%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, 0.07) 100%); }
/* the sill under the window carries the owl's weather report */
.weather { position: relative; z-index: 1; margin: -0.5rem -2.5% 0; padding: 0.9rem 1.15rem 1rem; border-radius: 1rem; background: rgba(27, 31, 75, 0.72); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1rem 2rem -1rem rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); font-size: var(--t-s); line-height: 1.45; }
.weather b { display: block; margin-bottom: 0.25rem; font: 600 0.78rem/1.2 var(--f-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }

@media (min-width: 52rem) {
  .hero__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: center; }
  .pill, .mega { grid-column: 1 / -1; }
  .mega { font-size: 10.35cqi; font-stretch: 100%; margin-bottom: 0; }
  .mega span { display: inline; }
  .hero__grid { align-items: start; }
  .hero__copy { grid-column: 1 / span 6; margin: 0; padding-top: 3.4cqi; }
  .window { grid-column: 8 / -1; margin-top: -3.4cqi; }
}

/* ---------- sections ---------- */
.sec { position: relative; padding-block: clamp(2.75rem, 6vw, 5.25rem); }
/* the light that comes on with the star: a soft glow behind the heading, faded out on every side */
.sec::before { content: ""; position: absolute; left: 0; right: 0; top: -4rem; height: min(40rem, 100% + 4rem); z-index: -1; pointer-events: none; background: radial-gradient(55% 55% at 16% 34%, rgba(255, 215, 106, 0.13), transparent 72%); -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 22%, #000 70%, transparent); opacity: 0; transition: opacity 1.4s var(--ease); }
.sec.is-lit::before, html:not(.js) .sec::before { opacity: 1; }
.sec__head { display: grid; gap: 0.7rem; margin-bottom: clamp(1.75rem, 4vw, 3.25rem); }
.sec__star { width: clamp(2.2rem, 4vw, 3rem); height: clamp(2.2rem, 4vw, 3rem); color: rgba(255, 248, 234, 0.45); transform-origin: center; }
.h2 { margin: 0; max-width: 18ch; font: 700 var(--t-xl)/1 var(--f-display); letter-spacing: -0.012em; text-wrap: balance; }
.sec__intro { margin: 0; max-width: 34rem; font-size: var(--t-m); line-height: 1.5; color: var(--muted); }
@media (min-width: 60rem) {
  .sec__head--split { grid-template-columns: 7fr 5fr; column-gap: var(--gutter); align-items: end; }
  .sec__head--split .sec__star { grid-column: 1 / -1; }
}
/* the cast is introduced like a curtain call: centred */
.sec__head--center { justify-items: center; text-align: center; }
.sec__head--center .h2 { max-width: none; font-size: clamp(2.5rem, 1.2rem + 5.6vw, 6rem); }

@media (prefers-reduced-motion: no-preference) {
  .js .sec__body { opacity: 0.72; translate: 0 0.9rem; transition: opacity 1s var(--ease), translate 1.1s var(--ease); }
  .js .is-lit .sec__body { opacity: 1; translate: 0 0; }
  /* backwards, not both: after the pling the star returns to its own styles, so hover still turns it */
  .js .is-lit .sec__star { animation: pling 0.95s var(--ease) backwards; }
  .js .sky .is-lit .star { animation: pling 0.95s var(--ease) backwards; }
}
@keyframes pling { 0% { scale: 0.55; rotate: -40deg; } 55% { scale: 1.4; rotate: 10deg; } 100% { scale: 1; rotate: 0deg; } }

/* ---------- books: window panes ---------- */
.books { display: grid; gap: clamp(1rem, 2.2vw, 1.75rem); }
.book { position: relative; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 1rem 1.15rem; align-items: start; padding: clamp(1.05rem, 2.2vw, 1.9rem); border-radius: var(--r); background: linear-gradient(158deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035) 58%); box-shadow: inset 0 0 0 1px rgba(255, 248, 234, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 1.9rem 3.6rem -1.9rem rgba(0, 0, 0, 0.65); -webkit-backdrop-filter: blur(18px) saturate(1.25); backdrop-filter: blur(18px) saturate(1.25); scroll-margin-top: 5rem; }
.book__cover { display: block; align-self: start; }
.book__cover img { display: block; width: 100%; border-radius: 0.45rem; box-shadow: 0 1.1rem 2.2rem -0.9rem rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08); transition: translate 0.6s var(--ease), rotate 0.6s var(--ease), box-shadow 0.6s var(--ease); }
@media (hover: hover) { .book:hover .book__cover img { translate: 0 -0.45rem; rotate: -1.6deg; box-shadow: 0 1.8rem 2.6rem -1rem rgba(0, 0, 0, 0.9), 0 0 3.2rem -0.3rem rgba(255, 215, 106, 0.5); } }
.book__cover:focus-visible img { translate: 0 -0.45rem; rotate: -1.6deg; }
.book__band { display: inline-block; margin: 0 0 0.55rem; padding: 0.35em 0.75em; border-radius: 99px; box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold); font: 600 0.74rem/1 var(--f-display); letter-spacing: 0.1em; text-transform: uppercase; }
.book__title { margin: 0 0 0.2rem; font: 700 var(--t-l)/1.05 var(--f-display); letter-spacing: -0.005em; text-wrap: balance; }
.book__kind { margin: 0 0 0.6rem; color: var(--gold); font: 500 1.02rem/1.25 var(--f-display); }
.book__text { margin: 0; font-size: var(--t-s); line-height: 1.5; }
/* phone: cover and title side by side, text and buying across the whole card */
.book__body { display: contents; }
.book__head { grid-column: 2; align-self: center; }
.book__text, .book__more { grid-column: 1 / -1; }
.book__more { display: grid; gap: 1rem; }
.book__facts { margin: 0; padding: 0; list-style: none; font-size: var(--t-s); color: var(--muted); }
.book__facts li { display: flex; gap: 0.6em; align-items: baseline; padding: 0.42rem 0; border-top: 1px solid var(--line); }
.book__facts li::before { content: ""; flex: none; width: 0.42em; height: 0.42em; border-radius: 50%; background: var(--gold); translate: 0 -0.12em; }
.book__buy { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.1rem; }
.book__buy .btn { flex: 1 1 auto; }
.price { font: 700 1.55rem/1 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.soon { display: inline-flex; align-items: center; gap: 0.5em; min-height: 3rem; margin: 0; padding: 0.55em 1.15em; border-radius: 99px; box-shadow: inset 0 0 0 1.5px rgba(255, 248, 234, 0.34); font: 500 0.98rem/1.2 var(--f-display); }
.soon .star { width: 1.05em; height: 1.05em; color: var(--gold); }
.book__have { position: absolute; top: -0.7rem; right: 1.1rem; margin: 0; padding: 0.4em 0.85em; border-radius: 99px; background: var(--wine); color: var(--cream); font: 600 0.78rem/1 var(--f-display); letter-spacing: 0.04em; }

@media (min-width: 60rem) {
  /* Band 1 across the whole width, Band 2 and 3 side by side below it */
  .books { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .book--1 { grid-column: 1 / -1; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.1rem clamp(1.9rem, 3.5vw, 3.25rem); align-content: center; padding: clamp(1.5rem, 2.6vw, 2.4rem); }
  .book--1 .book__title { font-size: clamp(2.2rem, 3.6vw, 3.4rem); }
  .book--1 .book__text { font-size: var(--t-m); line-height: 1.5; max-width: 34rem; }
  .book--1 .book__cover { grid-row: 1 / span 3; align-self: center; }
  .book--1 .book__head { align-self: end; }
  .book--1 .book__text, .book--1 .book__more { grid-column: 2; }
  .book--1 .book__more { grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.9rem; align-items: end; }
  /* Band 2 and 3: small cover left, everything else right */
  .book:not(.book--1) { grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr); }
  .book:not(.book--1) .book__cover { grid-row: 1 / span 3; }
  .book:not(.book--1) .book__head { align-self: start; }
  .book:not(.book--1) .book__text, .book:not(.book--1) .book__more { grid-column: 2; }
}

/* ---------- colouring pages: paper on the night ---------- */
.sheets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 1.1rem; margin: 0; padding: 0; list-style: none; }
.sheets li:nth-child(1) { --tilt: -2.4deg; }
.sheets li:nth-child(2) { --tilt: 1.7deg; margin-top: 1.4rem; }
.sheets li:nth-child(3) { --tilt: 1.2deg; }
.sheets li:nth-child(4) { --tilt: -2deg; margin-top: 1.4rem; }
.sheet { display: block; text-decoration: none; }
.sheet__paper { display: block; padding: 5% 5% 6%; border-radius: 0.3rem; background: #fff; rotate: var(--tilt); box-shadow: 0 1.3rem 2.6rem -1.1rem rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(27, 31, 75, 0.08); transition: rotate 0.6s var(--ease), translate 0.6s var(--ease), box-shadow 0.6s var(--ease); }
.sheet__paper img { display: block; width: 100%; }
.sheet__cap { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem 0.75rem; margin-top: 1rem; font: 600 1.08rem/1.2 var(--f-display); }
.sheet__cap small { display: inline-flex; align-items: center; gap: 0.35em; color: var(--muted); font: 600 var(--t-xs)/1.2 var(--f-text); }
.sheet__cap svg { width: 0.95em; height: 0.95em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: translate 0.4s var(--ease); }
@media (hover: hover) {
  .sheet:hover .sheet__paper { rotate: 0deg; translate: 0 -0.55rem; box-shadow: 0 2rem 3rem -1.2rem rgba(0, 0, 0, 0.9), 0 0 3.4rem -0.2rem rgba(255, 215, 106, 0.55); }
  .sheet:hover .sheet__cap svg { translate: 0 0.22rem; }
  .sheet:hover .sheet__cap small { color: var(--gold); }
}
.sheet:focus-visible .sheet__paper { rotate: 0deg; translate: 0 -0.55rem; }
.sheet:active .sheet__paper { translate: 0 0.1rem; }
.sheets__more { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-top: clamp(2rem, 4vw, 3rem); }
.sheets__more p { margin: 0; }
@media (min-width: 52rem) {
  .sheets { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.25rem; }
  .sheets li:nth-child(2), .sheets li:nth-child(4) { margin-top: 2.4rem; }
  .sheets li:nth-child(3) { --tilt: -1.1deg; }
  .sheets li:nth-child(4) { --tilt: 2.2deg; }
}

/* ---------- reading sample ---------- */
.read { display: grid; gap: clamp(1.6rem, 4vw, 3.5rem); }
.read__fig { margin: 0; }
.read__fig img { display: block; width: 100%; border-radius: var(--r); border: 3px solid var(--gold); box-shadow: 0 2rem 4rem -1.6rem rgba(0, 0, 0, 0.8); }
.read__fig figcaption { margin-top: 0.8rem; color: var(--muted); font: 600 var(--t-s)/1.2 var(--f-display); letter-spacing: 0.06em; text-transform: uppercase; }
.story { max-width: 35rem; font-size: clamp(1.1rem, 1.02rem + 0.42vw, 1.3rem); line-height: 1.62; }
.story h3 { margin: 0 0 1rem; color: var(--gold); font: 700 var(--t-l)/1.08 var(--f-display); text-wrap: balance; }
.story p { margin: 0 0 0.85em; }
.story .spell { margin: 1.3em 0; color: var(--gold); font: 600 var(--t-l)/1.2 var(--f-display); text-wrap: balance; }
.story__more { margin-top: 1.6em !important; color: var(--muted); }
@media (min-width: 60rem) {
  .read { grid-template-columns: 5fr 6fr; align-items: start; }
  .read__fig { position: sticky; top: 5.5rem; }
}

/* ---------- the cast ---------- */
.cast { display: grid; gap: 0 clamp(2rem, 5vw, 4.5rem); margin: 0; padding: 0; list-style: none; }
.cast li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1rem, 2.4vw, 1.75rem); align-items: center; padding-block: clamp(1.1rem, 2.4vw, 1.75rem); border-top: 1px solid var(--line); }
.cast img { display: block; width: clamp(5.75rem, 13vw, 9rem); aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--gold); background: var(--cream); box-shadow: 0 1.1rem 2.2rem -1rem rgba(0, 0, 0, 0.8); transition: rotate 0.6s var(--ease), scale 0.6s var(--ease); }
@media (hover: hover) { .cast li:hover img { rotate: -5deg; scale: 1.06; } }
.cast h3 { margin: 0; font: 700 var(--t-l)/1.05 var(--f-display); }
.cast__role { margin: 0.3rem 0 0.5rem; color: var(--muted); font-size: var(--t-s); line-height: 1.45; }
.cast q { color: var(--gold); font: 600 1.12rem/1.25 var(--f-display); quotes: "„" "“"; }
@media (min-width: 52rem) { .cast { grid-template-columns: 1fr 1fr; } }

/* ---------- good night ---------- */
.end { text-align: center; padding-bottom: clamp(3rem, 7vw, 6rem); }
.end::before { background: radial-gradient(50% 50% at 50% 42%, rgba(255, 215, 106, 0.16), transparent 72%); }
.end .wrap { container-type: inline-size; }
.end__star { margin: 0 auto 1.6rem; width: clamp(3.5rem, 8vw, 5.5rem); height: clamp(3.5rem, 8vw, 5.5rem); }
.end__lines { margin: 0 0 0.5rem; color: var(--muted); font: 500 var(--t-l)/1.4 var(--f-display); }
.end__lines span { display: block; }
.end__you { margin: 0 0 0.45em; color: var(--gold); font: 700 15cqi/0.95 var(--f-display); font-stretch: 90%; letter-spacing: -0.012em; text-shadow: 0 0.035em 0 rgba(224, 151, 42, 0.55), 0 0 0.6em rgba(255, 215, 106, 0.28); }
.end__note { max-width: 30rem; margin: 0 auto; color: var(--muted); }
@media (min-width: 52rem) { .end__you { font-size: 11.5cqi; font-stretch: 100%; } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: rgba(5, 6, 23, 0.55); }
.foot__in { display: grid; gap: 1rem; padding-block: 1.75rem 2.25rem; }
.foot__nav { display: flex; flex-wrap: wrap; gap: 0.15rem 1.4rem; }
.foot__nav a { display: inline-flex; align-items: center; min-height: 2.75rem; font: 600 var(--t-s)/1 var(--f-text); text-decoration: underline; text-decoration-color: rgba(255, 248, 234, 0.35); text-underline-offset: 0.3em; transition: color 0.3s, text-decoration-color 0.3s; }
@media (hover: hover) { .foot__nav a:hover { color: var(--gold); text-decoration-color: var(--gold); } }
.foot__nav a[aria-current] { color: var(--gold); text-decoration-color: var(--gold); }
.foot__small { margin: 0; color: var(--muted); font-size: var(--t-xs); }

/* ---------- text pages and 404 ---------- */
.page { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(3rem, 8vw, 6rem); }
.legal { max-width: 46rem; margin-inline: auto; padding: clamp(1.25rem, 4vw, 3rem); border-radius: var(--r); background: linear-gradient(158deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035) 60%); box-shadow: inset 0 0 0 1px rgba(255, 248, 234, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.24); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.legal h1 { margin: 0 0 1.2rem; color: var(--gold); font: 700 var(--t-xl)/1 var(--f-display); letter-spacing: -0.012em; overflow-wrap: anywhere; hyphens: auto; }
.legal h2 { margin: 2.1rem 0 0.6rem; font: 700 var(--t-l)/1.12 var(--f-display); }
.legal p { max-width: 38rem; }
.legal .stand { color: var(--muted); font-size: var(--t-s); }
.legal .link { display: inline-block; padding-block: 0.2rem 0.12rem; }
.lost { display: grid; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; container-type: inline-size; }
.lost__fig { justify-self: start; width: clamp(9rem, 30vw, 17rem); aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--gold); background: var(--cream); box-shadow: 0 0 5rem -0.5rem rgba(255, 215, 106, 0.4); animation: wrong-way 7s ease-in-out infinite alternate; }
@keyframes wrong-way { from { rotate: -5deg; } to { rotate: 5deg; } }
.lost h1 { margin: 0 0 0.35em; color: var(--gold); font: 700 clamp(2.5rem, 11cqi, 6.25rem)/0.95 var(--f-display); font-stretch: 90%; letter-spacing: -0.012em; text-wrap: balance; }
.lost p { max-width: 31rem; font-size: var(--t-m); line-height: 1.5; }
.lost .btn { margin-top: 0.75rem; }
@media (min-width: 52rem) { .lost { grid-template-columns: auto minmax(0, 1fr); } }

/* ---------- page change: fade through the night ---------- */
/* the header stays put, only the page below it changes */
@view-transition { navigation: auto; }
::view-transition-group(top), ::view-transition-old(top), ::view-transition-new(top) { animation: none; }
::view-transition-old(top) { display: none; }
::view-transition-old(root) { animation: 0.2s ease both vt-out; }
/* first the old page sinks into the night, then the new one rises: never two pages on top of each other */
::view-transition-new(root) { animation: 0.42s cubic-bezier(0.16, 0.84, 0.3, 1) 0.2s both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; translate: 0 0.9rem; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01s !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

@media print {
  body::before, body::after, .top, .foot, .hero__stars { display: none; }
  body { color: #000; background: #fff; }
}
.nowrap { white-space: nowrap; }
