/* Winter Rose, author site
   Hand-ported from JSX prototype to static HTML/CSS.
   Design tokens live in colors_and_type.css. */

html, body {
  margin: 0;
  padding: 0;
  background: var(--wr-midnight);
  color: var(--wr-moonlight);
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
}
*, *::before, *::after { box-sizing: border-box; }
button { font: inherit; }
a { color: var(--wr-rose-soft); }
::selection { background: rgba(176, 48, 80, .45); color: var(--wr-moonlight); }
section { scroll-margin-top: 68px; }
img { max-width: 100%; display: block; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50; height: 68px;
  background: rgba(17, 16, 28, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: background 320ms cubic-bezier(.22,.61,.36,1),
              border-color 320ms cubic-bezier(.22,.61,.36,1);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
}
.nav.scrolled {
  background: rgba(17, 16, 28, 0.9);
  border-bottom-color: rgba(201, 169, 106, .14);
}
.nav-logo {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: 'Cinzel Decorative', serif; font-weight: 900;
  font-size: clamp(15px, 1.6vw, 18px);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--wr-moonlight);
  min-height: 44px;
}
.nav-logo .dot { color: var(--wr-rose); }
.nav-desktop { display: flex; gap: 36px; }
.nav-desktop a {
  background: none; border: none; cursor: pointer; padding: 8px 0;
  font-family: 'Cinzel', serif; font-weight: 500; font-size: 12px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--wr-pearl); text-decoration: none;
  transition: color 200ms;
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav-desktop a:hover { color: var(--wr-gold); }

.nav-toggle {
  background: none; border: 1px solid var(--wr-stone); border-radius: 4px;
  width: 44px; height: 44px; cursor: pointer; color: var(--wr-pearl);
  display: none; align-items: center; justify-content: center;
}
.nav-toggle .icon-close { display: none; }
.nav.open-menu .nav-toggle .icon-open { display: none; }
.nav.open-menu .nav-toggle .icon-close { display: block; }

.nav-mobile-panel {
  position: fixed; top: 68px; left: 0; right: 0; z-index: 49;
  background: rgba(10, 7, 16, .97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(201, 169, 106, .18);
  padding: 24px 24px 32px;
  display: none;
  flex-direction: column; gap: 4px;
}
.nav.open-menu + .nav-mobile-panel { display: flex; }
.nav-mobile-panel a {
  background: none; border: none; cursor: pointer;
  font-family: 'Cinzel', serif; font-weight: 500; font-size: 14px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--wr-moonlight); padding: 14px 0;
  text-align: left; border-bottom: 1px solid var(--wr-fog);
  text-decoration: none;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(96px, 12vh, 140px) clamp(20px, 4vw, 48px) clamp(80px, 10vh, 120px);
}
.hero-bg {
  position: absolute; inset: 0;
  background: var(--wr-midnight);
}
/* Flame layer — above vignette (z-index 1), below content (z-index 2) */
.hero-flames {
  position: absolute; inset: 0;
  z-index: 1; pointer-events: none;
}
/* Full-height pseudo-elements — no translateY so hard edges never enter frame */
.hero-flames::before,
.hero-flames::after {
  content: '';
  position: absolute; inset: 0;
}
/* Layer A: crimson/red — pulses in and breathes gently */
.hero-flames::before {
  background:
    radial-gradient(ellipse 55% 50% at 18% 100%, rgba(217,74,42,.9),  transparent 70%),
    radial-gradient(ellipse 45% 45% at 78% 100%, rgba(176,48,80,.85), transparent 65%),
    radial-gradient(ellipse 80% 35% at 50% 100%, rgba(90,8,18,.95),   transparent 55%);
  animation: wr-pulse-a 7s ease-in-out infinite;
}
/* Layer B: orange/amber — offset phase for alternating flicker */
.hero-flames::after {
  background:
    radial-gradient(ellipse 60% 55% at 60% 100%, rgba(232,122,32,.75), transparent 68%),
    radial-gradient(ellipse 40% 50% at 25% 100%, rgba(212,160,80,.4),  transparent 62%),
    radial-gradient(ellipse 50% 40% at 85% 100%, rgba(217,74,42,.65),  transparent 60%);
  animation: wr-pulse-b 10s ease-in-out infinite;
}
@keyframes wr-pulse-a {
  0%   { opacity: .14; }
  30%  { opacity: .28; }
  60%  { opacity: .09; }
  80%  { opacity: .24; }
  100% { opacity: .14; }
}
@keyframes wr-pulse-b {
  0%   { opacity: .20; }
  25%  { opacity: .07; }
  55%  { opacity: .25; }
  80%  { opacity: .08; }
  100% { opacity: .20; }
}
.hero-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center,
    rgba(10,7,16,.35) 0%,
    rgba(10,7,16,.85) 65%,
    rgba(10,7,16,1) 100%);
}
.hero-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 30%;
  background: linear-gradient(180deg, transparent, var(--wr-midnight));
}
.hero-grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: auto 1fr;
  gap: clamp(32px, 5vw, 72px); align-items: center;
  max-width: 1200px; width: 100%;
}
.hero-cover {
  width: clamp(220px, 26vw, 340px);
  aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0,0,0,.8), 0 0 0 1px rgba(201,169,106,.2);
  justify-self: center;
}
.hero-text { min-width: 0; }
.out-now-badge {
  display: inline-block;
  font-family: 'Cinzel', serif; font-weight: 600;
  font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--wr-moonlight);
  background: var(--wr-rose);
  padding: 8px 22px; border-radius: 999px; margin-bottom: 20px;
  animation: wr-badge-glow 3s ease-in-out infinite alternate;
}
@keyframes wr-badge-glow {
  from { box-shadow: 0 0 12px rgba(176,48,80,.4); }
  to   { box-shadow: 0 0 28px rgba(176,48,80,.8), 0 0 52px rgba(176,48,80,.2); }
}
.eyebrow {
  font-family: 'Cinzel', serif; font-weight: 500;
  font-size: clamp(10px, 1vw, 11px);
  letter-spacing: 0.36em; text-transform: uppercase;
  color: var(--wr-gold); margin-bottom: 18px;
}
.hero-subtitle {
  font-family: 'Cinzel', serif; font-weight: 500;
  font-size: clamp(14px, 1.4vw, 18px);
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--wr-pearl); margin-bottom: 8px;
}
.hero-title {
  font-family: 'Cinzel Decorative', serif; font-weight: 900;
  font-size: clamp(44px, 8vw, 96px); line-height: .95;
  letter-spacing: .01em; text-transform: uppercase;
  color: var(--wr-moonlight); margin: 0;
  text-shadow: 0 0 60px rgba(217,74,42,.25), 0 4px 30px rgba(0,0,0,.6);
}
.hero-tagline {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: clamp(18px, 2vw, 24px); line-height: 1.45;
  color: var(--wr-pearl); margin-top: 28px; max-width: 560px;
}
.hero-cta { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.btn {
  font-family: 'Cinzel', serif; font-weight: 600; font-size: 13px;
  letter-spacing: .18em; text-transform: uppercase;
  padding: 16px 32px; border-radius: 6px; border: none; cursor: pointer;
  text-decoration: none; display: inline-block;
  min-height: 44px;
}
.btn-primary {
  background: var(--wr-rose); color: var(--wr-moonlight);
  box-shadow: 0 4px 24px rgba(176,48,80,.4);
}
.btn-ghost {
  background: transparent; color: var(--wr-gold);
  border: 1px solid var(--wr-gold);
}
.btn-outline {
  background: transparent; color: var(--wr-moonlight);
  border: 1px solid var(--wr-moonlight);
  padding: 14px 28px; font-size: 12px;
}
.scroll-indicator {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: .36em;
  text-transform: uppercase; color: var(--wr-mist);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  opacity: .7;
}
.scroll-indicator .bar {
  width: 1px; height: 32px;
  background: linear-gradient(180deg, var(--wr-gold), transparent);
}

/* ---------- Books section ---------- */
.books {
  padding: clamp(60px, 10vh, 120px) clamp(20px, 4vw, 48px) 0;
  max-width: 1200px; margin: 0 auto;
}
.section-head {
  text-align: center;
  margin-bottom: clamp(40px, 6vh, 64px);
}
.section-head .eyebrow { font-size: 11px; margin-bottom: 14px; }
.section-head h2 {
  font-family: 'Cinzel Decorative', serif; font-weight: 900;
  font-size: clamp(36px, 5vw, 56px); letter-spacing: .02em;
  text-transform: uppercase; color: var(--wr-moonlight);
  margin: 0; line-height: 1;
}

.book {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  padding: clamp(64px, 10vh, 120px) 0;
  border-top: 1px solid var(--wr-fog);
}
.book:first-of-type { border-top: none; }
.book:nth-child(even) { grid-template-columns: 1fr auto; }
.book:nth-child(even) .book-cover { order: 2; }
.book:nth-child(even) .book-text { order: 1; }

.book-cover {
  position: relative; justify-self: center;
}
.book-cover::before {
  content: '';
  position: absolute; inset: -20px; border-radius: 8px;
  background: radial-gradient(ellipse at center, var(--accent, rgba(176,48,80,.18)), transparent 70%);
  filter: blur(20px); z-index: 0;
}
.book-cover img {
  position: relative; z-index: 1;
  width: clamp(240px, 28vw, 360px);
  aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px;
  box-shadow: 0 24px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(201,169,106,.2);
}
.book-text { min-width: 0; }
.book-text .eyebrow { font-size: 11px; letter-spacing: 0.32em; margin-bottom: 14px; }
.book-subtitle {
  font-family: 'Cinzel', serif; font-weight: 500; font-size: 14px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--wr-pearl); margin-bottom: 6px;
}
.book-text h2 {
  font-family: 'Cinzel Decorative', serif; font-weight: 900;
  font-size: clamp(36px, 5vw, 60px); letter-spacing: .02em;
  text-transform: uppercase; color: var(--wr-moonlight);
  margin: 0 0 20px; line-height: .98;
}
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tag {
  font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--wr-stone); color: var(--wr-pearl);
  background: var(--wr-dusk);
}
.book-blurb {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.6; color: var(--wr-pearl);
  white-space: pre-line; margin-bottom: 24px; max-width: 560px;
}
.book-note {
  font-family: 'Lora', serif; font-style: italic; font-size: 13px;
  line-height: 1.6; color: var(--wr-mist); max-width: 560px;
  padding: 14px 0 14px 16px;
  border-left: 1px solid var(--wr-gold-deep);
  margin-bottom: 32px;
}

/* ---------- About ---------- */
.about {
  padding: clamp(80px, 12vh, 140px) clamp(20px, 4vw, 48px);
  background: var(--wr-ink);
  border-top: 1px solid var(--wr-fog);
  border-bottom: 1px solid var(--wr-fog);
}
.about-grid {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr;
  gap: clamp(40px, 6vw, 80px); align-items: center;
}
.about-photo {
  width: clamp(220px, 26vw, 300px);
  aspect-ratio: 4 / 5;
  background: var(--wr-dusk);
  border: 1px solid var(--wr-gold-deep);
  border-radius: 4px;
  overflow: hidden;
  justify-self: center;
  position: relative;
  box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 0 0 1px rgba(201,169,106,.15);
}
.about-photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
}
.corner {
  position: absolute; width: 14px; height: 14px; opacity: .6;
}
.corner.tl { top: 8px; left: 8px;
  border-top: 1px solid var(--wr-gold); border-left: 1px solid var(--wr-gold); }
.corner.tr { top: 8px; right: 8px;
  border-top: 1px solid var(--wr-gold); border-right: 1px solid var(--wr-gold); }
.corner.bl { bottom: 8px; left: 8px;
  border-bottom: 1px solid var(--wr-gold); border-left: 1px solid var(--wr-gold); }
.corner.br { bottom: 8px; right: 8px;
  border-bottom: 1px solid var(--wr-gold); border-right: 1px solid var(--wr-gold); }
.about-text { min-width: 0; }
.about-text .eyebrow { font-size: 11px; margin-bottom: 14px; }
.about-text h2 {
  font-family: 'Cinzel Decorative', serif; font-weight: 900;
  font-size: clamp(38px, 5vw, 60px); letter-spacing: .02em;
  text-transform: uppercase; color: var(--wr-moonlight);
  margin: 0 0 28px; line-height: 1;
}
.about-prose {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(18px, 1.7vw, 21px); line-height: 1.65;
  color: var(--wr-pearl);
}
.about-prose p { margin: 0 0 18px; }
.about-prose p:last-child {
  margin: 0; font-style: italic; color: var(--wr-moonlight);
}

/* ---------- Contact ---------- */
.contact {
  padding: clamp(80px, 12vh, 140px) clamp(20px, 4vw, 48px);
  background: var(--wr-ink);
  border-top: 1px solid var(--wr-fog);
  text-align: center;
}
.contact-inner { max-width: 900px; margin: 0 auto; }
.contact .eyebrow { font-size: 11px; margin-bottom: 14px; }
.contact h2 {
  font-family: 'Cinzel Decorative', serif; font-weight: 900;
  font-size: clamp(36px, 5vw, 56px); letter-spacing: .02em;
  text-transform: uppercase; color: var(--wr-moonlight);
  margin: 0 0 24px; line-height: 1;
}
.contact-lede {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: clamp(17px, 1.7vw, 20px); color: var(--wr-pearl);
  line-height: 1.5; margin: 0 0 40px;
}
.contact-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 14px; max-width: 880px; margin: 0 auto;
}
.contact-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 24px 12px; border-radius: 6px;
  background: var(--wr-dusk);
  border: 1px solid var(--wr-stone);
  text-decoration: none;
  transition: all 220ms cubic-bezier(.22,.61,.36,1);
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.contact-card:hover {
  border-color: var(--wr-gold-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.contact-card .icon { color: var(--wr-pearl); transition: color 200ms; }
.contact-card:hover .icon { color: var(--wr-gold); }
.contact-card .label {
  font-family: 'Cinzel', serif; font-weight: 600; font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--wr-moonlight);
}
.contact-card .handle {
  font-family: 'Lora', serif; font-size: 11px; color: var(--wr-mist);
  word-break: break-word;
}

/* ---------- Footer ---------- */
.footer {
  padding: 48px clamp(20px, 4vw, 48px) 40px;
  background: var(--wr-ink);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  border-top: 1px solid rgba(201,169,106,.12);
}
.footer-logo {
  font-family: 'Cinzel Decorative', serif; font-weight: 900; font-size: 18px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--wr-moonlight);
}
.footer-logo .dot { color: var(--wr-rose); }
.footer-loc {
  font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 14px;
  color: var(--wr-mist); margin: 4px 0 0; text-align: center; max-width: 520px;
}
.footer-copy {
  font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--wr-ash); margin-top: 8px;
}

/* ---------- Animations ---------- */

/* Hero cover gentle float */
@keyframes wr-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-5px); }
}
.hero-cover { animation: wr-float 14s ease-in-out infinite; }

/* Scroll-indicator bar pulse */
@keyframes wr-bar-pulse {
  0%   { transform: scaleY(0); transform-origin: top;    opacity: 0; }
  45%  { transform: scaleY(1); transform-origin: top;    opacity: 1; }
  55%  { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}
.scroll-indicator .bar { animation: wr-bar-pulse 2.4s ease-in-out infinite; }

/* Scroll reveal – elements start invisible */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 700ms cubic-bezier(.22,.61,.36,1),
              transform 700ms cubic-bezier(.22,.61,.36,1);
}
.reveal.in-view { opacity: 1; transform: none; }

/* Staggered children reveal */
.reveal-kids > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms cubic-bezier(.22,.61,.36,1),
              transform 600ms cubic-bezier(.22,.61,.36,1);
}
.reveal-kids.in-view > *:nth-child(1) { transition-delay:   0ms; }
.reveal-kids.in-view > *:nth-child(2) { transition-delay: 100ms; }
.reveal-kids.in-view > *:nth-child(3) { transition-delay: 200ms; }
.reveal-kids.in-view > *:nth-child(4) { transition-delay: 300ms; }
.reveal-kids.in-view > *:nth-child(5) { transition-delay: 400ms; }
.reveal-kids.in-view > * { opacity: 1; transform: none; }

/* Button hover lift + glow */
.btn {
  transition: transform 200ms cubic-bezier(.22,.61,.36,1),
              box-shadow 200ms cubic-bezier(.22,.61,.36,1),
              background 200ms, color 200ms, border-color 200ms;
}
.btn:hover  { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); }
.btn-primary:hover {
  box-shadow: 0 10px 36px rgba(176,48,80,.65);
}
.btn-ghost:hover {
  background: var(--wr-gold);
  color: var(--wr-night);
  border-color: var(--wr-gold);
}
.btn-outline:hover {
  background: rgba(245,241,232,.12);
  border-color: var(--wr-pearl);
  color: var(--wr-pearl);
}

/* Book cover lift on hover */
.book-cover img {
  transition: transform 450ms cubic-bezier(.22,.61,.36,1),
              box-shadow 450ms cubic-bezier(.22,.61,.36,1);
}
.book-cover:hover img {
  transform: translateY(-8px) scale(1.025);
  box-shadow: 0 36px 96px rgba(0,0,0,.9), 0 0 0 1px rgba(201,169,106,.35);
}

/* Nav underline slide */
.nav-desktop a { position: relative; }
.nav-desktop a::after {
  content: '';
  position: absolute; bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--wr-gold);
  transition: width 280ms cubic-bezier(.22,.61,.36,1);
}
.nav-desktop a:hover::after { width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .scroll-indicator { display: none; }

  .nav-desktop { display: none; }
  .nav-toggle { display: flex; }

  .hero-grid { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .hero-text { text-align: center; }
  .hero-text .hero-tagline { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }

  .book,
  .book:nth-child(even) { grid-template-columns: 1fr; text-align: center; }
  .book .book-cover,
  .book .book-text,
  .book:nth-child(even) .book-cover,
  .book:nth-child(even) .book-text { order: unset; }
  .book-text .tag-list { justify-content: center; }
  .book-text .book-blurb,
  .book-text .book-note { margin-left: auto; margin-right: auto; }
  .book-text .book-note { text-align: left; }

  .about-grid { grid-template-columns: 1fr; text-align: center; }

  .contact-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .nav { padding: 0 16px; }
  .hero { padding-left: 16px; padding-right: 16px; }
  .books, .about, .contact { padding-left: 16px; padding-right: 16px; }
}
