/* =========================================================================
   Homepage sections
   ========================================================================= */

/* ---------- 1. Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; isolation: isolate;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 1rem) 0 5rem;
  background: radial-gradient(70% 60% at 50% 0%, rgba(44, 53, 68, 0.55), transparent 70%), var(--night);
}
.glow--hero {
  width: 75vw; height: 75vw; max-width: 1200px; max-height: 1200px; right: -22vw; bottom: -38vw;
  background: radial-gradient(circle, rgba(224, 120, 47, 0.8), rgba(216, 165, 72, 0.4) 40%, transparent 68%);
  opacity: 0.6; animation: drift 24s ease-in-out infinite alternate;
}
.glow--hero-2 {
  width: 40vw; height: 40vw; right: 10vw; bottom: -8vw;
  background: radial-gradient(circle, rgba(243, 201, 105, 0.55), transparent 65%);
  opacity: 0.35; animation: drift 18s ease-in-out infinite alternate-reverse;
}
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(1rem, 4vw, 4rem); }
.hero__title {
  font: 700 var(--fs-hero) var(--font-display); line-height: 0.95; letter-spacing: 0.01em;
  margin: 0.2rem 0 1.2rem; padding-bottom: 0.06em; white-space: nowrap;
}
.hero__subtitle { font: 500 clamp(1.35rem, 2.3vw, 2rem) var(--font-serif); line-height: 1.25; color: var(--cream); max-width: 24ch; }
.hero__byline { margin-top: 1rem; font: 500 0.9rem var(--font-ui); letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.hero__byline span { color: var(--gold-bright); }
.hero__support { margin-top: 1.6rem; max-width: 44ch; color: rgba(248, 243, 232, 0.86); font-size: var(--fs-body); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }
.hero__book { position: relative; height: min(78vh, 760px); min-height: 460px; }
.hero__book .book3d { position: absolute; inset: 0; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.4rem; z-index: 2; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem; min-height: 44px;
  font: 600 0.7rem var(--font-ui); letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted);
}
.scroll-cue__line { position: relative; width: 1px; height: 54px; background: rgba(216, 165, 72, 0.3); overflow: hidden; }
.scroll-cue__dot { position: absolute; left: -2px; top: -6px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 10px var(--gold); animation: cue 2.2s var(--ease-in-out) infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(64px); opacity: 0; } }

@media (max-width: 959px) {
  .hero { align-items: flex-start; padding-top: calc(var(--nav-h) + 0.5rem); padding-bottom: 6rem; }
  .hero__grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .hero__book { order: -1; height: 55vh; height: 55svh; min-height: 340px; }
  .hero__text { text-align: center; display: flex; flex-direction: column; align-items: center; }
  .hero__subtitle, .hero__support { margin-inline: auto; }
  .hero__actions { justify-content: center; }
}
@media (max-width: 479px) {
  .hero__actions { flex-direction: column; width: 100%; }
  .hero__actions .btn { width: 100%; }
  .hero__title { white-space: normal; }
}

/* ---------- 2. Marquee ---------- */
.marquee {
  position: relative; overflow: hidden; background: var(--night);
  border-block: 1px solid rgba(216, 165, 72, 0.5);
  padding-block: clamp(1.2rem, 2.4vw, 2rem);
}
.marquee::before, .marquee::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: rgba(216, 165, 72, 0.22); }
.marquee::before { top: 5px; }
.marquee::after { bottom: 5px; }
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__group { display: flex; align-items: center; flex: none; }
.marquee__word {
  font: 600 clamp(2rem, 5.5vw, 4.6rem) var(--font-display); letter-spacing: 0.08em; line-height: 1.1;
  color: transparent; -webkit-text-stroke: 1px rgba(216, 165, 72, 0.75);
  padding-inline: clamp(1rem, 2.2vw, 2rem); transition: color 0.4s, -webkit-text-stroke-color 0.4s;
}
.marquee__word:nth-child(4n + 1) { color: var(--gold); -webkit-text-stroke-color: transparent; }
.marquee:hover .marquee__word { -webkit-text-stroke-color: var(--gold-bright); }
.marquee__star { font-size: clamp(1rem, 2vw, 1.6rem); color: var(--ember); }

/* ---------- 3. Intro ---------- */
.intro { overflow: hidden; }
.intro__grid { display: grid; grid-template-columns: 0.85fr 1fr; gap: clamp(3rem, 7vw, 7rem); align-items: center; }
.intro .arch { max-width: 460px; width: 100%; justify-self: center; }
.intro__text .lead { margin-bottom: 2rem; }
@media (max-width: 959px) {
  .intro__grid { grid-template-columns: 1fr; }
  .intro .arch { max-width: 360px; }
}

/* ---------- 4. Stats ---------- */
.stats { background: radial-gradient(60% 80% at 10% 0%, rgba(44, 53, 68, 0.6), transparent 70%), var(--night); }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 2vw, 1.6rem); margin-top: clamp(2.5rem, 5vw, 4rem); }
.stat { padding: clamp(1.8rem, 3vw, 2.6rem) clamp(1.2rem, 2vw, 1.8rem); text-align: center; }
.stat__value {
  font: 700 clamp(3rem, 6vw, 5.2rem) var(--font-display); line-height: 1; color: var(--gold-bright);
  font-variant-numeric: tabular-nums; display: inline-flex; align-items: flex-start;
}
.stat__value sup { font-size: 0.38em; margin-left: 0.08em; margin-top: 0.3em; color: var(--gold); }
.stat__label { margin-top: 1rem; font: 500 0.82rem var(--font-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); line-height: 1.5; }
@media (max-width: 959px) { .stats__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 419px) { .stats__grid { grid-template-columns: 1fr; } }

/* ---------- 5. The L.O.V.E. principle ---------- */
.principle { position: relative; background: linear-gradient(180deg, var(--night), #121824 50%, var(--night)); overflow: hidden; }
.principle__pin { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: calc(var(--nav-h) + 1rem) 2rem; }
.principle__head { margin-bottom: clamp(1rem, 3vh, 2.4rem); }
.principle__head .section-title { margin-bottom: 0; }
.principle__track { display: flex; width: max-content; will-change: transform; }
.principle__panel {
  width: 100vw; flex: none; padding-inline: var(--gutter);
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 5vw, 5rem);
  max-width: none;
}
.principle__panel > * { max-width: 620px; }
.principle__letter { position: relative; justify-self: end; font: 700 clamp(14rem, 40vh, 26rem) var(--font-display); line-height: 0.8; }
.principle__letter-outline { display: block; color: transparent; -webkit-text-stroke: 1.5px rgba(216, 165, 72, 0.6); }
.principle__letter-fill { position: absolute; inset: 0; clip-path: inset(100% 0 0 0); transition: none; }
.principle__panel:hover .principle__letter-fill { clip-path: inset(0 0 0 0) !important; }
.principle__chapter { font: 600 var(--fs-label) var(--font-ui); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.8rem; }
.principle__word { font: 700 clamp(2.4rem, 5vw, 4.4rem) var(--font-display); letter-spacing: 0.06em; line-height: 1; margin-bottom: 1.2rem; }
.principle__word .principle__sub { display: block; margin-top: 0.7rem; font: italic 400 clamp(1.3rem, 2vw, 1.8rem) var(--font-serif); letter-spacing: 0; color: var(--gold-bright); }
.principle__short { color: rgba(248, 243, 232, 0.88); margin-bottom: 1.4rem; max-width: 50ch; }
.principle__quote { border-left: 2px solid var(--gold); padding-left: 1.2rem; margin-bottom: 1.6rem; }
.principle__quote p { font: italic 400 clamp(1.2rem, 1.7vw, 1.5rem) var(--font-serif); line-height: 1.45; color: var(--cream); }
.principle__progress { display: flex; flex-direction: column-reverse; gap: 0.8rem; width: min(520px, 80vw); margin: clamp(1rem, 3vh, 2.4rem) auto 0; }
.principle__progress-bar { height: 2px; background: rgba(216, 165, 72, 0.2); position: relative; }
.principle__progress-bar span { position: absolute; inset: 0; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transform-origin: left; transform: scaleX(0); }
.principle__progress ol { display: flex; justify-content: space-between; }
.principle__progress li { font: 700 1rem var(--font-display); color: rgba(216, 165, 72, 0.4); transition: color 0.4s, transform 0.4s var(--ease); }
.principle__progress li.is-active { color: var(--gold-bright); transform: scale(1.3); }

@media (max-width: 959px) {
  .principle__pin { min-height: 0; padding-block: var(--section-y); }
  .principle__track { flex-direction: column; width: 100%; gap: clamp(4rem, 12vw, 6rem); }
  .principle__panel { width: 100%; grid-template-columns: 1fr; gap: 1rem; }
  .principle__letter { justify-self: start; font-size: clamp(9rem, 42vw, 14rem); }
  .principle__progress { display: none; }
}

/* ---------- 6. The book feature, openable CSS book ---------- */
.feature { overflow: hidden; }
.feature__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 0.9fr 1fr; gap: clamp(3rem, 7vw, 7rem); align-items: center; }
.feature__copy p { margin-bottom: 1.2rem; color: rgba(248, 243, 232, 0.88); }
.feature__copy .lead--italic { color: var(--gold-bright); }
.feature__actions { margin-top: 2rem; }
.format-pills { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.4rem; }
.feature__book { display: grid; place-items: center; min-height: 520px; }
@media (max-width: 959px) {
  .feature__grid { grid-template-columns: 1fr; }
  .feature__book { min-height: 440px; }
}

.openbook {
  --bw: clamp(200px, 24vw, 300px); --bh: calc(var(--bw) * 1.5); --bd: calc(var(--bw) * 0.15);
  position: relative; width: var(--bw); height: var(--bh); perspective: 2000px;
  border-radius: 6px; outline-offset: 20px;
  transform: translateX(-12%);
}
.openbook__rig { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(8deg) rotateY(-18deg); transition: transform 1s var(--ease); }
.openbook:hover .openbook__rig, .openbook:focus-visible .openbook__rig, .openbook.is-open .openbook__rig { transform: rotateX(10deg) rotateY(-6deg) translateX(18%); }
.openbook__back { position: absolute; inset: 0; transform: translateZ(calc(var(--bd) / -2)); background: #1B2330; border-radius: 4px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8); }
.openbook__pages {
  position: absolute; top: 1.5%; bottom: 1.5%; left: 0; right: 2%;
  transform: translateZ(calc(var(--bd) / -2 + 2px));
  background: repeating-linear-gradient(90deg, #EDE4CF 0 1px, #DDD0B4 1px 2px);
  border-radius: 2px 4px 4px 2px;
  box-shadow: inset 0 0 0 1px rgba(90, 59, 36, 0.15);
}
.openbook__page {
  position: absolute; top: 1.5%; bottom: 1.5%; left: 0; right: 2%;
  transform: translateZ(calc(var(--bd) / 2 - 3px));
  background: linear-gradient(90deg, #E8DEC6, #F6F0E2 12%, #F8F3E8);
  color: var(--ink); border-radius: 2px 4px 4px 2px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 18% 11% 10%;
}
.openbook__page-chapter { font: 600 0.62rem var(--font-ui); letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-ink); }
.openbook__page-rule { display: block; width: 36px; height: 1px; background: var(--gold); margin: 0.9rem 0; }
.openbook__page-title { font: 600 clamp(0.95rem, 1.6vw, 1.3rem) var(--font-display); line-height: 1.25; margin-bottom: 1.2rem; }
.openbook__page-text { font: 400 clamp(0.82rem, 1.05vw, 0.98rem) var(--font-serif); line-height: 1.55; text-align: left; }
.openbook__dropcap { float: left; font: 700 2.8em var(--font-display); line-height: 0.85; margin: 0.05em 0.1em 0 0; color: var(--gold-ink); }
.openbook__page-emblem { margin-top: auto; color: var(--harvest); }
.openbook__cover {
  position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: left center;
  transform: translateZ(calc(var(--bd) / 2)); transition: transform 1.2s var(--ease);
}
.openbook:hover .openbook__cover, .openbook:focus-visible .openbook__cover, .openbook.is-open .openbook__cover { transform: translateZ(calc(var(--bd) / 2)) rotateY(-150deg); }
.openbook__cover-front, .openbook__cover-inside { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 2px 5px 5px 2px; overflow: hidden; }
.openbook__cover-front img { width: 100%; height: 100%; object-fit: cover; }
.openbook__cover-front { box-shadow: inset 4px 0 10px rgba(0, 0, 0, 0.4); }
.openbook__cover-inside {
  transform: rotateY(180deg); background: linear-gradient(90deg, #151b26, var(--storm));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem;
  border-radius: 5px 2px 2px 5px;
}
.openbook__inside-mark { font: 700 1.6rem var(--font-display); color: var(--gold); letter-spacing: 0.06em; }
.openbook__inside-line { font: italic 400 0.9rem var(--font-serif); color: var(--muted); }
.openbook__shadow { position: absolute; left: -10%; right: -30%; bottom: -10%; height: 12%; background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.6), transparent 70%); filter: blur(10px); z-index: -1; }

/* ---------- 8. Big pull quote ---------- */
.bigquote { position: relative; overflow: hidden; isolation: isolate; padding-block: clamp(8rem, 18vw, 14rem); text-align: center; background: var(--night); }
.bigquote__bg {
  position: absolute; inset: -10%; z-index: -1;
  background:
    radial-gradient(50% 60% at 30% 70%, rgba(224, 120, 47, 0.55), transparent 70%),
    radial-gradient(40% 50% at 75% 35%, rgba(243, 201, 105, 0.4), transparent 70%),
    radial-gradient(80% 60% at 50% 100%, rgba(90, 59, 36, 0.8), transparent 70%),
    linear-gradient(180deg, #121826, #1B2330 60%, #2a2320);
  filter: blur(30px) saturate(1.1);
}
.bigquote::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(100% 90% at 50% 50%, transparent 40%, rgba(14, 18, 25, 0.7)); }
.bigquote__text { font: italic 400 clamp(2.4rem, 6.6vw, 6rem) var(--font-serif); line-height: 1.12; max-width: 18ch; margin-inline: auto; text-wrap: balance; }
.bigquote__text .word { will-change: opacity; }
.bigquote__cite { margin-top: 2.4rem; font: 600 0.85rem var(--font-ui); letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-bright); }
.bigquote__cite cite { font-style: normal; }

/* ---------- 9. Excerpt teaser ---------- */
.teaser__grid { display: grid; grid-template-columns: 0.8fr 1fr; gap: clamp(3rem, 6vw, 6rem); align-items: center; }
.bookpage {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  max-height: 640px; padding: clamp(2rem, 4vw, 3.4rem) clamp(1.6rem, 4vw, 3.4rem) 1.6rem;
  background: linear-gradient(90deg, #E9DFC8, #F8F3E8 6%, #F8F3E8 94%, #EFE6D2);
  color: var(--ink); border-radius: 4px 14px 14px 4px;
  box-shadow: 0 1px 0 rgba(90, 59, 36, 0.2), 0 40px 80px -40px rgba(90, 59, 36, 0.6), inset 0 0 0 1px rgba(90, 59, 36, 0.12);
  transition: translate 0.7s var(--ease), rotate 0.7s var(--ease), box-shadow 0.7s var(--ease);
}
.bookpage:hover { translate: 0 -6px; rotate: -0.4deg; box-shadow: 0 1px 0 rgba(90, 59, 36, 0.2), 0 50px 90px -40px rgba(90, 59, 36, 0.7), inset 0 0 0 1px rgba(185, 138, 62, 0.45); }
.bookpage__chapter { font: 600 0.72rem var(--font-ui); letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-ink); text-align: center; }
.bookpage__title { font: 600 clamp(1.3rem, 2.2vw, 1.8rem) var(--font-display); text-align: center; margin: 0.8rem 0 1.8rem; line-height: 1.2; }
.bookpage__body { display: block; font-size: clamp(1.08rem, 1.2vw, 1.22rem); line-height: 1.7; }
.bookpage__p { display: block; margin-bottom: 1rem; text-indent: 1.5em; }
.bookpage__p--first { text-indent: 0; }
.bookpage__p--first::first-letter { float: left; font: 700 3.6em var(--font-display); line-height: 0.82; margin: 0.08em 0.12em 0 0; color: var(--gold-ink); }
.bookpage__fade { position: absolute; left: 0; right: 0; bottom: 0; height: 58%; background: linear-gradient(transparent, #F8F3E8 62%); pointer-events: none; }
.bookpage__footer { position: absolute; left: 0; right: 0; bottom: 1.6rem; display: flex; justify-content: center; align-items: center; }
.bookpage__num { position: absolute; right: 1.6rem; bottom: 0.4rem; font: 500 0.85rem var(--font-display); color: var(--muted-ink); }
.bookpage__curl {
  position: absolute; right: 0; bottom: 0; width: 0; height: 0;
  background: linear-gradient(315deg, var(--paper) 45%, #D9CCB0 50%, #F4EDDC 56%, #fff 80%);
  border-top-left-radius: 8px; box-shadow: -6px -6px 12px -6px rgba(90, 59, 36, 0.35);
  transition: width 0.5s var(--ease), height 0.5s var(--ease);
}
.bookpage:hover .bookpage__curl, .bookpage:focus-visible .bookpage__curl { width: 64px; height: 64px; }
@media (max-width: 959px) { .teaser__grid { grid-template-columns: 1fr; } }

/* ---------- 10. Chapter list ---------- */
.chapters { overflow: hidden; }
.chapter-list { margin-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid rgba(216, 165, 72, 0.2); }
.chapter-row { border-bottom: 1px solid rgba(216, 165, 72, 0.2); }
.chapter-row__link {
  position: relative; display: grid; grid-template-columns: 4.5rem 1fr auto; align-items: center; gap: 1rem;
  padding-block: clamp(1.1rem, 2.4vw, 1.8rem); min-height: 44px;
  transition: padding 0.5s var(--ease);
}
.chapter-row__num { font: 600 clamp(1rem, 1.6vw, 1.3rem) var(--font-display); color: rgba(216, 165, 72, 0.45); transition: color 0.4s; }
.chapter-row__title { font: 500 clamp(1.3rem, 3vw, 2.4rem) var(--font-display); line-height: 1.2; transition: color 0.4s, transform 0.5s var(--ease); }
.chapter-row__title strong { font-weight: 700; color: var(--gold); }
.chapter-row__arrow svg { width: 28px; height: 28px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.4; transform: translateX(-10px); transition: transform 0.5s var(--ease), opacity 0.4s; }
.chapter-row__line { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--ease); }
.chapter-row__link:hover, .chapter-row__link:focus-visible { padding-block: clamp(1.5rem, 3vw, 2.4rem); }
.chapter-row__link:hover .chapter-row__num, .chapter-row__link:focus-visible .chapter-row__num { color: var(--gold-bright); }
.chapter-row__link:hover .chapter-row__title { transform: translateX(10px); color: var(--gold-bright); }
.chapter-row__link:hover .chapter-row__arrow svg { transform: translateX(0); opacity: 1; }
.chapter-row__link:hover .chapter-row__line, .chapter-row__link:focus-visible .chapter-row__line { transform: scaleX(1); }
@media (max-width: 599px) { .chapter-row__link { grid-template-columns: 2.6rem 1fr; } .chapter-row__arrow { display: none; } }

.chapter-preview { position: fixed; left: 0; top: 0; z-index: 60; width: 240px; height: 300px; pointer-events: none; opacity: 0; transform: scale(0.8); display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 960px) { .chapter-preview { display: block; } }
.chapter-preview__item {
  position: absolute; inset: 0; border-radius: 12px; overflow: hidden; opacity: 0;
  background: var(--storm); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(216, 165, 72, 0.35);
  display: grid; place-items: center; transition: opacity 0.35s;
}
.chapter-preview__item.is-active { opacity: 1; }
.chapter-preview__item picture, .chapter-preview__item img { width: 100%; height: 100%; object-fit: cover; filter: sepia(0.3) saturate(1.1); }
.chapter-preview__glyph { font: 700 9rem var(--font-display); line-height: 1; }
.chapter-preview__item:last-child .chapter-preview__glyph { font-size: 5rem; }
