/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Core palette */
  --black:         #0a120a;
  --forest:        #111d10;
  --bark:          #1e2e1c;
  --gold:          #8a6a2e;
  --gold-light:    #b89050;
  --ivory:         #f0ebe0;
  --ivory-muted:   #a89880;
  --border:        rgba(138, 106, 46, 0.25);
  --glow:          rgba(138, 106, 46, 0.08);

  /* Typography */
  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-body:     'Jost', system-ui, sans-serif;

  /* Sizing */
  --size-hero:     clamp(4rem, 10vw, 9rem);
  --size-h2:       clamp(2rem, 4vw, 3.2rem);
  --size-h3:       clamp(1.2rem, 2vw, 1.6rem);
  --size-body:     1.05rem;
  --max-width:     1100px;
  --content-width: 680px;
}

/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--black);
  color: var(--ivory);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Grain / noise texture overlay at 3% opacity */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
}

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

/* ============================================================
   UTILITY — GOLD DIVIDER LINES
   ============================================================ */
.gold-line {
  width: 30px;
  height: 1px;
  background: var(--gold);
  margin: 0.6rem 0 1.4rem;
  flex-shrink: 0;
}

.gold-line--sm {
  width: 40px;
  margin: 0.8rem 0 1.8rem;
}

.gold-line--centered {
  width: 50px;
  margin: 0.8rem auto 2rem;
}

/* ============================================================
   UTILITY — SECTION LABELS
   ============================================================ */
.section-label {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.section-label--centered {
  text-align: center;
}

/* ============================================================
   UTILITY — BODY TEXT
   ============================================================ */
.body-text {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: var(--size-body);
  color: var(--ivory-muted);
  line-height: 1.9;
  margin-bottom: 1.2rem;
}

/* ============================================================
   UTILITY — HORIZONTAL RULES
   ============================================================ */
.rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.rule--full {
  border: none;
  border-top: 1px solid var(--border);
  width: 100%;
  margin: 0;
}

/* ============================================================
   UTILITY — TEXT LINKS
   ============================================================ */
.text-link {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  display: inline-block;
  transition: color 0.25s ease, transform 0.25s ease;
}

.text-link--arrow:hover {
  color: var(--gold-light);
  transform: translateX(4px);
}

/* ============================================================
   UTILITY — BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2.4rem;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn--filled {
  background: var(--gold);
  color: var(--black);
  border: 1px solid var(--gold);
}

.btn--filled:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
}

.btn--outlined {
  background: transparent;
  color: var(--ivory);
  border: 1px solid rgba(240, 235, 224, 0.3);
}

.btn--outlined:hover {
  border-color: var(--ivory);
  background: rgba(240, 235, 224, 0.05);
}

/* ============================================================
   SCROLL REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 1000;
  background: rgba(10, 18, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  opacity: 0;
  animation: fadeInBar 0.8s ease 0.2s forwards;
}

.topbar.scrolled {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 18, 10, 0.97);
}

@keyframes fadeInBar {
  to { opacity: 1; }
}

.topbar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__wordmark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.25em;
  color: var(--ivory);
}

.topbar__cta {
  border: 1px solid var(--gold);
  color: var(--gold);
  background: transparent;
  padding: 0.5rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.25s ease, color 0.25s ease;
}

.topbar__cta:hover {
  background: var(--gold);
  color: var(--black);
}

/* ============================================================
   HERO — FADE-IN ANIMATIONS (triggered by body.loaded)
   ============================================================ */
.fade-item {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity  0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition-delay: var(--delay, 0s);
}

body.loaded .fade-item {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   SECTION 1 — HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;

  /* Parallax-enabled CSS custom property positions */
  --hero-glow-x: 20%;
  --hero-glow-y: 80%;
  --hero-gold-x: 80%;
  --hero-gold-y: 15%;

  background-color: var(--black);
  background-image:
    radial-gradient(
      ellipse 60% 50% at var(--hero-glow-x) var(--hero-glow-y),
      rgba(30, 46, 28, 0.8) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 40% 30% at var(--hero-gold-x) var(--hero-gold-y),
      rgba(138, 106, 46, 0.12) 0%,
      transparent 60%
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 79px,
      rgba(255, 255, 255, 0.012) 80px
    );
}

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 7rem 2rem 5rem;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

/* Byline */
.hero__byline {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ivory-muted);
  margin-bottom: 2.5rem;
}

/* Book cover placeholder */
.hero__cover-wrap {
  display: flex;
  justify-content: center;
}

.hero__cover {
  position: relative;
  width: 220px;
  max-width: 220px;
  aspect-ratio: 2 / 3;
  background: linear-gradient(160deg, #1a2e18 0%, #0d1a0c 60%, #1a1200 100%);
  border: 1px solid var(--gold);
  box-shadow:
    0 0 60px rgba(138, 106, 46, 0.2),
    0 30px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__cover-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
}

.hero__cover-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  color: var(--ivory);
}

.hero__cover-rule {
  width: 30px;
  height: 1px;
  background: var(--gold);
}

.hero__cover-author {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--ivory-muted);
}

.hero__cover-note {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.6rem;
  color: rgba(138, 106, 46, 0.6);
  line-height: 1.4;
  text-align: left;
}

/* Hero title */
.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--size-hero);
  color: var(--ivory);
  letter-spacing: 0.08em;
  line-height: 1;
  margin-top: 2.5rem;
}

/* Gold divider */
.hero__divider {
  width: 50px;
  height: 1px;
  background: var(--gold);
  margin: 1.2rem auto;
}

/* Tagline */
.hero__tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--ivory-muted);
  max-width: 520px;
  text-align: center;
  line-height: 1.6;
}

/* CTA row */
.hero__ctas {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Scroll indicator */
.hero__scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  z-index: 2;
  user-select: none;
}

.scroll-label {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: var(--ivory-muted);
  text-transform: uppercase;
}

.scroll-arrow {
  color: var(--ivory-muted);
  font-size: 0.85rem;
  animation: bounce 2s ease infinite;
  display: block;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}

/* ============================================================
   SECTION 2 — SYNOPSIS
   ============================================================ */
.synopsis {
  background: var(--forest);
  padding: clamp(5rem, 10vw, 9rem) 0;
}

.synopsis__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.synopsis__heading {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: var(--size-h2);
  color: var(--ivory);
  margin-top: 0.5rem;
  line-height: 1.1;
}

.synopsis__panel {
  background: rgba(138, 106, 46, 0.06);
  border-left: 2px solid var(--gold);
  padding: 2rem 2.5rem;
  margin-top: 2rem;
}

.panel-label {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.panel-placeholder {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  color: var(--ivory-muted);
  line-height: 1.9;
  font-style: italic;
}

.synopsis__pub {
  margin-top: 2rem;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--ivory-muted);
  letter-spacing: 0.05em;
}

/* ============================================================
   SECTION 3 — ATMOSPHERE
   ============================================================ */
.atmosphere {
  background: var(--black);
  padding: clamp(5rem, 10vw, 9rem) 0;
}

.atmosphere__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

/* Image column */
.atmosphere__image-col {
  display: flex;
}

.atmosphere__image-placeholder {
  flex: 1;
  min-height: 500px;
  background: linear-gradient(180deg, #0d1a0c 0%, #1a2e10 40%, #0d1200 100%);
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.atmosphere__image-content {
  text-align: center;
  padding: 2rem;
}

.atm-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.atm-placeholder {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--ivory-muted);
  margin-bottom: 0.6rem;
}

.atm-note {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: rgba(138, 106, 46, 0.5);
  max-width: 220px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Text column */
.atmosphere__text-col {
  padding-left: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.atmosphere__heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--size-h3);
  color: var(--ivory);
  margin-top: 0.4rem;
  line-height: 1.2;
}

/* ============================================================
   SECTION 4 — ABOUT THE AUTHOR
   ============================================================ */
.author {
  background: var(--forest);
  padding: clamp(5rem, 10vw, 9rem) 0;
}

.author__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 5rem;
  align-items: center;
}

.author__photo-col {
  display: flex;
  justify-content: flex-start;
}

.author__photo-placeholder {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, #2a2a1a 0%, #1a1a0d 100%);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.author__photo-content {
  text-align: center;
  padding: 2rem;
}

.photo-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--ivory-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.photo-note {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.65rem;
  color: rgba(138, 106, 46, 0.5);
}

.author__bio-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.author__name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--size-h2);
  color: var(--ivory);
  line-height: 1.1;
  margin-top: 0.3rem;
}

/* ============================================================
   SECTION 5 — PRAISE
   ============================================================ */
.praise {
  background: var(--black);
  padding: clamp(5rem, 10vw, 9rem) 0;
}

.praise__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.praise__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 0.5rem;
}

.praise__card {
  background: var(--bark);
  border: 1px solid var(--border);
  padding: 2.5rem;
  position: relative;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.praise__card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}

.praise__quote-mark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 4rem;
  color: rgba(138, 106, 46, 0.3);
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  line-height: 1;
}

.praise__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ivory);
  line-height: 1.7;
  margin-top: 2.2rem;
  margin-bottom: 1.5rem;
}

.praise__attribution {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.praise__note {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.65rem;
  color: rgba(138, 106, 46, 0.45);
}

/* ============================================================
   SECTION 6 — GET THE BOOK
   ============================================================ */
.buy {
  background:
    radial-gradient(
      ellipse 50% 40% at 50% 50%,
      rgba(138, 106, 46, 0.07) 0%,
      transparent 70%
    ),
    linear-gradient(160deg, #0d1a0c 0%, #0a120a 100%);
  padding: clamp(5rem, 10vw, 9rem) 0;
}

.buy__inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

.buy__heading {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--size-h2);
  color: var(--ivory);
  margin-top: 0.5rem;
  line-height: 1.1;
}

.buy__subtext {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--ivory-muted);
  margin: 2rem 0 3rem;
  line-height: 1.9;
}

.buy__formats {
  text-align: left;
}

.buy__format {
  padding: 2.5rem 0;
}

.format-label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.2rem;
}

.format__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.retailer-btn {
  border: 1px solid var(--border);
  color: var(--ivory-muted);
  background: transparent;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.retailer-btn:hover {
  border-color: var(--gold);
  color: var(--ivory);
  background: rgba(138, 106, 46, 0.06);
}

.buy__instore-text {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--ivory-muted);
  line-height: 1.9;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--black);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.footer__wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.footer__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.25em;
  color: var(--ivory);
}

.footer__by {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--ivory-muted);
}

.footer__social {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-icon {
  color: var(--ivory-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease;
}

.social-icon:hover {
  color: var(--gold);
}

.footer__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer__nav-link {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.75rem;
  color: var(--ivory-muted);
  text-decoration: none;
  transition: color 0.25s ease;
}

.footer__nav-link:hover {
  color: var(--gold);
}

.footer__copy {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.75rem;
  color: rgba(240, 235, 224, 0.35);
}

/* ============================================================
   RESPONSIVE — 768px (tablet / mobile)
   ============================================================ */
@media (max-width: 768px) {
  /* Atmosphere: stack columns */
  .atmosphere__inner {
    grid-template-columns: 1fr;
  }

  .atmosphere__text-col {
    padding-left: 0;
    padding-top: 2rem;
  }

  .atmosphere__image-placeholder {
    min-height: 280px;
  }

  /* Author: stack columns */
  .author__inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .author__photo-col {
    justify-content: center;
  }

  .author__photo-placeholder {
    max-width: 240px;
  }

  /* Hero CTAs: stack on narrow screens */
  .hero__ctas {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  /* Top bar: tighter padding */
  .topbar__inner {
    padding: 0 1.25rem;
  }
}

/* ============================================================
   RESPONSIVE — 900px (praise grid)
   ============================================================ */
@media (max-width: 900px) {
  .praise__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — 600px (single column praise, footer tweaks)
   ============================================================ */
@media (max-width: 600px) {
  .praise__grid {
    grid-template-columns: 1fr;
  }

  .footer__nav {
    gap: 1.2rem;
  }

  .hero__cover {
    width: 180px;
    max-width: 180px;
  }

  .buy__subtext br {
    display: none;
  }
}
