/* O God, Guide Me — styles */

:root {
  --gold: #d9a86c;
  --cream: #f6efe3;
  --rose: #c99a94;
  --sage: #a8b8a0;
  --lavender: #b9aecf;
  --dawn: #a9bdd4;
  --ink: #4a4036;
}

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

html {
  scroll-behavior: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: none;
}

body {
  font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior: none;
}

/* Scroll driver — total journey height */
#scroll-space { height: 800vh; position: relative; }
.snap-pt {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  scroll-snap-align: start;
  pointer-events: none;
}

/* Fixed canvas */
#scene-container {
  position: fixed;
  inset: 0;
  z-index: 1;
}
#scene-container canvas { display: block; }

/* Nine-pointed star watermark */
#watermark {
  position: fixed;
  top: 50%; left: 50%;
  width: min(80vmin, 640px);
  height: min(80vmin, 640px);
  transform: translate(-50%, -50%);
  z-index: 2;
  opacity: 0.05;
  pointer-events: none;
}
#watermark svg { width: 100%; height: 100%; }

/* Phrases */
#phrases {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.phrase {
  position: absolute;
  left: 50%;
  top: 72%;
  transform: translateX(-50%) translateY(12px);
  font-size: clamp(2rem, 5.5vw, 3.8rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.1em;
  text-align: center;
  opacity: 0;
  white-space: nowrap;
  transition: none;
  text-shadow: 0 0 34px rgba(255, 216, 150, 0.35), 0 1px 3px rgba(10, 8, 20, 0.35);
}
.phrase[data-phase="2"],
.phrase[data-phase="3"],
.phrase[data-phase="4"] { white-space: normal; width: 92vw; }

/* Final prayer — line-by-line reveal over the night sky */
#final-prayer {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  padding: 0 6vw;
  color: #f8f2e6;
  transform: translateY(13vh);   /* sit below the star — let it breathe */
}
.prayer-line {
  font-size: clamp(1.4rem, 3.4vw, 2.3rem);
  line-height: 1.9;
  letter-spacing: 0.09em;
  opacity: 0;
  text-shadow: 0 0 30px rgba(255, 216, 150, 0.3), 0 1px 3px rgba(10, 8, 20, 0.4);
}
#prayer-footer {
  opacity: 0;
  margin-top: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#prayer-divider { opacity: 0.55; margin-bottom: 1.3rem; }
#prayer-divider svg { display: block; }
.attribution {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-style: italic;
  letter-spacing: 0.22em;
  opacity: 0.8;
}

/* Audio toggle */
#audio-toggle {
  position: fixed;
  top: 1.2rem; right: 1.2rem;
  z-index: 10;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(74, 64, 54, 0.25);
  background: rgba(246, 239, 227, 0.6);
  backdrop-filter: blur(6px);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.2s;
}
#audio-toggle:hover { background: rgba(246, 239, 227, 0.9); transform: scale(1.06); }

/* Scroll hint */
#scroll-hint {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  text-align: center;
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.12em;
  opacity: 0.65;
  transition: opacity 0.8s;
  pointer-events: none;
}
.hint-line {
  width: 1px;
  height: 34px;
  margin: 0.6rem auto 0;
  background: linear-gradient(to bottom, var(--ink), transparent);
  animation: hint-drift 2.4s ease-in-out infinite;
}
@keyframes hint-drift {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(8px); opacity: 0.3; }
}

/* Intro title — visible on load, fades with the first scroll */
#intro-title {
  position: fixed;
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  text-align: center;
  pointer-events: none;
  width: 92vw;
}
#intro-title h1 {
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
#intro-title p {
  font-style: italic;
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  opacity: 0.7;
}

/* Contact note */
#contact-note {
  position: fixed;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-style: italic;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  opacity: 0.6;
  pointer-events: auto;
  white-space: nowrap;
}
#contact-note a {
  color: inherit;
  text-decoration: none;
}
#contact-note a:hover { text-decoration: underline; }

/* Screen-reader-only */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .hint-line { animation: none; }
}
