/* ========================================================================
   KASSANDRA KINGSWELL — SHADOWBOUND SERIES
   Warm editorial dark. Gold serif. Cozy bookish witchery.
   ======================================================================== */

/* --- Tokens --- */
:root {
  /* Core */
  --bg: #1B0E14;
  --bg-elevated: #251720;
  --bg-deep: #15090E;
  --bg-tint: rgba(212, 160, 74, 0.04);

  /* Text */
  --ink: #F5EDE0;
  --ink-muted: #A89789;
  --ink-subtle: #6B5D54;

  /* Gold (matches book cover typography) */
  --gold: #D4A04A;
  --gold-light: #E8B65C;
  --gold-deep: #8B6A30;
  --gold-soft: rgba(212, 160, 74, 0.12);

  /* Per-book accents */
  --eternal: #E5876B;       /* warm pink/orange */
  --fated: #9B7BAB;         /* dusty purple */
  --severed: #C9A24A;       /* deep gold */

  /* Layout */
  --measure: 68ch;
  --gutter: clamp(1.5rem, 4vw, 3rem);
  --section-y: clamp(5rem, 12vw, 9rem);

  /* Type — variable Fraunces axis cheats for max character */
  --display: "Fraunces", "Times New Roman", serif;
  --body: "Newsreader", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at top right, rgba(212, 160, 74, 0.08), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(155, 123, 171, 0.06), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern", "liga", "onum";
  overflow-x: hidden;
}
img, picture { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Selection */
::selection { background: var(--gold); color: var(--bg); }

/* Focus */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 2px;
}

/* --- Typography --- */
.display {
  font-family: var(--display);
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 72, "SOFT" 50;
}
h1 { font-size: clamp(2.5rem, 8vw, 5.75rem); }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: clamp(1.125rem, 1.6vw, 1.375rem); }

.eyebrow {
  font-family: var(--body);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  font-feature-settings: "lnum";
}
.italic { font-style: italic; font-variation-settings: "opsz" 72, "SOFT" 100; }
em { font-style: italic; }

/* --- Layout primitives --- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-narrow {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: var(--section-y) 0; position: relative; }
.divider {
  width: 1px;
  height: 60px;
  background: var(--gold);
  margin: 0 auto;
  opacity: 0.4;
}

/* --- Header / Nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1.25rem var(--gutter);
  background: rgba(27, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 160, 74, 0.1);
}
.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  font-family: var(--display);
  font-variation-settings: "opsz" 14, "SOFT" 50;
  font-size: 1.0625rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
}
.brand em {
  display: block;
  font-style: italic;
  font-variation-settings: "opsz" 14, "SOFT" 100;
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-style: normal;
  margin-top: 2px;
}
.nav { display: flex; gap: 2rem; align-items: center; }
.nav a {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.2s ease;
  position: relative;
  padding: 0.25rem 0;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--gold);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--gold-soft);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--ink);
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-deep);
    padding: 1.5rem var(--gutter);
    gap: 0;
    border-bottom: 1px solid rgba(212, 160, 74, 0.15);
    transform: translateY(-110%);
    transition: transform 0.3s ease;
  }
  .nav[data-open="true"] { transform: translateY(0); }
  .nav a {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(212, 160, 74, 0.08);
  }
  .nav a:last-child { border-bottom: none; }
}

/* --- Hero (home) --- */
.hero {
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: 4rem 0 6rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(229, 135, 107, 0.08), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(155, 123, 171, 0.08), transparent 40%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  position: relative;
}
.hero-text > .eyebrow { display: block; margin-bottom: 1.75rem; }
.hero-title {
  font-size: clamp(3rem, 9vw, 6.75rem);
  font-variation-settings: "opsz" 144, "SOFT" 50, "wght" 400;
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin-bottom: 1.75rem;
}
.hero-title em {
  display: block;
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 300;
  color: var(--gold);
  font-size: 0.85em;
  margin-top: 0.1em;
}
.hero-tag {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-muted);
  max-width: 38ch;
  line-height: 1.55;
  margin-bottom: 2.5rem;
  font-style: italic;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Cover stack */
.cover-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  margin: 0 auto;
}
.cover-stack img {
  position: absolute;
  border-radius: 4px;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 18px 36px -18px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(212, 160, 74, 0.08);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
  background: var(--bg-deep);
}
.cover-stack img:nth-child(1) {
  width: 50%; top: 8%; left: 4%;
  transform: rotate(-7deg);
  z-index: 1;
}
.cover-stack img:nth-child(2) {
  width: 52%; top: 0; left: 24%;
  z-index: 3;
}
.cover-stack img:nth-child(3) {
  width: 48%; top: 14%; right: 4%;
  transform: rotate(6deg);
  z-index: 2;
}
.cover-stack:hover img:nth-child(1) { transform: rotate(-9deg) translateX(-6px); }
.cover-stack:hover img:nth-child(2) { transform: translateY(-8px); }
.cover-stack:hover img:nth-child(3) { transform: rotate(8deg) translateX(6px); }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 4rem; }
  .cover-stack { max-width: 440px; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.95rem 1.6rem;
  font-family: var(--body);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--gold);
  border-radius: 2px;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  font-weight: 500;
}
.btn:hover { background: var(--gold); color: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: var(--bg); }
.btn-primary:hover { background: var(--gold-light); color: var(--bg); }
.btn-ghost { border-color: var(--gold-soft); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-light); }

.btn-arrow::after {
  content: "→";
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
  font-family: var(--body);
}
.btn-arrow:hover::after { transform: translateX(4px); }

/* --- Series section --- */
.series-intro {
  max-width: 720px;
  margin: 0 auto 5rem;
  text-align: center;
}
.series-intro .eyebrow { display: block; margin-bottom: 1.25rem; }

.book-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.4fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: 5rem 0;
  border-top: 1px solid rgba(212, 160, 74, 0.12);
  position: relative;
}
.book-row:last-child { border-bottom: 1px solid rgba(212, 160, 74, 0.12); }
.book-row.reverse { grid-template-columns: 1.4fr minmax(0, 1fr); }
.book-row.reverse .book-cover-wrap { order: 2; }
.book-row.reverse .book-info { order: 1; }

.book-cover-wrap {
  position: relative;
}
.book-cover-wrap img {
  border-radius: 4px;
  box-shadow:
    0 24px 50px -16px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(212, 160, 74, 0.1);
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}
.book-cover-wrap:hover img { transform: translateY(-6px); }

.book-info { max-width: 580px; }
.book-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.book-meta-divider { width: 24px; height: 1px; background: var(--gold); opacity: 0.5; }

.book-title {
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-variation-settings: "opsz" 144, "SOFT" 50;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.book-tagline {
  font-style: italic;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--gold-light);
  font-variation-settings: "opsz" 24, "SOFT" 100;
  margin-bottom: 1.75rem;
  line-height: 1.4;
  font-family: var(--display);
}

.book-blurb {
  color: var(--ink);
  margin-bottom: 1.5rem;
  font-size: 1.02rem;
  line-height: 1.65;
}
.book-blurb p + p { margin-top: 1rem; }

.tropes {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
}
.tropes li {
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(212, 160, 74, 0.25);
  border-radius: 100px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

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

.coming-tag {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--bg);
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 0.35rem 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 2px;
  z-index: 2;
}

@media (max-width: 760px) {
  .book-row, .book-row.reverse {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3.5rem 0;
  }
  .book-row.reverse .book-cover-wrap { order: 0; }
  .book-row.reverse .book-info { order: 1; }
}

/* --- About teaser --- */
.about-teaser {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.about-portrait {
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.7);
  position: relative;
}
.about-portrait img { display: block; width: 100%; }
.about-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(212, 160, 74, 0.15);
  border-radius: 4px;
  pointer-events: none;
}
.about-text > .eyebrow { display: block; margin-bottom: 1.25rem; }
.about-text h2 { margin-bottom: 1.5rem; max-width: 14ch; }
.about-text p { color: var(--ink); margin-bottom: 1rem; max-width: 50ch; }
.about-text .btn { margin-top: 1.5rem; }

@media (max-width: 760px) {
  .about-teaser { grid-template-columns: 1fr; }
  .about-portrait { max-width: 420px; margin: 0 auto; }
}

/* --- Reviews / pull quote --- */
.review-section { background: var(--bg-deep); }
.review {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.stars { color: var(--gold); font-size: 1.4rem; letter-spacing: 0.2em; margin-bottom: 2rem; }
.review-quote {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-variation-settings: "opsz" 72, "SOFT" 100;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}
.review-quote::before { content: "\201C"; color: var(--gold); margin-right: 0.1em; }
.review-quote::after { content: "\201D"; color: var(--gold); margin-left: 0.05em; }
.review-attr {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.review-attr a { color: var(--gold); border-bottom: 1px solid transparent; padding-bottom: 1px; transition: border-color 0.2s; }
.review-attr a:hover { border-color: var(--gold); }

/* --- Newsletter section --- */
.newsletter-block {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(2rem, 5vw, 4rem);
  border: 1px solid rgba(212, 160, 74, 0.18);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(212, 160, 74, 0.04), transparent),
    var(--bg-elevated);
  position: relative;
}
.newsletter-block::before, .newsletter-block::after {
  content: "";
  position: absolute;
  width: 24px; height: 24px;
  border: 1px solid var(--gold);
  opacity: 0.4;
}
.newsletter-block::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.newsletter-block::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.newsletter-block .eyebrow { display: block; margin-bottom: 1rem; }
.newsletter-block h2 { margin-bottom: 1rem; }
.newsletter-block p {
  color: var(--ink-muted);
  font-size: 1.05rem;
  max-width: 50ch;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 460px;
  margin: 0 auto;
}
.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.95rem 1.1rem;
  background: var(--bg);
  border: 1px solid rgba(212, 160, 74, 0.25);
  color: var(--ink);
  border-radius: 2px;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}
.newsletter-form input[type="email"]::placeholder { color: var(--ink-subtle); }
.newsletter-form input[type="email"]:focus { border-color: var(--gold); outline: none; }
.newsletter-note {
  font-size: 0.8rem;
  color: var(--ink-subtle);
  margin-top: 1.25rem;
  font-style: italic;
}

@media (max-width: 540px) {
  .newsletter-form { flex-direction: column; }
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid rgba(212, 160, 74, 0.12);
  padding: 4rem 0 3rem;
  background: var(--bg-deep);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand h3 {
  font-size: 1.5rem;
  font-variation-settings: "opsz" 32, "SOFT" 50;
  margin-bottom: 0.5rem;
}
.footer-brand p { color: var(--ink-muted); font-size: 0.95rem; max-width: 30ch; line-height: 1.55; font-style: italic; }
.footer-col h4 {
  font-family: var(--body);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a {
  color: var(--ink-muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  border-top: 1px solid rgba(212, 160, 74, 0.08);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-subtle);
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* --- Inner-page hero (Books, About, Newsletter) --- */
.page-hero {
  padding: clamp(5rem, 10vw, 8rem) 0 clamp(3rem, 6vw, 5rem);
  text-align: center;
  position: relative;
}
.page-hero .eyebrow { display: block; margin-bottom: 1.5rem; }
.page-hero h1 {
  font-size: clamp(2.5rem, 7vw, 5.25rem);
  font-variation-settings: "opsz" 144, "SOFT" 50;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
}
.page-hero .lede {
  max-width: 56ch;
  margin: 0 auto;
  color: var(--ink-muted);
  font-style: italic;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.55;
}
.page-hero::after {
  content: "";
  display: block;
  width: 1px;
  height: 60px;
  background: var(--gold);
  margin: 3rem auto 0;
  opacity: 0.5;
}

/* --- About page --- */
.about-full {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}
.about-full-portrait {
  position: sticky;
  top: 100px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.7);
}
.about-prose p { margin-bottom: 1.25rem; font-size: 1.05rem; line-height: 1.7; }
.about-prose p:first-of-type::first-line { font-variant: small-caps; letter-spacing: 0.04em; }
.about-prose .pull {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-style: italic;
  font-variation-settings: "opsz" 72, "SOFT" 100;
  color: var(--gold);
  line-height: 1.35;
  padding: 2rem 0;
  border-top: 1px solid rgba(212, 160, 74, 0.18);
  border-bottom: 1px solid rgba(212, 160, 74, 0.18);
  margin: 2.5rem 0;
}

@media (max-width: 880px) {
  .about-full { grid-template-columns: 1fr; }
  .about-full-portrait { position: static; max-width: 420px; margin: 0 auto; }
}

/* --- Book page (single book detail) --- */
.book-detail {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}
.book-detail-cover {
  position: sticky;
  top: 100px;
}

@media (max-width: 880px) {
  .book-detail { grid-template-columns: 1fr; }
  .book-detail-cover { position: static; max-width: 380px; margin: 0 auto; }
}

/* --- Decorative diamond divider (matches book covers) --- */
.diamond-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 2.5rem auto;
  color: var(--gold);
  opacity: 0.6;
}
.diamond-divider::before, .diamond-divider::after {
  content: "";
  width: 80px;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
}
.diamond-divider span { font-size: 0.6rem; letter-spacing: 0.5em; }

/* --- Animations --- */
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.18s; }
.rise-3 { animation-delay: 0.32s; }
.rise-4 { animation-delay: 0.46s; }
.rise-5 { animation-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Utilities --- */
.text-gold { color: var(--gold); }
.center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
