@import url('fonts.css');

:root {
  /* dusk gradient palette, shared with the cover art */
  --ink-950: #0D111C;
  --ink-900: #131C33;
  --navy-800: #1B2547;
  --plum-700: #3A2F52;
  --plum-600: #4A3653;
  --rose-500: #97524A;
  --amber-500: #C97A47;
  --amber-400: #D98A4E;
  --amber-300: #E8A860;
  --gold-200: #F2D9B6;
  --cream-100: #FCF3E4;
  --cream-200: #F5E3C8;

  --paper: #FBF6EE;
  --paper-dim: #F3EADC;
  --ink-text: #2A2320;
  --ink-muted: #6B5D52;
  --hairline: rgba(42, 35, 32, 0.14);

  --serif-display: 'Playfair Display', Georgia, serif;
  --serif-body: 'EB Garamond', Georgia, serif;
  --sans: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max-w: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif-body);
  color: var(--ink-text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

a { color: inherit; text-decoration: none; }

.eyebrow {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 26px 0;
  transition: background 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease;
}
.nav.is-scrolled {
  background: rgba(251, 246, 238, 0.92);
  backdrop-filter: blur(8px);
  padding: 16px 0;
  box-shadow: 0 1px 0 var(--hairline);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__mark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-100);
  transition: color 0.35s ease;
}
.nav.is-scrolled .nav__mark { color: var(--ink-text); }
.nav__links {
  display: flex;
  gap: 40px;
  list-style: none;
}
.nav__links a {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-200);
  opacity: 0.9;
  transition: color 0.35s ease, opacity 0.2s ease;
}
.nav__links a:hover { opacity: 1; }
.nav.is-scrolled .nav__links a { color: var(--ink-muted); }
.nav.is-scrolled .nav__links a:hover { color: var(--ink-text); }
.nav__toggle {
  display: none;
  background: none;
  border: 0;
  width: 30px; height: 22px;
  position: relative;
  cursor: pointer;
}
.nav__toggle span {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--cream-100);
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.35s ease;
}
.nav.is-scrolled .nav__toggle span { background: var(--ink-text); }
.nav__toggle span:nth-child(1) { top: 0; }
.nav__toggle span:nth-child(2) { top: 10px; }
.nav__toggle span:nth-child(3) { top: 20px; }
.nav.menu-open .nav__toggle span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.nav.menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.menu-open .nav__toggle span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(180deg,
    var(--ink-900) 0%,
    var(--navy-800) 18%,
    var(--plum-700) 42%,
    var(--plum-600) 58%,
    var(--rose-500) 72%,
    var(--amber-400) 86%,
    var(--amber-300) 100%
  );
  padding: 150px 0 80px;
}
.hero__glow {
  position: absolute;
  left: 50%; bottom: -22%;
  width: 1400px; height: 1400px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at center,
    rgba(250,214,150,0.55) 0%,
    rgba(240,177,110,0.28) 30%,
    rgba(180,90,90,0) 65%
  );
  pointer-events: none;
}
.hero__stars {
  position: absolute;
  top: 0; left: 0; right: 0; height: 45%;
  pointer-events: none;
}
.hero__stars span {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.65);
}
.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.75fr;
  gap: 64px;
  align-items: center;
}
.hero__kicker {
  color: var(--gold-200);
  margin-bottom: 26px;
}
.hero__title {
  font-family: var(--serif-display);
  font-weight: 900;
  color: var(--cream-100);
  font-size: clamp(48px, 6.6vw, 92px);
  line-height: 1.04;
  text-shadow: 0 10px 40px rgba(15,8,8,0.35);
  margin-bottom: 30px;
}
.hero__subtitle {
  font-family: var(--serif-body);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.5;
  color: var(--cream-200);
  max-width: 46ch;
  margin-bottom: 48px;
}

/* countdown */
.countdown {
  margin-bottom: 46px;
}
.countdown__label {
  color: var(--gold-200);
  opacity: 0.9;
  margin-bottom: 18px;
}
.countdown__row {
  display: flex;
  gap: 18px;
}
.countdown__unit {
  background: rgba(20, 14, 20, 0.28);
  border: 1px solid rgba(245, 227, 200, 0.22);
  border-radius: 10px;
  padding: 16px 8px;
  width: 88px;
  text-align: center;
  backdrop-filter: blur(3px);
}
.countdown__num {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 38px;
  color: var(--cream-100);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown__unitlabel {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-200);
  opacity: 0.75;
  margin-top: 8px;
  display: block;
}

.btn-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 17px 30px;
  border-radius: 999px;
  display: inline-block;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  border: 1px solid transparent;
}
.btn--primary {
  background: var(--cream-100);
  color: var(--ink-900);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15,8,8,0.28); }
.btn--ghost {
  border-color: rgba(245,227,200,0.55);
  color: var(--cream-100);
}
.btn--ghost:hover { background: rgba(245,227,200,0.1); transform: translateY(-2px); }
.btn--dark {
  background: var(--ink-900);
  color: var(--cream-100);
}
.btn--dark:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15,8,8,0.28); }

/* hero book */
.hero__book {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero__book img {
  width: min(360px, 80%);
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow:
    0 30px 60px rgba(10,5,10,0.5),
    0 8px 20px rgba(10,5,10,0.35);
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(1.2deg); }
  50% { transform: translateY(-16px) rotate(1.2deg); }
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  z-index: 2;
  width: 22px; height: 36px;
  border: 1.5px solid rgba(245,227,200,0.55);
  border-radius: 14px;
}
.scroll-cue::before {
  content: '';
  position: absolute;
  left: 50%; top: 7px;
  width: 4px; height: 4px;
  background: var(--cream-100);
  border-radius: 50%;
  transform: translateX(-50%);
  animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue {
  0% { opacity: 1; top: 7px; }
  70% { opacity: 0; top: 20px; }
  100% { opacity: 0; top: 20px; }
}

/* ---------- Section shells ---------- */
section { position: relative; }
.section-pad { padding: 130px 0; }
.section-head {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 72px;
}
.section-head .eyebrow { color: var(--amber-500); margin-bottom: 18px; }
.section-head h2 {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
  color: var(--ink-text);
}
.section-head p {
  margin-top: 20px;
  font-size: 19px;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ---------- Synopsis ---------- */
.synopsis { background: var(--paper); }
.pullquote {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}
.pullquote p {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.5;
  color: var(--ink-text);
}
.pullquote cite {
  display: block;
  margin-top: 28px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.synopsis__body {
  max-width: 700px;
  margin: 56px auto 0;
  text-align: center;
  font-size: 19px;
  line-height: 1.75;
  color: var(--ink-muted);
}
.synopsis__body strong { color: var(--ink-text); font-weight: 600; }

/* ---------- What's inside ---------- */
.inside { background: var(--paper-dim); }
.inside__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
}
.inside__card {
  background: var(--paper-dim);
  padding: 40px 34px;
  transition: background 0.25s ease;
}
.inside__card:hover { background: var(--paper); }
.inside__num {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--amber-500);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  display: block;
}
.inside__card h3 {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 21px;
  color: var(--ink-text);
  margin-bottom: 12px;
  line-height: 1.3;
}
.inside__card p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-muted);
}

/* ---------- Excerpt ---------- */
.excerpt {
  background: linear-gradient(160deg, var(--ink-900) 0%, var(--navy-800) 45%, var(--plum-700) 100%);
  color: var(--cream-100);
}
.excerpt .section-head h2 { color: var(--cream-100); }
.excerpt .section-head .eyebrow { color: var(--gold-200); }
.excerpt__page {
  max-width: 760px;
  margin: 0 auto;
  background: rgba(252, 243, 228, 0.04);
  border: 1px solid rgba(245,227,200,0.18);
  border-radius: 4px;
  padding: 64px 60px;
}
.excerpt__page p {
  font-family: var(--serif-body);
  font-size: 20px;
  line-height: 1.9;
  color: var(--cream-200);
  margin-bottom: 24px;
}
.excerpt__page p:first-of-type::first-letter {
  font-family: var(--serif-display);
  font-size: 64px;
  font-weight: 900;
  color: var(--cream-100);
  float: left;
  line-height: 0.8;
  padding: 8px 10px 0 0;
}
.excerpt__source {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-200);
  opacity: 0.8;
  text-align: right;
  margin-top: 8px;
}

/* ---------- Author ---------- */
.author { background: var(--paper); }
.author__inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 48px;
  align-items: center;
  max-width: 820px;
  margin: 0 auto;
}
.author__badge {
  width: 128px; height: 128px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--amber-400), var(--rose-500));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 40px;
  color: var(--cream-100);
  flex-shrink: 0;
}
.author h3 {
  font-family: var(--serif-display);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 14px;
}
.author p {
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-muted);
}

/* ---------- Final CTA ---------- */
.cta {
  background: linear-gradient(180deg, var(--plum-700) 0%, var(--rose-500) 55%, var(--amber-400) 100%);
  padding: 120px 0;
  text-align: center;
  color: var(--cream-100);
}
.cta h2 {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  margin-bottom: 18px;
}
.cta p {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 19px;
  color: var(--cream-200);
  margin-bottom: 46px;
}
.cta .countdown { display: flex; flex-direction: column; align-items: center; }
.cta .countdown__row { margin-bottom: 46px; }
.cta .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink-950);
  color: var(--cream-200);
  padding: 56px 0 40px;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}
.footer__mark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-100);
}
.footer__links {
  display: flex;
  gap: 30px;
  list-style: none;
}
.footer__links a {
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--cream-200);
  opacity: 0.75;
}
.footer__links a:hover { opacity: 1; }
.footer__copy {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--cream-200);
  opacity: 0.55;
  margin-top: 28px;
  text-align: center;
}

/* ---------- Scroll reveal ----------
   Content is visible by default (no-JS / crawler safe). JS only arms the
   hidden state (adds .reveal-armed) once it has confirmed it can also
   reveal it again via IntersectionObserver. */
[data-reveal].reveal-armed {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
[data-reveal].reveal-armed.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__subtitle { margin-left: auto; margin-right: auto; }
  .countdown__row { justify-content: center; }
  .btn-row { justify-content: center; }
  .hero__book { order: -1; margin-bottom: 12px; }
  .hero__book img { width: min(260px, 60%); }
  .inside__grid { grid-template-columns: 1fr 1fr; }
  .author__inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

@media (max-width: 640px) {
  .nav__links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 78%;
    max-width: 320px;
    background: var(--ink-950);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 40px;
    gap: 30px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
  }
  .nav.menu-open .nav__links { transform: translateX(0); }
  .nav.is-scrolled .nav__links a,
  .nav__links a { color: var(--cream-200); }
  .nav__toggle { display: block; }
  .nav.is-scrolled .nav__toggle span,
  .nav__toggle span { background: var(--cream-100); }

  .section-pad { padding: 90px 0; }
  .inside__grid { grid-template-columns: 1fr; }
  .countdown__unit { width: 70px; padding: 12px 6px; }
  .countdown__num { font-size: 28px; }
  .excerpt__page { padding: 44px 26px; }
  .excerpt__page p:first-of-type::first-letter { font-size: 48px; }
  .footer__inner { flex-direction: column; text-align: center; }
}
