/* =====================================================================
   Irene Poore — main stylesheet
   Art direction: "moonlit storybook" — midnight-sky sections for the
   magic, warm paper/cream sections for reading.
   ===================================================================== */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2-variations"),
       url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --night: #121633;
  --night-2: #1a1f4b;
  --night-3: #2a3170;
  --cream: #f8f1e4;
  --paper: #fffaf2;
  --sand: #efe4d0;
  --ink: #1b1d2e;
  --muted: #565470;
  --line: rgba(27, 29, 46, .14);
  --gold: #ebb95c;
  --gold-2: #f4d48f;
  --gold-deep: #8a5d0e;
  --on-night: #f1edf9;
  --on-night-muted: #bdb9da;
  --line-night: rgba(255, 255, 255, .14);
  --error: #a8322a;
  --focus: #3442b8;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(80px, 10vw, 144px);
  --radius: 6px;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --header-h: 76px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(16px, 0.25vw + 15.2px, 17.5px);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--cream);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 400; line-height: 1.1; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
em { font-style: italic; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.sky, .site-header, .site-footer, .nav-open .site-nav { --focus: var(--gold); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--gold); color: var(--night); padding: 10px 16px; border-radius: 4px; font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }

.icon { width: 1.1em; height: 1.1em; flex: none; }

/* ---------- Type helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .8em;
  margin: 0 0 1.1rem;
  font-family: var(--sans); font-size: .76rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--gold-deep);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7; }
.eyebrow--light { color: var(--gold); }

.section-title {
  font-size: clamp(2.15rem, 4.4vw, 3.75rem);
  font-weight: 380; letter-spacing: -.015em; line-height: 1.04;
}
.section-title em { color: var(--gold-deep); font-weight: 340; }
.sky .section-title em, .sky h1 em { color: var(--gold); }
.section-title--sm { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 1.25rem; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 40px;
  flex-wrap: wrap; margin-bottom: clamp(36px, 5vw, 64px);
}
.section-head .eyebrow { margin-bottom: .9rem; }

/* ---------- Buttons & links ---------- */
.btn {
  --b-bg: var(--night); --b-fg: var(--cream); --b-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: .85em 1.65em;
  font: 600 .95rem/1.2 var(--sans); letter-spacing: .02em; text-decoration: none;
  color: var(--b-fg); background: var(--b-bg); border: 1px solid var(--b-bd); border-radius: 999px;
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease), border-color .3s;
}
.btn .icon { transition: transform .35s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:hover .icon { transform: translateX(4px); }
.btn--gold { --b-bg: var(--gold); --b-fg: var(--night); }
.btn--gold:hover { --b-bg: var(--gold-2); }
.btn--ghost { --b-bg: transparent; --b-fg: var(--on-night); --b-bd: rgba(255, 255, 255, .34); }
.btn--ghost:hover { --b-bg: rgba(255, 255, 255, .08); --b-bd: rgba(255, 255, 255, .6); }
.btn--night:hover { --b-bg: var(--night-3); }
.btn--sm { min-height: 42px; padding: .6em 1.3em; font-size: .88rem; }
.btn[disabled] { opacity: .65; pointer-events: none; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .45em;
  font-weight: 600; font-size: .92rem; text-decoration: none; color: var(--ink);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 2px; transition: background-size .4s var(--ease);
}
.link-arrow:hover { background-size: 100% 1px; }
.link-arrow .icon { transition: transform .35s var(--ease); }
.link-arrow:hover .icon { transform: translateX(4px); }
.link-arrow--lg { font-size: 1rem; }

/* ---------- Night sky backgrounds ---------- */
.sky {
  position: relative; isolation: isolate; overflow: hidden;
  color: var(--on-night);
  background:
    radial-gradient(ellipse 70% 60% at 78% 18%, rgba(66, 76, 160, .55), transparent 70%),
    radial-gradient(ellipse 60% 50% at 10% 100%, rgba(120, 82, 140, .28), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
}
.stars {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 22px 34px, rgba(255,255,255,.9) 50%, transparent 52%),
    radial-gradient(1px 1px at 140px 90px, rgba(255,255,255,.7) 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 210px 180px, rgba(255,240,200,.9) 50%, transparent 52%),
    radial-gradient(1px 1px at 80px 220px, rgba(255,255,255,.6) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 300px 40px, rgba(255,255,255,.8) 50%, transparent 52%),
    radial-gradient(1px 1px at 330px 260px, rgba(255,255,255,.55) 50%, transparent 52%);
  background-size: 360px 300px;
  animation: twinkle 6s ease-in-out infinite alternate;
}
.stars::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 60px 120px, rgba(255,255,255,.8) 50%, transparent 52%),
    radial-gradient(1.8px 1.8px at 180px 30px, rgba(255,232,180,.85) 50%, transparent 52%),
    radial-gradient(1px 1px at 250px 210px, rgba(255,255,255,.65) 50%, transparent 52%);
  background-size: 290px 250px;
  animation: twinkle 4.5s ease-in-out -2s infinite alternate;
}
.stars--soft { opacity: .55; }
@keyframes twinkle { from { opacity: .45; } to { opacity: 1; } }

.moon {
  position: absolute; z-index: -1; pointer-events: none;
  width: clamp(140px, 18vw, 260px); aspect-ratio: 1; border-radius: 50%;
  right: clamp(-40px, 4vw, 90px); top: clamp(90px, 14vh, 150px);
  background: radial-gradient(circle at 38% 36%, #fff8e3 0%, #f5dea2 45%, #e3b866 100%);
  box-shadow: 0 0 60px 10px rgba(235, 185, 92, .28), 0 0 180px 60px rgba(235, 185, 92, .12);
  opacity: .9;
}
.moon::after { /* crater shading */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 62% 58%, rgba(196, 150, 70, .25) 0 9%, transparent 10%),
    radial-gradient(circle at 40% 70%, rgba(196, 150, 70, .2) 0 6%, transparent 7%),
    radial-gradient(circle at 70% 30%, rgba(196, 150, 70, .18) 0 5%, transparent 6%);
}
.moon--small { width: clamp(90px, 10vw, 140px); right: 8%; top: 18%; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
  color: var(--on-night);
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease), transform .4s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(18, 22, 51, .9);
  box-shadow: 0 1px 0 var(--line-night), 0 10px 30px rgba(8, 10, 30, .25);
}
@supports (backdrop-filter: blur(8px)) {
  .site-header.is-scrolled { background: rgba(18, 22, 51, .93); backdrop-filter: blur(12px) saturate(1.2); }
}
.site-header__inner {
  height: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.wordmark {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--serif); font-size: 1.5rem; font-weight: 420; letter-spacing: -.01em;
  text-decoration: none; color: inherit; white-space: nowrap;
}
.wordmark em { color: var(--gold); font-weight: 360; }
.wordmark__moon { width: 1.05rem; height: 1.05rem; color: var(--gold); transform: rotate(-20deg); }
.wordmark--lg { font-size: 2rem; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul:first-child { display: flex; gap: 30px; }
.site-nav ul:first-child a {
  position: relative; display: inline-block; padding-block: 8px;
  font-size: .94rem; font-weight: 500; letter-spacing: .02em; text-decoration: none; color: var(--on-night);
}
.site-nav ul:first-child a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease);
}
.site-nav ul:first-child a:hover::after,
.site-nav ul:first-child a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.site-nav__social { display: flex; gap: 6px; }
.site-nav__social a {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: var(--on-night-muted); transition: color .3s, background-color .3s;
}
.site-nav__social a:hover { color: var(--night); background: var(--gold); }
.site-nav__social .icon { width: 18px; height: 18px; }

.nav-toggle {
  display: none; position: relative; z-index: 2;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line-night); background: transparent; color: var(--on-night);
}
.nav-toggle__bars { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; }
.nav-toggle__bars span { display: block; width: 18px; height: 1.5px; background: currentColor; transition: transform .4s var(--ease); }
.nav-open .nav-toggle__bars span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav-open .nav-toggle__bars span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

@media (max-width: 1023.98px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; inset: 0; z-index: 1;
    flex-direction: column; justify-content: center; align-items: flex-start; gap: 36px;
    padding: calc(var(--header-h) + 24px) var(--gutter) 40px;
    background:
      radial-gradient(ellipse 80% 50% at 80% 10%, rgba(66, 76, 160, .5), transparent 70%),
      var(--night);
    visibility: hidden; opacity: 0;
    transition: opacity .4s var(--ease), visibility 0s linear .4s;
    overflow-y: auto;
  }
  .nav-open .site-nav { visibility: visible; opacity: 1; transition: opacity .4s var(--ease); }
  .site-nav ul:first-child { flex-direction: column; gap: 6px; }
  .site-nav ul:first-child a { font-family: var(--serif); font-size: clamp(2rem, 8vw, 2.8rem); font-weight: 360; letter-spacing: -.01em; }
  .site-nav ul:first-child a::after { bottom: 6px; }
  .nav-open { overflow: hidden; }
  .nav-open .site-header { background: transparent; box-shadow: none; backdrop-filter: none; }
}

/* ---------- Cover frames ---------- */
.cover-frame {
  display: block; aspect-ratio: 2560 / 2188;
}
.cover-frame picture, .cover-frame img { width: 100%; height: 100%; }
.cover-frame img {
  object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(18, 16, 40, .22)) drop-shadow(0 3px 6px rgba(18, 16, 40, .12));
}
.cover-frame--glow img {
  filter: drop-shadow(0 24px 40px rgba(4, 6, 24, .55)) drop-shadow(0 0 40px rgba(235, 185, 92, .12));
}

/* ---------- Hero ---------- */
.hero {
  min-height: max(680px, 100svh);
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--header-h) + 48px) 0 96px;
}
.hero__grid { display: grid; grid-template-columns: 1.12fr .88fr; align-items: center; gap: clamp(32px, 5vw, 72px); }
.hero__title {
  font-size: clamp(2.6rem, 5.2vw, 4.9rem); font-weight: 340; line-height: 1.0; letter-spacing: -.025em;
  margin-bottom: clamp(20px, 2.5vw, 32px);
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.hero__title .line > span { display: inline-block; }
.hero__title em { color: var(--gold); font-weight: 300; }
.hero__intro { max-width: 33rem; font-size: clamp(1.02rem, 1.1vw, 1.15rem); color: var(--on-night-muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(24px, 3vw, 36px); }
.hero__actions--center { justify-content: center; }

.hero__books { position: relative; height: clamp(320px, 40vw, 540px); }
.hero__book {
  position: absolute; display: block;
  transition: transform .6s var(--ease);
}
/* The real covers are already angled 3D mockups with transparent padding, so no extra tilt. */
.hero__book--1 { left: -4%; top: 20%; width: 60%; z-index: 1; }
.hero__book--2 { left: 18%; top: -2%; width: 68%; z-index: 3; }
.hero__book--3 { right: -4%; top: 26%; width: 58%; z-index: 2; }
.hero__book:hover { transform: translateY(-10px); }
.hero__book:focus-visible { outline-offset: 8px; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; translate: -50% 0;
  width: 26px; height: 42px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 20px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 9px; width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 2px; background: var(--gold); animation: cue 2s var(--ease) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 80% { opacity: 0; transform: translateY(14px); } 100% { opacity: 0; } }

@media (max-width: 899.98px) {
  .hero { min-height: auto; padding-bottom: 72px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__books { height: clamp(260px, 64vw, 440px); max-width: 560px; width: 100%; margin-inline: auto; }
  .scroll-cue { display: none; }
  .hero .moon { top: auto; bottom: clamp(200px, 52vw, 360px); right: -36px; width: clamp(110px, 30vw, 170px); opacity: .75; }
}

/* ---------- Shelf (all covers) ---------- */
.shelf {
  position: relative; overflow: hidden; padding-block: clamp(36px, 5vw, 56px);
  background: var(--paper); border-bottom: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.shelf__track { display: flex; overflow-x: auto; scrollbar-width: none; padding-inline: var(--gutter); }
.shelf__track::-webkit-scrollbar { display: none; }
.shelf__list { display: flex; gap: clamp(18px, 2.4vw, 32px); padding-right: clamp(18px, 2.4vw, 32px); }
.shelf__list li { width: clamp(120px, 13vw, 190px); flex: none; }
.shelf__list a { display: block; transition: transform .4s var(--ease); }
.shelf__list a:hover { transform: translateY(-6px); }
.shelf:not(.is-marquee) .shelf__list[aria-hidden="true"] { display: none; }
.shelf.is-marquee .shelf__track { overflow: visible; width: max-content; padding-inline: 0; }

/* ---------- About author ---------- */
.about__grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(40px, 7vw, 110px); align-items: start; }
.about__portrait { position: sticky; top: calc(var(--header-h) + 32px); margin: 0; }
.about__image {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius);
  background: var(--sand);
}
.about__image img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.about__image picture { height: 100%; }
.about__portrait::before {
  content: ""; position: absolute; inset: 22px -22px -22px 22px; z-index: -1;
  border: 1px solid rgba(138, 93, 14, .35); border-radius: var(--radius);
}
.about__portrait figcaption {
  display: flex; align-items: center; gap: .5rem; margin-top: 40px;
  font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--muted);
}
.about__portrait figcaption .icon { color: var(--gold-deep); width: 14px; height: 14px; }
.about__lead {
  margin: 1.6rem 0 1.4rem; font-family: var(--serif); font-size: clamp(1.3rem, 1.9vw, 1.6rem);
  font-weight: 380; line-height: 1.42; color: var(--ink);
}
.about__bio { max-width: 40rem; color: var(--muted); }
.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px;
  margin: 2.4rem 0 0; padding-top: 2rem; border-top: 1px solid var(--line); max-width: 40rem;
}
.facts dt { font-family: var(--serif); font-size: clamp(2.4rem, 4vw, 3.3rem); line-height: 1; color: var(--gold-deep); font-weight: 340; }
.facts dd { margin: .5rem 0 0; font-size: .9rem; color: var(--muted); max-width: 16rem; }

@media (max-width: 899.98px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { position: relative; top: 0; max-width: 460px; margin-right: 22px; }
}

/* ---------- About the books ---------- */
.about-books { background: var(--paper); border-block: 1px solid var(--line); }
.about-books__head { max-width: 50rem; margin: 0 auto clamp(48px, 6vw, 80px); text-align: center; }
.about-books__head .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7; }
.about-books__intro { margin-top: 1.5rem; font-size: 1.08rem; color: var(--muted); }
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); counter-reset: none; }
.pillar { padding-top: 28px; border-top: 1px solid var(--ink); }
.pillar__num { display: block; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 3.4rem; line-height: 1; color: var(--gold-deep); margin-bottom: 1.2rem; }
.pillar__title { font-size: 1.55rem; margin-bottom: .75rem; }
.pillar p { color: var(--muted); margin: 0; }
@media (max-width: 799.98px) { .pillars { grid-template-columns: 1fr; } }

/* ---------- Book grid / cards ---------- */
.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(36px, 4vw, 56px) clamp(18px, 2.6vw, 36px); }
.book-card { display: flex; flex-direction: column; }
.book-card__cover {
  display: block; padding: clamp(14px, 1.6vw, 22px);
  border-radius: var(--radius);
  background: linear-gradient(170deg, var(--paper) 0%, var(--sand) 100%);
  box-shadow: inset 0 0 0 1px rgba(27, 29, 46, .06);
  transition: background-color .4s;
}
.book-card__cover img { transition: transform .6s var(--ease); }
.book-card:hover .book-card__cover img { transform: translateY(-6px) scale(1.015); }
.book-card__body { display: flex; flex-direction: column; flex: 1; padding-top: 18px; }
.book-card__age { margin: 0 0 .4rem; font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); }
.book-card__title { font-size: clamp(1.12rem, 1.4vw, 1.3rem); font-weight: 450; line-height: 1.22; margin-bottom: .6rem; }
.book-card__title a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .45s var(--ease); }
.book-card__title a:hover { background-size: 100% 1px; }
.book-card__text { font-size: .92rem; color: var(--muted); margin-bottom: 1rem; }
.book-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: auto; }
.link-buy {
  font-size: .85rem; font-weight: 600; color: var(--gold-deep);
  text-decoration: underline; text-decoration-color: rgba(138, 93, 14, .35);
}
.link-buy:hover { text-decoration-color: currentColor; }
.book-card .link-arrow { font-size: .85rem; min-height: 32px; }
.book-card .link-buy { min-height: 32px; display: inline-flex; align-items: center; }

@media (max-width: 1099.98px) { .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 699.98px) { .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .book-card__text { display: none; } }

/* ---------- Library page ---------- */
.library__tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: clamp(32px, 4vw, 56px); }
.search {
  position: relative; display: flex; align-items: center; width: min(100%, 400px);
}
.search .icon { position: absolute; left: 18px; color: var(--muted); }
.search input {
  width: 100%; min-height: 52px; padding: 12px 20px 12px 48px;
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid rgba(27, 29, 46, .2); border-radius: 999px;
}
.search input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(52, 66, 184, .2); }
.library__count { margin: 0; font-size: .9rem; color: var(--muted); }
.library__empty { padding: 48px 0; text-align: center; color: var(--muted); }
.book-card[hidden] { display: none; }

/* ---------- Page hero ---------- */
.page-hero { padding: calc(var(--header-h) + clamp(56px, 8vw, 104px)) 0 clamp(64px, 8vw, 104px); }
.page-hero__title { font-size: clamp(2.6rem, 6.4vw, 5.4rem); font-weight: 340; line-height: 1; letter-spacing: -.025em; margin: 1.2rem 0 1.4rem; }
.page-hero__title em { color: var(--gold); font-weight: 300; }
.page-hero__intro { max-width: 40rem; font-size: 1.1rem; color: var(--on-night-muted); margin: 0; }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .84rem; color: var(--on-night-muted); }
.crumbs li + li::before { content: "/"; margin-right: 10px; opacity: .5; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--on-night); text-decoration: underline; }
.crumbs [aria-current] { color: var(--on-night); }

/* ---------- Book detail ---------- */
.book-hero { padding: calc(var(--header-h) + 40px) 0 clamp(64px, 8vw, 110px); }
.book-hero__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 88px); align-items: center; margin-top: clamp(28px, 4vw, 48px); }
.book-hero__title { font-size: clamp(2.2rem, 4.4vw, 3.8rem); font-weight: 360; line-height: 1.04; letter-spacing: -.02em; margin-bottom: 1.2rem; }
.book-hero__desc { font-size: 1.08rem; color: var(--on-night-muted); max-width: 36rem; margin: 1.4rem 0 0; }
.chip {
  display: inline-block; margin: 0; padding: .4em 1em; border: 1px solid rgba(235, 185, 92, .55); border-radius: 999px;
  font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold);
}
@media (max-width: 899.98px) { .book-hero__grid { grid-template-columns: 1fr; } .book-hero__cover { max-width: 560px; } }

.book-pager { display: flex; justify-content: space-between; gap: 16px; padding-block: 28px; border-bottom: 1px solid var(--line); }
.book-pager__link {
  display: inline-flex; align-items: center; gap: 14px; max-width: 46%;
  text-decoration: none; font-family: var(--serif); font-size: 1.05rem; line-height: 1.25;
}
.book-pager__link small { display: block; margin-bottom: 2px; font-family: var(--sans); font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); }
.book-pager__link--next { text-align: right; margin-left: auto; }
.book-pager__link .icon { flex: none; width: 22px; height: 22px; transition: transform .35s var(--ease); }
.book-pager__link:hover .icon { transform: translateX(-4px); }
.book-pager__link--next:hover .icon { transform: translateX(4px); }

/* ---------- Testimonials ---------- */
.testimonials .section-head { margin-bottom: clamp(32px, 4vw, 48px); }
.carousel-controls { display: flex; gap: 12px; }
.round-btn {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  color: var(--on-night); background: transparent; border: 1px solid var(--line-night);
  transition: background-color .3s, color .3s, border-color .3s;
}
.round-btn:hover { background: var(--gold); color: var(--night); border-color: var(--gold); }
.round-btn .icon { width: 20px; height: 20px; }
.carousel {
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  --edge: max(var(--gutter), calc((100vw - var(--container)) / 2));
  scroll-padding-inline: var(--edge);
}
.carousel::-webkit-scrollbar { display: none; }
.carousel:focus-visible { outline-offset: -3px; }
.carousel__track { display: flex; gap: clamp(16px, 2vw, 28px); padding-inline: var(--edge); width: max-content; }
.quote-card {
  scroll-snap-align: start;
  display: flex; flex-direction: column; width: min(440px, 82vw);
  padding: clamp(26px, 3vw, 40px);
  background: rgba(255, 255, 255, .045); border: 1px solid var(--line-night); border-radius: var(--radius);
}
.quote-card__stars { display: flex; gap: 4px; color: var(--gold); margin-bottom: 1.4rem; }
.quote-card__stars .icon { width: 16px; height: 16px; }
.quote-card blockquote { margin: 0 0 1.6rem; }
.quote-card blockquote p { font-family: var(--serif); font-size: clamp(1.15rem, 1.6vw, 1.38rem); font-weight: 360; line-height: 1.45; margin: 0; }
.quote-card__name { margin: auto 0 0; font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--on-night-muted); }

/* ---------- Contact ---------- */
.contact-band__grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(36px, 6vw, 96px); align-items: start; }
.contact-band__copy > p { color: var(--muted); max-width: 30rem; }
.contact-band__aside { margin-top: 2rem; font-size: .95rem; }
.contact-band__aside a { color: var(--ink); }
.contact-list { display: grid; gap: 14px; margin-top: 2rem; }
.contact-list li { display: flex; align-items: center; gap: 14px; }
.contact-list .icon { width: 20px; height: 20px; color: var(--gold-deep); }
.contact-list a { text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.contact-list a:hover { text-decoration: underline; }
.contact-band__form {
  padding: clamp(24px, 4vw, 52px); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 30px 60px -40px rgba(18, 22, 51, .35);
}
@media (max-width: 899.98px) { .contact-band__grid { grid-template-columns: 1fr; } }

.contact-form { display: grid; gap: 22px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 599.98px) { .field-row { grid-template-columns: 1fr; } }
.field label { display: block; margin-bottom: 8px; font-size: .88rem; font-weight: 600; }
.field label span[aria-hidden] { color: var(--gold-deep); }
.field__opt { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 13px 16px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid rgba(27, 29, 46, .22); border-radius: 4px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(52, 66, 184, .2); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field__error { margin: 8px 0 0; font-size: .86rem; color: var(--error); }
.form-alert { padding: 14px 18px; border-left: 3px solid var(--error); background: #fbeceb; color: #6e1f19; font-size: .95rem; border-radius: 0 4px 4px 0; }
.contact-form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.contact-form__note { margin: 0; font-size: .84rem; color: var(--muted); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--sand); }
.cta-band__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.cta-band__title { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 380; }

/* ---------- Thank you / 404 ---------- */
.thanks { min-height: max(560px, 86svh); display: flex; align-items: center; padding: calc(var(--header-h) + 40px) 0 80px; text-align: center; }
.thanks__inner { display: flex; flex-direction: column; align-items: center; }
.thanks .page-hero__intro { margin-inline: auto; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; isolation: isolate; overflow: hidden;
  color: var(--on-night);
  background: radial-gradient(ellipse 60% 70% at 85% 0%, rgba(66, 76, 160, .4), transparent 70%), var(--night);
  padding: clamp(72px, 9vw, 120px) 0 32px;
}

.site-footer__top { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1.2fr; gap: 48px clamp(32px, 4vw, 64px); }
.site-footer__brand p { margin: 1.2rem 0 1.8rem; color: var(--on-night-muted); max-width: 24rem; }
.site-footer__title { margin-bottom: 1.2rem; font-family: var(--sans); font-size: .74rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.site-footer__col ul { display: grid; gap: 4px; }
.site-footer__col a { display: inline-block; padding-block: 6px; color: var(--on-night-muted); text-decoration: none; font-size: .95rem; transition: color .25s; }
.site-footer__col a:hover { color: var(--on-night); text-decoration: underline; }
.site-footer__mail { display: inline-flex !important; align-items: center; gap: 10px; color: var(--on-night) !important; overflow-wrap: anywhere; }
.site-footer__mail .icon { color: var(--gold); width: 18px; height: 18px; }
.social-row { display: flex !important; flex-wrap: wrap; gap: 10px !important; margin-top: 10px; }
.social-row a {
  display: inline-flex !important; align-items: center; gap: 8px; padding: 8px 16px !important;
  border: 1px solid var(--line-night); border-radius: 999px; font-size: .88rem !important;
}
.social-row a:hover { border-color: var(--gold); text-decoration: none !important; }
.social-row .icon { width: 16px; height: 16px; }
.site-footer__bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  margin-top: clamp(56px, 7vw, 88px); padding-top: 24px; border-top: 1px solid var(--line-night);
  font-size: .84rem; color: var(--on-night-muted);
}
.site-footer__bottom p { margin: 0; }
.site-footer__note { font-family: var(--serif); font-style: italic; }
@media (max-width: 999.98px) { .site-footer__top { grid-template-columns: 1fr 1fr; } .site-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 519.98px) { .site-footer__top { grid-template-columns: 1fr; } }

/* ---------- Animation helpers ---------- */
/* Content is fully visible by default; GSAP only animates from offsets when it runs. */
.js-anim [data-reveal-image] { clip-path: inset(0 0 0 0); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .stars, .stars::after { opacity: .8; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .shelf, .carousel-controls, .scroll-cue, .contact-band__form { display: none !important; }
  .sky { background: none !important; color: #000 !important; }
}
