/* =========================================================
   THE MASK — design tokens
   Palette: void black, deep indigo, muted violet, engraved gold, starlight
   ========================================================= */
:root{
  --void:        #060510;
  --void-soft:   #0b0a1a;
  --indigo-deep: #14102a;
  --indigo-mid:  #241a45;
  --violet-mist: #6b5296;
  --gold:        #c9a24a;
  --gold-bright: #eccd83;
  --gold-dim:    #7d6836;
  --starlight:   #f3ede0;
  --starlight-dim: #cfc8ba;

  --font-display: 'Cinzel', serif;
  --font-display-deco: 'Cinzel Decorative', serif;
  --font-body: 'EB Garamond', serif;
  --font-utility: 'Jost', sans-serif;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  background: var(--void);
  color: var(--starlight);
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

::selection{ background: var(--gold-dim); color: var(--starlight); }

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

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

/* subtle scroll-reveal utility, animated via JS toggling .is-visible */
.reveal-up{
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s ease, transform .9s ease;
}
.reveal-up.is-visible{
  opacity: 1;
  transform: translateY(0);
}

.eyebrow{
  font-family: var(--font-utility);
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  font-size: .78rem;
  color: var(--gold);
  margin-bottom: .9rem;
}

.section-title{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  color: var(--starlight);
  margin-bottom: 1.4rem;
}

.lede{
  font-size: 1.35rem;
  font-style: italic;
  color: var(--starlight);
  max-width: 42rem;
  margin-bottom: 1.4rem;
}

.body-copy{
  color: var(--starlight-dim);
  max-width: 42rem;
  margin-bottom: 1.3rem;
}

.dot{ color: var(--gold-dim); margin: 0 .5em; }

.meta-row{
  font-family: var(--font-utility);
  letter-spacing: .06em;
  font-size: .85rem;
  text-transform: uppercase;
  color: var(--starlight-dim);
  margin-top: 1.5rem;
}

/* =========================================================
   Ambient starfield (fixed, behind all content)
   ========================================================= */
#starfield{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: radial-gradient(ellipse at 50% -10%, var(--indigo-deep) 0%, var(--void) 55%, #030209 100%);
}

.grain-overlay{
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =========================================================
   Nav
   ========================================================= */
.site-nav{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 1.4rem 0;
  transition: background .4s ease, padding .4s ease, border-color .4s ease;
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled{
  background: rgba(6,5,16,.86);
  backdrop-filter: blur(10px);
  padding: .9rem 0;
  border-bottom: 1px solid rgba(201,162,74,.18);
}
.nav-inner{
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand{
  font-family: var(--font-display);
  letter-spacing: .18em;
  font-size: 1.05rem;
  color: var(--starlight);
  display: flex;
  align-items: center;
  gap: .55rem;
}
.brand-mark{ color: var(--gold); font-size: .85em; }
.nav-links{
  display: flex;
  align-items: center;
  gap: 2.2rem;
  font-family: var(--font-utility);
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav-links a{
  color: var(--starlight-dim);
  position: relative;
  padding-bottom: .3rem;
  transition: color .3s ease;
}
.nav-links a:not(.nav-cta)::after{
  content:'';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width .3s ease;
}
.nav-links a:not(.nav-cta):hover{ color: var(--starlight); }
.nav-links a:not(.nav-cta):hover::after{ width: 100%; }
.nav-cta{
  border: 1px solid var(--gold-dim);
  padding: .55rem 1.2rem;
  color: var(--gold-bright) !important;
  border-radius: 2px;
  transition: border-color .3s ease, background .3s ease;
}
.nav-cta:hover{ border-color: var(--gold); background: rgba(201,162,74,.08); }

.nav-toggle{
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
}
.nav-toggle span{
  width: 22px; height: 1px; background: var(--starlight);
}

/* =========================================================
   Hero
   ========================================================= */
.hero{
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-image{
  position: absolute;
  inset: 0;
  background-image: url('../images/hero.jpg');
  background-size: cover;
  background-position: center 30%;
  opacity: .58;
  filter: saturate(1.05) contrast(1.05);
  transform: scale(1.08);
}
.hero-vignette{
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6,5,16,.55) 0%, rgba(6,5,16,.25) 30%, rgba(6,5,16,.65) 72%, var(--void) 100%),
    radial-gradient(ellipse at 50% 45%, rgba(6,5,16,0) 0%, rgba(6,5,16,.55) 78%);
}
.hero-content{
  position: relative;
  z-index: 2;
  text-align: center;
  padding-top: 2rem;
}
.hero-title{
  margin: 0 0 1.6rem;
  line-height: .95;
}
.title-the{
  display: block;
  font-family: var(--font-utility);
  font-weight: 300;
  letter-spacing: .9em;
  font-size: clamp(.9rem, 1.6vw, 1.15rem);
  color: var(--starlight-dim);
  margin-bottom: 1.1rem;
  padding-left: .9em; /* optical centering for letter-spacing */
}
.title-mask{
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.2rem, 14vw, 9.5rem);
  letter-spacing: .04em;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 45%, var(--gold-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(201,162,74,.25);
}
.hero-tagline{
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  color: var(--starlight);
  max-width: 34rem;
  margin: 0 auto 2.4rem;
}
.hero-actions{
  display: flex;
  gap: 1.1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn{
  font-family: var(--font-utility);
  font-size: .82rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: .95rem 2.1rem;
  border-radius: 2px;
  border: 1px solid transparent;
  display: inline-block;
  transition: all .35s ease;
}
.btn-gold{
  background: var(--gold);
  color: var(--void) !important;
  border-color: var(--gold);
}
.btn-gold:hover{
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  box-shadow: 0 0 28px rgba(201,162,74,.35);
}
.btn-ghost{
  border-color: rgba(243,237,224,.35);
  color: var(--starlight) !important;
}
.btn-ghost:hover{
  border-color: var(--gold);
  color: var(--gold-bright) !important;
}

.scroll-cue{
  position: absolute;
  bottom: 2.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 1px;
  height: 46px;
  overflow: hidden;
}
.scroll-cue-line{
  position: absolute;
  top: -46px; left: 0;
  width: 1px; height: 46px;
  background: linear-gradient(180deg, transparent, var(--gold));
  animation: scrollcue 2.2s ease-in-out infinite;
}
@keyframes scrollcue{
  0%{ top: -46px; }
  100%{ top: 46px; }
}

/* =========================================================
   Premise
   ========================================================= */
.premise{
  position: relative;
  padding: 8.5rem 0;
}
.cover-frame{
  position: relative;
  max-width: 340px;
  margin: 0 auto;
}
.cover-img{
  position: relative;
  z-index: 2;
  border-radius: 2px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.7);
}
.cover-glow{
  position: absolute;
  inset: -6%;
  z-index: 1;
  background: radial-gradient(ellipse at center, rgba(201,162,74,.22) 0%, transparent 68%);
  filter: blur(6px);
}

/* =========================================================
   The Reveal — signature scroll-driven constellation mask
   ========================================================= */
.reveal-section{
  position: relative;
  background: linear-gradient(180deg, var(--void) 0%, var(--void-soft) 100%);
}
.reveal-spacer{
  height: 220vh; /* scroll distance to drive the animation */
}
.reveal-sticky{
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#maskCanvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.reveal-text-wrap{
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 1.5rem;
  pointer-events: none;
}
.reveal-eyebrow{ margin-bottom: 1.1rem; }
.reveal-heading{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  color: var(--starlight);
  line-height: 1.2;
  transition: opacity .4s ease;
}
.reveal-sub{
  font-family: var(--font-body);
  font-style: italic;
  color: var(--starlight-dim);
  margin-top: 1rem;
  font-size: 1.15rem;
  transition: opacity .4s ease;
}

/* =========================================================
   Pull quote
   ========================================================= */
.pull-quote-section{
  padding: 9rem 0;
  position: relative;
}
.pull-quote-section::before,
.pull-quote-section::after{
  content:'';
  display: block;
  width: 1px;
  height: 64px;
  background: linear-gradient(180deg, transparent, var(--gold-dim));
  margin: 0 auto 2.4rem;
}
.pull-quote{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  line-height: 1.4;
  color: var(--starlight);
  max-width: 46rem;
  margin: 0 auto 1.5rem;
}
.pull-quote-attr{
  font-family: var(--font-utility);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--gold);
}

/* =========================================================
   Author
   ========================================================= */
.author-section{
  padding: 7rem 0 9rem;
}
.monogram-frame{
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.monogram-ring{
  position: absolute;
  inset: 0;
  border: 1px solid rgba(201,162,74,.4);
  border-radius: 50%;
}
.monogram-ring::before{
  content:'';
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(201,162,74,.18);
  border-radius: 50%;
}
.monogram{
  font-family: var(--font-display);
  font-size: 3.1rem;
  letter-spacing: .06em;
  color: var(--gold-bright);
  display: flex;
  gap: .1em;
}
.monogram-divider{ color: var(--gold-dim); }

/* =========================================================
   Get the book
   ========================================================= */
.get-book{
  padding: 8rem 0 7rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(107,82,150,.14) 0%, transparent 60%);
  text-align: center;
}
.get-book .lede{ margin-left: auto; margin-right: auto; text-align: center; }
.retailer-row{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 2.6rem 0 2.2rem;
}
.retailer-btn{
  font-family: var(--font-utility);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .9rem 1.7rem;
  border: 1px solid rgba(243,237,224,.28);
  border-radius: 2px;
  color: var(--starlight);
  transition: all .3s ease;
}
.retailer-btn:hover{
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(201,162,74,.06);
}
.format-row{
  font-family: var(--font-utility);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .78rem;
  color: var(--starlight-dim);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer{
  padding: 3rem 0;
  border-top: 1px solid rgba(201,162,74,.15);
}
.footer-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copy{
  font-family: var(--font-utility);
  font-size: .8rem;
  color: var(--starlight-dim);
  margin: 0;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 991.98px){
  .nav-toggle{ display: flex; }
  .nav-links{
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: rgba(6,5,16,.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2.2rem;
    padding: 2rem 2.6rem;
    transform: translateX(100%);
    transition: transform .4s ease;
    border-left: 1px solid rgba(201,162,74,.18);
  }
  .nav-links.open{ transform: translateX(0); }
}

@media (max-width: 575.98px){
  .title-the{ letter-spacing: .5em; padding-left: .5em; }
  .premise{ padding: 5.5rem 0; }
  .pull-quote-section{ padding: 6rem 0; }
  .author-section{ padding: 5rem 0 6rem; }
  .get-book{ padding: 6rem 0 5rem; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .reveal-up{ transition: none; opacity: 1; transform: none; }
  .scroll-cue-line{ animation: none; }
}
