:root {
  --paper: #f1e7d2;
  --paper-deep: #e8dcc2;
  --ink: #1c1814;
  --ink-soft: #3a322a;
  --ink-mute: #6b5d4d;
  --burgundy: #7a2418;
  --burgundy-deep: #5a1a10;
  --gold: #a47830;
  --rule: #b8a988;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
  background-image:
    radial-gradient(ellipse at top left, rgba(122, 36, 24, 0.06), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(164, 120, 48, 0.08), transparent 50%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.11  0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(28, 24, 20, 0.18) 100%);
}

.container {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 32px 96px;
}

/* HEADER */
header {
  text-align: center;
  margin-bottom: 48px;
}

.crest {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
  color: var(--ink-mute);
  opacity: 0;
  animation: fadeIn 0.8s ease 0.1s forwards;
}

.crest-line {
  width: 60px;
  height: 1px;
  background: var(--rule);
}

.crest-mark {
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--burgundy);
}

/* THE VERSUS → VERSES ANIMATION */
.hero-versus {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 400;
  color: var(--ink-mute);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.versus-word {
  position: relative;
  display: inline-block;
  color: var(--ink-soft);
  font-style: normal;
  opacity: 0;
  animation: fadeIn 0.7s ease 0.6s forwards;
}

.versus-text { position: relative; }

.strike-line {
  position: absolute;
  left: -2px;
  right: -2px;
  top: 52%;
  height: 1.5px;
  background: var(--burgundy);
  transform: scaleX(0);
  transform-origin: left;
  animation: strikeThrough 0.7s cubic-bezier(.7,.2,.3,1) 1.4s forwards;
}

.hero-versus .arrow {
  display: inline-block;
  color: var(--burgundy);
  font-style: normal;
  transform: translateY(-1px);
  opacity: 0;
  animation: fadeIn 0.5s ease 2.0s forwards;
}

.hero-versus .answer {
  color: var(--burgundy);
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.22em;
  opacity: 0;
  transform: translateY(4px);
  animation: rise 0.7s cubic-bezier(.16,1,.3,1) 2.3s forwards;
  text-shadow: 0 0 0 transparent;
}

@keyframes strikeThrough {
  to { transform: scaleX(1); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
    text-shadow: 0 0 16px rgba(122, 36, 24, 0.2);
  }
}

h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(56px, 10vw, 120px);
  line-height: 0.92;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 22px;
  opacity: 0;
  animation: rise 0.9s cubic-bezier(.16,1,.3,1) 2.9s forwards;
}

h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--burgundy);
}

.tagline {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--ink-soft);
  max-width: 620px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeIn 0.9s ease 3.3s forwards;
}

.tagline em { color: var(--burgundy); font-weight: 500; }

/* TRANSLATION SWITCH */
.translation-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin: 36px auto 8px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeIn 0.8s ease 3.6s forwards;
}

.translation-label {
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-right: 18px;
}

.translation-pills {
  display: inline-flex;
  border: 1px solid rgba(28, 24, 20, 0.25);
  background: rgba(241, 231, 210, 0.5);
  flex-wrap: wrap;
}

.pill {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 9px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-right: 1px solid rgba(28, 24, 20, 0.15);
}

.pill:last-child { border-right: none; }

.pill:hover {
  color: var(--burgundy);
  background: rgba(122, 36, 24, 0.05);
}

.pill.active {
  background: var(--ink);
  color: var(--paper);
}

.translation-name {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 6px;
  opacity: 0;
  animation: fadeIn 0.8s ease 3.8s forwards;
}

/* ORNAMENT */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 44px auto 32px;
  color: var(--rule);
  opacity: 0;
  animation: fadeIn 0.8s ease 3.9s forwards;
}

.ornament .line {
  flex: 0 1 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule), transparent);
}

.ornament .glyph {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: var(--burgundy);
  transform: translateY(-2px);
}

.section-label {
  font-family: 'Cormorant SC', serif;
  font-size: 12px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: center;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeIn 0.8s ease 4.0s forwards;
}

/* THEME GRID */
.themes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  max-width: 880px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeIn 0.8s ease 4.1s forwards;
}

.theme {
  appearance: none;
  border: 1px solid rgba(28, 24, 20, 0.18);
  background: transparent;
  color: var(--ink);
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(.25,.46,.45,.94);
  position: relative;
  overflow: hidden;
}

.theme::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.35s cubic-bezier(.25,.46,.45,.94);
  z-index: -1;
}

.theme:hover {
  color: var(--paper);
  border-color: var(--ink);
}

.theme:hover::before { transform: scaleY(1); }

.theme.active {
  background: var(--burgundy);
  color: var(--paper);
  border-color: var(--burgundy);
}

.theme.active::before { display: none; }

/* VERSE STAGE */
.stage {
  margin-top: 72px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder {
  text-align: center;
  color: var(--ink-mute);
  font-style: italic;
  font-size: 18px;
  opacity: 0.7;
}

.verse-card {
  max-width: 760px;
  text-align: center;
  padding: 0 16px;
  animation: cardRise 0.9s cubic-bezier(.16,1,.3,1) both;
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.verse-badge {
  display: inline-block;
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--burgundy);
  padding: 4px 14px;
  border: 1px solid rgba(122, 36, 24, 0.3);
  margin-bottom: 22px;
  background: rgba(122, 36, 24, 0.04);
}

.verse-theme {
  font-family: 'Cormorant SC', serif;
  font-size: 13px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-bottom: 28px;
}

.verse-quote {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.35;
  color: var(--ink);
  font-style: italic;
  margin-bottom: 32px;
  text-wrap: balance;
}

.verse-quote::before,
.verse-quote::after {
  content: '"';
  color: var(--burgundy);
  font-family: 'Cormorant Garamond', serif;
  font-style: normal;
  font-size: 1em;
  opacity: 0.6;
}

.verse-quote::before { margin-right: 0.1em; }
.verse-quote::after { margin-left: 0.1em; }

.verse-ref {
  font-family: 'Cormorant SC', serif;
  font-size: 14px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  display: inline-block;
  padding: 0 24px;
}

.verse-ref::before,
.verse-ref::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 32px;
  height: 1px;
  background: var(--rule);
}

.verse-ref::before { right: 100%; }
.verse-ref::after { left: 100%; }

.verse-translation {
  display: block;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--ink-mute);
  margin-top: 8px;
  font-weight: 400;
}

/* LOADING STATE */
.verse-loading {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 40px 0;
}

.verse-loading .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--burgundy);
  opacity: 0.3;
  animation: dotPulse 1.2s ease-in-out infinite;
}

.verse-loading .dot:nth-child(2) { animation-delay: 0.2s; }
.verse-loading .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.verse-error {
  color: var(--ink-mute);
  font-style: italic;
  font-size: 16px;
  text-align: center;
  padding: 20px;
}

.verse-error button {
  display: block;
  margin: 16px auto 0;
}

/* ACTIONS */
.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: 'Cormorant SC', serif;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  padding: 12px 22px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn.primary {
  border-color: var(--burgundy);
  color: var(--burgundy);
}

.btn.primary:hover {
  background: var(--burgundy);
  color: var(--paper);
}

/* FOOTER */
footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 32px 24px;
  color: var(--ink-mute);
  font-style: italic;
  font-size: 14px;
  line-height: 1.7;
}

footer a {
  color: var(--burgundy);
  text-decoration: none;
  border-bottom: 1px solid rgba(122, 36, 24, 0.3);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}

footer a:hover { border-bottom-color: var(--burgundy); }

footer .footer-logo {
  display: inline-block;
  border: none;
  padding: 0;
  margin-bottom: 14px;
  border-radius: 50%;
  transition: transform 0.3s ease;
}
footer .footer-logo:hover { transform: scale(1.04); }
footer .footer-logo img { display: block; width: 96px; height: 96px; }

.footer-brand {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.footer-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-family: 'Cormorant SC', serif;
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.footer-social span { color: var(--rule); }

.modal p a {
  color: var(--burgundy);
  text-decoration: none;
  border-bottom: 1px solid rgba(122, 36, 24, 0.3);
}

footer .small {
  display: block;
  font-style: normal;
  font-family: 'Cormorant SC', serif;
  font-size: 10px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 4px;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  font-family: 'Cormorant SC', serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  padding: 14px 26px;
  border: 1px solid var(--burgundy);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 20, 0.55);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--paper);
  max-width: 560px;
  width: 100%;
  padding: 48px 40px;
  position: relative;
  border: 1px solid rgba(28, 24, 20, 0.2);
  box-shadow: 0 20px 60px rgba(28, 24, 20, 0.3);
  max-height: 85vh;
  overflow-y: auto;
}

.modal h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 32px;
  color: var(--ink);
  margin-bottom: 20px;
}

.modal p {
  font-family: 'EB Garamond', serif;
  color: var(--ink-soft);
  margin-bottom: 14px;
  line-height: 1.65;
}

.modal p em {
  color: var(--burgundy);
}

.modal-sub {
  font-size: 14px;
  color: var(--ink-mute);
  font-style: italic;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  appearance: none;
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--ink-mute);
  cursor: pointer;
  font-family: 'Cormorant Garamond', serif;
  line-height: 1;
}

.modal-close:hover { color: var(--burgundy); }

/* RESPONSIVE */
@media (max-width: 600px) {
  .container { padding: 40px 20px 60px; }
  .themes {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .theme {
    font-size: 17px;
    padding: 12px 14px;
  }
  .ornament .line { flex-basis: 60px; }
  .translation-bar { flex-direction: column; gap: 12px; }
  .translation-label { margin-right: 0; }
  .pill { padding: 8px 13px; font-size: 10px; letter-spacing: 0.22em; }
  .hero-versus { font-size: 14px; gap: 10px; letter-spacing: 0.14em; }
  .modal { padding: 36px 24px; }
  .footer-social span { display: none; }
  .footer-social { gap: 6px 18px; }
}

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