/* --- Queens & Gods — Antique / Mystical Landing --- */
:root {
  --bg-dark: #1a1816;
  --bg-charcoal: #252220;
  --gold: #b8860b;
  --gold-light: #d4a84b;
  --gold-muted: #8b7355;
  --bronze: #8b6914;
  --text-dark: #2c2825;
  --text-body: #c9c4be;
  --text-muted: #9a948c;
  --parchment: #e8e0d4;
  --parchment-dark: #d4c8b8;
  --border-subtle: rgba(184, 134, 11, 0.25);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Source Sans 3", system-ui, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg-dark);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background image at 40% opacity (60% transparent) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("assets/background.png") center center / cover no-repeat fixed;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

/* Vignette overlay so content stays readable */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(184, 134, 11, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 100% 100% at 50% 50%, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
  z-index: 0;
}

/* --- Skip link (accessibility) --- */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--gold);
  color: var(--text-dark);
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

/* --- Scroll reveal (JS adds .revealed) --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal.revealed { opacity: 1; transform: none; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Hero --- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem 4rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: color-mix(in srgb, var(--gold-muted) 80%, white 20%);
  font-weight: 400;
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

/* Tap/hover feedback: subtle scale on press, lift on hover */
.btn:active {
  transform: scale(0.98);
}
.btn:hover:active {
  transform: scale(0.98);
}

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--gold);
  color: var(--text-dark);
  border: none;
  box-shadow: 0 2px 12px rgba(184, 134, 11, 0.35);
}

.btn-primary:hover {
  background: var(--gold-light);
}

.btn-secondary {
  background: transparent;
  color: var(--gold-light);
  border: 2px solid var(--gold-muted);
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

.btn-small {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
}

.arrow {
  font-size: 1.1em;
}

/* --- Divider --- */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
  margin: 0 auto;
  max-width: 60%;
}

/* --- Quote Section --- */
.quote-section {
  position: relative;
  z-index: 1;
  padding: 3rem 1.5rem;
  text-align: center;
}

.quote-main {
  font-family: var(--font-sans);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 400;
  color: var(--text-body);
  font-style: normal;
  max-width: 520px;
  margin: 0 auto;
}

/* --- Section Title (with flanking lines) --- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

.title-line {
  width: 40px;
  height: 2px;
  background: var(--gold-muted);
  opacity: 0.8;
}

/* --- Voices from the Margins --- */
.voices-section {
  position: relative;
  z-index: 1;
  padding: 4rem 1.5rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.character-card {
  background: rgba(37, 34, 32, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s, box-shadow 0.2s;
}

.character-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.character-portrait {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin-bottom: 1rem;
  background: linear-gradient(145deg, var(--bg-charcoal), var(--bg-dark));
  border: 2px solid var(--border-subtle);
  background-size: cover;
  background-position: center;
}

/* Character portraits from assets */
.portrait-eve       { background-color: #3d352d; background-image: url("assets/eve.png"); }
.portrait-bathsheba { background-color: #3d352d; background-image: url("assets/bathsheba.png"); }
.portrait-abishag   { background-color: #3d352d; background-image: url("assets/abishag.png"); }
.portrait-yael      { background-color: #3d352d; background-image: url("assets/yael.png"); }
.portrait-makeda    { background-color: #3d352d; background-image: url("assets/makeda.png"); }

.character-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 0.35rem;
}

.character-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.character-card .btn {
  margin-top: auto;
}

/* --- Faith in the Silence --- */
.themes-section {
  position: relative;
  z-index: 1;
  padding: 4rem 1.5rem 5rem;
  text-align: center;
}

.themes-keywords {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 400;
  color: var(--text-body);
}

.themes-keywords .star {
  color: var(--gold-muted);
  font-size: 0.7em;
  user-select: none;
}

/* --- Excerpt Section --- */
.excerpt-section {
  position: relative;
  z-index: 1;
  padding: 4rem 1.5rem 5rem;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.excerpt-content {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text-body);
}

.excerpt-content p {
  margin-bottom: 1.25rem;
}

.excerpt-content p:last-child {
  margin-bottom: 0;
}

.excerpt-content em {
  color: var(--gold-muted);
  font-style: italic;
}

/* --- Scroll & Book Section --- */
.scroll-section {
  position: relative;
  z-index: 1;
  padding: 4rem 1.5rem 6rem;
  max-width: 1100px;
  margin: 0 auto;
}

.scroll-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  position: relative;
}

.scroll-parchment {
  flex: 1 1 320px;
  max-width: 560px;
  background: linear-gradient(180deg, var(--parchment) 0%, var(--parchment-dark) 100%);
  padding: 2.5rem 2rem;
  border-radius: 4px;
  box-shadow:
    inset 0 0 60px rgba(139, 115, 85, 0.15),
    0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  border: 1px solid rgba(139, 115, 85, 0.3);
}

/* Torn / rough edges effect */
.scroll-parchment::before,
.scroll-parchment::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  background: linear-gradient(90deg, transparent 0%, var(--parchment-dark) 20%, var(--parchment-dark) 80%, transparent 100%);
  opacity: 0.6;
  filter: blur(1px);
}

.scroll-parchment::before { top: -2px; }
.scroll-parchment::after { bottom: -2px; }

.scroll-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.6;
  text-align: center;
  font-style: italic;
}

.scroll-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-style: normal;
  font-size: 0.95em;
  color: var(--bronze);
}

/* Book cover image */
.book-cover {
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}

.book-cover .book-img {
  display: block;
  max-width: 200px;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* All images scale to container on any screen */
img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* --- Enter the Margins (CTA) --- */
.cta-section {
  position: relative;
  z-index: 1;
  padding: 4rem 1.5rem 5rem;
  text-align: center;
}

.cta-title {
  margin-bottom: 1.5rem;
}

.cta-title .title-line {
  display: none;
}

.mailing-block {
  margin-bottom: 2rem;
}

.mailing-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  max-width: 420px;
  margin: 0 auto;
}

.mailing-form input {
  flex: 1 1 200px;
  min-width: 180px;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 2px solid var(--border-subtle);
  background: rgba(37, 34, 32, 0.8);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.mailing-form input::placeholder {
  color: var(--text-muted);
}

.mailing-form input:focus {
  border-color: var(--gold-muted);
  outline: none;
}

.mailing-message {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--gold-light);
}

.mailing-message.error {
  color: #c9a86c;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* --- Footer --- */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 3rem 1.5rem 4rem;
  text-align: center;
}

.site-footer .divider {
  margin-bottom: 2rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.social-icon {
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}

.social-icon:hover {
  color: var(--gold-light);
  transform: scale(1.1);
}

.social-icon svg {
  width: 24px;
  height: 24px;
}

/* --- Back to top --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 50;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: var(--text-dark);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--gold-light);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

/* ========== Mobile-responsive (screens under 768px) ========== */

/* 6. Background: prevent cropping/overflow on mobile — scroll with content */
@media (max-width: 768px) {
  body::before {
    background-attachment: scroll;
    background-size: cover;
    background-position: center center;
  }
}

@media (max-width: 768px) {
  /* 7. Base typography: line height and readable font sizes */
  body {
    line-height: 1.7;
    font-size: 1rem;
  }

  /* 1. Padding/margins for text blocks */
  .hero {
    padding: 2rem 1.25rem 3rem;
    min-height: 100svh;
  }

  .quote-section {
    padding: 2.25rem 1.25rem;
  }

  .quote-main {
    font-size: clamp(1rem, 4vw, 1.15rem);
    line-height: 1.65;
    margin: 0 auto;
    padding: 0 1rem;
    max-width: 100%;
  }

  .voices-section {
    padding: 3rem 1.25rem 4rem;
  }

  .excerpt-section {
    padding: 3rem 1.25rem 4rem;
  }

  .excerpt-content {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    line-height: 1.75;
    padding: 0 1rem;
  }

  .excerpt-content p {
    margin-bottom: 1.35rem;
  }

  .scroll-parchment {
    padding: 1.75rem 1.25rem;
  }

  .scroll-quote {
    line-height: 1.65;
  }

  .cta-section {
    padding: 3rem 1.25rem 4rem;
  }

  .site-footer {
    padding: 2rem 1.25rem 3rem;
  }

  /* 3. Headings and paragraphs resize for readability */
  .hero-title {
    font-size: clamp(2.25rem, 12vw, 3.5rem);
    line-height: 1.15;
    margin-bottom: 0.5rem;
  }

  .hero-subtitle {
    margin-bottom: 1.75rem;
    font-size: clamp(0.95rem, 4vw, 1.15rem);
    line-height: 1.4;
  }

  .section-title {
    font-size: clamp(1.5rem, 6vw, 1.85rem);
    line-height: 1.3;
    margin-bottom: 1.75rem;
    padding: 0 1rem;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .title-line {
    width: 24px;
  }

  .character-name {
    font-size: clamp(1.1rem, 4vw, 1.2rem);
  }

  .character-desc {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    line-height: 1.45;
    margin-bottom: 0.75rem;
  }

  /* 2. Stack side-by-side content vertically */
  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    gap: 0.875rem;
  }

  .scroll-wrapper {
    flex-direction: column;
    gap: 1.5rem;
  }

  .scroll-parchment {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
  }

  .book-cover {
    order: -1;
  }

  .mailing-form {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
  }

  .cta-buttons {
    flex-direction: column;
    max-width: 300px;
    margin: 0 auto;
  }

  /* 4. Buttons: larger and spaced for touch (min 44px, generous gap) */
  .hero-buttons .btn,
  .cta-buttons .btn,
  .mailing-form button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    padding: 0.9rem 1.5rem;
    gap: 0.5rem;
  }

  .character-card .btn {
    min-height: 44px;
    padding: 0.7rem 1.25rem;
    font-size: 0.875rem;
  }

  /* 5. Images scale to fit mobile width */
  .book-cover .book-img {
    max-width: min(180px, 100%);
    width: 100%;
    height: auto;
  }

  .character-portrait {
    width: 80px;
    height: 80px;
    margin-bottom: 0.75rem;
    max-width: 100%;
  }

  .character-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    padding: 0 0.75rem;
  }

  .character-card {
    max-width: none;
    padding: 1.25rem 1rem;
  }

  .themes-section {
    padding: 3rem 1.25rem 4rem;
  }

  .themes-keywords {
    flex-direction: column;
    gap: 0.6rem;
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    line-height: 1.5;
    padding: 0 1rem;
  }

  .themes-keywords .star {
    display: none;
  }

  .scroll-section {
    padding: 3rem 1.25rem 4rem;
  }

  .scroll-quote {
    font-size: clamp(1.1rem, 3vw, 1.2rem);
  }

  .mailing-form input {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0.9rem 1rem;
  }

  .social-links {
    gap: 1.5rem;
  }

  .social-icon {
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .social-icon svg {
    width: 28px;
    height: 28px;
  }

  .back-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }

  .divider {
    margin: 0 auto;
    max-width: 80%;
  }
}

/* Extra small phones */
@media (max-width: 480px) {
  .hero {
    padding: 1.75rem 1rem 2.5rem;
  }

  .hero-title {
    font-size: clamp(1.85rem, 10vw, 2.25rem);
  }

  .quote-main,
  .excerpt-content {
    padding: 0 0.75rem;
  }

  .character-grid {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin: 0 auto;
    padding: 0 1rem;
  }

  .character-card {
    max-width: 280px;
  }

  .divider {
    max-width: 85%;
  }
}

/* 8. Tap effects: subtle feedback on touch (active state) */
@media (hover: none) and (pointer: coarse) {
  .btn:hover {
    transform: none;
  }

  .btn:active {
    transform: scale(0.97);
    opacity: 0.95;
  }

  .character-card:hover {
    transform: none;
  }

  .character-card:active {
    transform: scale(0.99);
  }

  .social-icon:hover {
    transform: none;
  }

  .social-icon:active {
    transform: scale(1.1);
    color: var(--gold-light);
  }

  .back-to-top:active {
    transform: scale(0.95);
  }
}
