/* ============================================================
   Nash Edwards — A Matter of the Heart
   Warm, literary contemporary-romance styling.
   ============================================================ */

:root {
  --paper:      #faf5ee;
  --paper-alt:  #f2e9dd;
  --ink:        #2b2320;
  --ink-soft:   #5f544d;
  --rose:       #b25b6d;   /* muted romance rose */
  --rose-deep:  #8f4353;
  --gold:       #c9a15a;
  --amazon:     #ff9900;
  --amazon-ink: #221f1c;
  --line:       #e0d3c2;
  --shadow:     rgba(64, 44, 34, 0.18);

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans:  "Nunito Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(2.8rem, 7vw, 5rem); letter-spacing: -0.5px; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }

a { color: var(--rose-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--rose);
  margin: 0 0 1rem;
}
.eyebrow.center, .center { text-align: center; }
.center .cta-row { justify-content: center; }

.lede {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 5vw, 4rem);
  background: rgba(250, 245, 238, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--serif);
  font-size: 1.5rem; font-weight: 600;
  color: var(--ink); text-decoration: none;
  letter-spacing: 0.5px;
}
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }
.site-nav a { color: var(--ink-soft); font-size: 0.95rem; }
.site-nav a:hover { color: var(--rose-deep); text-decoration: none; }
.nav-cta {
  background: var(--ink); color: var(--paper) !important;
  padding: 0.5rem 1.1rem; border-radius: 999px; font-weight: 600;
}
.nav-cta:hover { background: var(--rose-deep); }
@media (max-width: 640px) {
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.6rem; border-radius: 999px;
  font-family: var(--sans); font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .2s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-amazon {
  background: var(--amazon); color: var(--amazon-ink);
  box-shadow: 0 8px 22px rgba(255, 153, 0, 0.35);
}
.btn-amazon:hover { box-shadow: 0 12px 28px rgba(255, 153, 0, 0.45); }
.btn-icon { width: 1.45rem; height: auto; display: inline-block; flex: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--rose); color: var(--rose-deep); }
.btn-lg { padding: 1.05rem 2.2rem; font-size: 1.1rem; }

.cta-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* ---------- Hero ---------- */
/* Full-bleed section (so the mountain range spans edge to edge);
   .hero-inner holds the centered content grid. */
.hero-inner {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  max-width: 1180px; margin: 0 auto;
  padding: clamp(3rem, 8vw, 6.5rem) clamp(1.2rem, 5vw, 4rem) clamp(6rem, 16vw, 11rem);
}
.hero-text { max-width: 34ch; }
.hero-cover { display: flex; justify-content: center; }

/* Book cover (real cover art at assets/cover.jpg — shown uncropped at natural ratio) */
.book-cover {
  display: block;
  width: clamp(230px, 28vw, 320px); height: auto;
  border-radius: 4px;
  box-shadow:
    0 0 0 3px #faf5ee,                    /* slim cream mat */
    0 0 0 4px rgba(201, 161, 90, 0.45),   /* hairline gold frame edge */
    20px 26px 56px rgba(64, 44, 34, 0.30),/* soft deep lift shadow */
    inset 0 0 0 1px rgba(0, 0, 0, 0.06);  /* subtle edge on the art */
  transition: transform .4s ease;
}
.book-cover:hover { transform: scale(1.03); }

/* Gentle float on the cover — the "book animation" (tilt lives on the img,
   the bob lives on the wrapper, so they don't fight each other) */
.hero-cover { animation: bookFloat 6.5s ease-in-out infinite; }
@keyframes bookFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 9vw, 7rem) clamp(1.2rem, 5vw, 4rem); }
.section-alt { background: var(--paper-alt); }
.section-inner { max-width: 1080px; margin: 0 auto; }
.section-inner.narrow { max-width: 720px; }
.prose { font-size: 1.12rem; color: var(--ink-soft); }
.prose p { margin: 0 0 1.2rem; }
h2 + .prose, .center h2 + .prose { margin-top: 1.5rem; }

/* Author */
.author-grid {
  display: grid; grid-template-columns: 220px 1fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.author-portrait {
  width: 220px; height: 220px; border-radius: 50%;
  object-fit: cover; object-position: center top;
  border: 5px solid #fff;
  box-shadow: 0 14px 34px var(--shadow);
  justify-self: center;
}
@media (max-width: 720px) {
  .author-grid { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

/* Rating stars */
.rating { display: flex; align-items: center; justify-content: center; gap: 0.7rem; margin: 0.4rem 0 1.6rem; }
.stars { position: relative; display: inline-block; font-size: 1.35rem; letter-spacing: 3px; line-height: 1; }
.stars-base { color: #e0d3c2; }
.stars-fill {
  position: absolute; left: 0; top: 0; width: var(--pct, 100%);
  overflow: hidden; white-space: nowrap; color: var(--gold);
}
.rating-text { font-size: 0.95rem; color: var(--ink-soft); }
.rating-text a { color: var(--rose-deep); }

/* Reader review cards */
.reviews {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem; margin-top: 2.6rem; text-align: left;
}
.review-card {
  background: rgba(255, 255, 255, 0.5); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.7rem; margin: 0;
}
.review-card blockquote {
  margin: 0 0 1rem; font-family: var(--serif); font-style: italic;
  font-size: 1.18rem; color: var(--ink); line-height: 1.4;
}
.review-card figcaption {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--rose); font-weight: 700;
}

/* Praise */
.pull-quote {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem); line-height: 1.3;
  color: var(--ink); margin: 1.5rem 0 1rem; border: 0;
}
.quote-attribution { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.78rem; color: var(--rose); font-weight: 700; }

/* Final CTA */
.final-cta {
  background: linear-gradient(160deg, #2b2320, #4a352f);
  color: var(--paper);
}
.final-cta h2 { color: var(--paper); }
.final-cta .lede { color: #e8d9c9; }
.final-cta .btn-amazon { margin-top: 2rem; }

/* Hero responsive */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-text { max-width: none; margin: 0 auto; }
  .cta-row { justify-content: center; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: #221c19; color: #cbbcae;
  padding: 3rem clamp(1.2rem, 5vw, 4rem);
  text-align: center;
}
.footer-brand { font-family: var(--serif); font-size: 1.6rem; color: var(--paper); margin: 0 0 0.5rem; }
.footer-imprint { margin: 0.3rem 0; font-size: 0.95rem; }
.footer-imprint a { color: var(--gold); }
.footer-copy { font-size: 0.82rem; color: #8a7d70; margin-top: 1.2rem; }
.footer-contact-btn {
  display: inline-flex; margin: 0.4rem 0 0.8rem;
  background: var(--rose-deep); color: var(--paper);
  padding: 0.7rem 1.6rem; border-radius: 999px; font-weight: 700; text-decoration: none;
  transition: background .2s ease, transform .15s ease;
}
.footer-contact-btn:hover { background: var(--rose); transform: translateY(-2px); text-decoration: none; }
.footer-actions { display: inline-flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; margin: 0.4rem 0 0.8rem; }
.footer-actions .footer-contact-btn { margin: 0; }
.footer-share-btn {
  background: transparent; color: var(--paper);
  border: 1px solid rgba(255,255,255,0.28); cursor: pointer; font-family: var(--sans);
}
.footer-share-btn:hover { background: rgba(255,255,255,0.1); }

/* ============================================================
   "A Matter of the Heart" — themed motifs
   (heartbeat pulse, Oregon tree-line, ornaments, drop cap)
   ============================================================ */

/* Signature heartbeat / ECG pulse — the title's double meaning */
.heartbeat { display: block; width: min(340px, 90%); height: 40px; margin: 1.6rem 0 0.2rem; }
.heartbeat-cta { margin: 1.6rem auto 0.4rem; }
.heartbeat-path {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: hbDraw 3.8s ease-in-out infinite;
}
@keyframes hbDraw {
  0%       { stroke-dashoffset: 1; }
  45%, 58% { stroke-dashoffset: 0; }
  100%     { stroke-dashoffset: -1; }
}

/* Misty Oregon mountain range in the hero — rose/gold dusk, layered depth.
   Each layer drifts slowly on its own; script.js adds scroll parallax
   (horizontal slide + rise) via --px / --py custom properties. */
.hero { position: relative; overflow: hidden; }
.hero-text, .hero-cover { position: relative; z-index: 1; }
.hero-ridges {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: clamp(90px, 17vw, 210px);
  z-index: 0; pointer-events: none; overflow: hidden;
}

/* Low dusk sun glowing behind the range */
.ridge-glow {
  position: absolute; left: 50%; bottom: -22%;
  width: min(60vw, 640px); aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 100%,
    rgba(201,161,90,0.5), rgba(216,142,147,0.28) 45%, transparent 72%);
  filter: blur(6px);
  animation: glowBreathe 9s ease-in-out infinite;
}
@keyframes glowBreathe {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}

.ridge {
  position: absolute; left: -12%; bottom: 0; width: 124%; height: 100%;
  background-repeat: repeat-x; background-position: left bottom;
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
  animation: ridgeDrift linear infinite;
  will-change: background-position, transform;
}
/* Far haze — palest rose, almost dissolved in the sky */
.ridge-far {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='200' viewBox='0 0 900 200'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23dcb6ae'/%3E%3Cstop offset='1' stop-color='%23e8cfc4'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0 200 L0 118 Q75 96 150 108 T330 92 T510 112 T690 88 T900 110 L900 200 Z'/%3E%3C/svg%3E");
  background-size: 900px 55%; opacity: 0.38; animation-duration: 150s;
}
/* Back ridge — dusty rose */
.ridge-back {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='840' height='200' viewBox='0 0 840 200'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23c98c92'/%3E%3Cstop offset='1' stop-color='%23dcb6ae'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0 200 L0 108 L105 62 L200 116 L305 44 L420 122 L525 58 L640 118 L740 70 L840 108 L840 200 Z'/%3E%3C/svg%3E");
  background-size: 840px 72%; opacity: 0.5; animation-duration: 105s;
}
/* Mid ridge — mauve rose */
.ridge-mid {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='780' height='200' viewBox='0 0 780 200'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23a95f6e'/%3E%3Cstop offset='1' stop-color='%23c98c92'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0 200 L0 120 L90 52 L185 128 L290 38 L400 130 L500 60 L610 126 L700 54 L780 112 L780 200 Z'/%3E%3C/svg%3E");
  background-size: 780px 86%; opacity: 0.62; animation-duration: 68s;
}
/* Front ridge — deep plum-rose anchoring the scene */
.ridge-front {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='200' viewBox='0 0 720 200'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%237d4150'/%3E%3Cstop offset='1' stop-color='%23a95f6e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0 200 L0 128 L85 46 L175 138 L270 34 L370 140 L465 56 L565 134 L650 62 L720 122 L720 200 Z'/%3E%3C/svg%3E");
  background-size: 720px 100%; opacity: 0.74; animation-duration: 42s;
}
@keyframes ridgeDrift {
  from { background-position-x: 0; }
  to   { background-position-x: -840px; }
}

/* Ground mist melting the range into the page */
.ridge-mist {
  position: absolute; left: 0; right: 0; bottom: 0; height: 55%;
  background: linear-gradient(to top,
    var(--paper) 0%, rgba(250,245,238,0.75) 35%, transparent 100%);
}

/* Ornamental divider: — ♥ — */
.ornament {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin: 0 auto 1.6rem; max-width: 300px;
}
.ornament::before, .ornament::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, var(--line) 40%, var(--line) 60%, transparent);
}
.ornament-heart { font-size: 0.95rem; color: var(--rose); line-height: 1; }

/* Literary drop cap on the opening paragraph */
.dropcap > p:first-of-type::first-letter {
  font-family: var(--serif); font-weight: 600;
  font-size: 3.7rem; line-height: 0.7;
  float: left; margin: 0.32rem 0.55rem 0 0; color: var(--rose-deep);
}

/* Setting line + theme tags */
.setting-line {
  font-family: var(--serif); font-style: italic; color: var(--rose-deep);
  font-size: 1.2rem; text-align: center; margin: 2rem 0 0;
}
.themes {
  display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center;
  margin: 1.4rem 0 0; padding: 0; list-style: none;
}
.themes li {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.7rem; font-weight: 700; color: var(--rose-deep);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.95rem;
  background: rgba(255, 255, 255, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .heartbeat-path { animation: none; stroke-dashoffset: 0; }
}

/* Scroll-reveal (added by script.js; content stays visible if JS is off) */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ridge, .ridge-glow, .hero-cover { animation: none; }
}

/* ---------- Mobile refinements ---------- */
@media (max-width: 560px) {
  .site-header { padding: 0.85rem 1.1rem; }
  .brand { font-size: 1.25rem; }
  .nav-cta { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
  .section { padding: 3rem 1.2rem; }
  .hero-inner { padding: 2.5rem 1.2rem 7.5rem; }
  h1 { font-size: clamp(2.4rem, 12vw, 3.2rem); }
  .cta-row { gap: 0.7rem; }
  .btn { padding: 0.8rem 1.3rem; font-size: 0.95rem; }
  .author-portrait { width: 160px; height: 160px; }
  .reviews { grid-template-columns: 1fr; }
  .themes { gap: 0.45rem; }
  .themes li { padding: 0.35rem 0.75rem; font-size: 0.66rem; }
}
