/* ==========================================================================
   Only One Life — a quiet devotional gateway
   Design intent: restraint, whitespace, book-like typography.
   ========================================================================== */

:root {
  --paper: #F8F6F1;      /* ivory background      */
  --ink: #2B2B2B;        /* rich charcoal text    */
  --gold: #8B6B2E;       /* antique gold accent   */
  --linen: #D8CCB2;      /* soft divider lines    */
  --bronze: #70511D;     /* deep bronze / button  */
  --muted: #6B655C;      /* warm gray, secondary  */

  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 65ch;       /* max readable width    */
  --reveal-duration: 900ms;
}

/* --- Reset / base ------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Accessible-only text */
.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;
}

/* Visible, consistent focus for keyboard users */
a:focus-visible,
.enter-button:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 4px;
  border-radius: 2px;
}

/* --- Site header (upper-left, understated) ------------------------------ */

.site-header {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  left: clamp(1rem, 3vw, 2rem);
  z-index: 2;
}

.site-title {
  font-family: var(--serif);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.65;
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.hero-inner {
  position: relative;
  /* Optical centering: nudge content slightly above the true middle. */
  transform: translateY(-4vh);
  text-align: center;
  width: 100%;
}

/* Barely-perceptible morning light behind the poem */
.poem-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(120vw, 900px);
  height: min(120vw, 900px);
  transform: translate(-50%, -55%);
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    rgba(255, 250, 235, 0.9) 0%,
    rgba(248, 246, 241, 0.35) 45%,
    rgba(248, 246, 241, 0) 70%
  );
}

.poem {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  font-size: clamp(1.5rem, 5.5vw, 2.75rem);
  line-height: 1.55;
}

.poem-stanza {
  margin: 0 0 1.4em;
}

.poem-stanza:last-of-type {
  margin-bottom: 0.6em;
}

.poem-line {
  display: block;
}

.poem-attribution {
  margin-top: 2.2rem;
  font-family: var(--sans);
  font-style: italic;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  color: var(--muted);
}

/* --- Scroll indicator (breathing arrow) --------------------------------- */

.scroll-indicator {
  display: inline-block;
  margin-top: 3.5rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gold);
  text-decoration: none;
}

.js-enabled .scroll-indicator span {
  display: inline-block;
  animation: breathe 3.2s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50%      { transform: translateY(8px); opacity: 1; }
}

/* --- Ornamental divider ------------------------------------------------- */

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  max-width: 22rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}

.divider-line {
  flex: 1;
  height: 1px;
  background-color: var(--linen);
}

.divider-ornament {
  color: var(--gold);
  font-size: 1.15rem;
  line-height: 1;
}

/* --- Generic section ---------------------------------------------------- */

.section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
}

.section-heading {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--gold);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.3;
  margin: 0 0 1.8rem;
}

.prose p {
  margin: 0 auto 1.3rem;
  max-width: 60ch;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* --- What You'll Find panels ------------------------------------------- */

.panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-top: 1rem;
}

.panel {
  padding: 1.75rem 1rem;
  border-top: 1px solid var(--linen);
}

.panel-title {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--bronze);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  margin: 0 0 0.6rem;
}

.panel-text {
  margin: 0;
  color: var(--muted);
}

/* --- Continue / button -------------------------------------------------- */

.continue {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.enter-button {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.85rem 3rem;
  font-family: var(--sans);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bronze);
  background-color: transparent;
  border: 1px solid var(--gold);
  border-radius: 2px;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.enter-button:hover,
.enter-button:focus-visible {
  color: var(--paper);
  background-color: var(--bronze);
  border-color: var(--bronze);
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  text-align: center;
}

.scripture {
  margin: 0 0 1.5rem;
}

.scripture-verse {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  max-width: 50ch;
  margin: 0 auto 0.75rem;
}

.scripture-ref {
  display: block;
  font-style: normal;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.copyright {
  margin: 2rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0.8;
}

/* --- Desktop layout ----------------------------------------------------- */

@media (min-width: 720px) {
  .panels {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }

  .panel {
    border-top: none;
    padding: 0.5rem 1.25rem;
  }

  /* Thin vertical hairlines between columns instead of shadows/cards */
  .panel + .panel {
    border-left: 1px solid var(--linen);
  }
}

/* ==========================================================================
   Progressive-enhancement reveal states
   Default (no-JS): everything fully visible.
   With .js-enabled: start hidden, then reveal via added classes.
   ========================================================================== */

/* Poem line-by-line reveal (only when JS is active) */
.js-enabled .poem-line {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--reveal-duration) ease, transform var(--reveal-duration) ease;
}

.js-enabled .poem-line.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll-in reveal for sections (only when JS is active) */
.js-enabled .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.js-enabled .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Reduced motion: show everything immediately, no animation ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js-enabled .poem-line,
  .js-enabled .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .js-enabled .scroll-indicator span {
    animation: none !important;
  }
}
