/* ============================================================
   GUERRILLA ROSARY — Design System v2
   Rose background · Spectral prayer font · Hand-drawn buttons
   Mobile-first, desktop-functional
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');

@font-face {
  font-family: 'Whisper Melody';
  src: url('WhisperMelodyLight-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---- Variables ---- */
:root {
  --rose:         #f0cfc4;      /* warm dusty rose — main background */
  --rose-deep:    #e8b8a8;      /* slightly deeper for hover/contrast */
  --rose-pale:    #f7e4de;      /* very pale for inner cards/textareas */
  --ink:          #2a1a14;      /* deep warm brown-black */
  --ink-soft:     #4a3028;      /* softer ink for body text */
  --warm-gray:    #8a7060;      /* muted warm gray for labels */
  --terracotta:   #9c5a42;      /* button stroke / accent */
  --terracotta-light: #c47a60;  /* button hover */
  --cream:        #faf3ee;      /* closing screen / contrast */
  --gold:         #c9a96e;

  --font-display: 'Spectral', Georgia, serif;
  --font-accent:  'Whisper Melody', cursive;
  --font-prayer:  'Spectral', Georgia, serif;

  --transition:   0.35s ease;
  --max-w:        480px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  width: 100%;
}

body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--rose);
  color: var(--ink);
  font-family: var(--font-prayer);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   LANDING PAGE (index.html)
   ============================================================ */
body.homepage {
  overflow: auto;
  background: #ffffff;
}

/* Hero: image fills screen, text below */
.home-hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 3.5rem;
  position: relative;
  overflow: hidden;
}

.home-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  opacity: 1;
}

/* Soft white fade at bottom — lets illustration breathe, text stays readable */
.home-hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
  z-index: 1;
}

.home-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 2rem;
}

.home-hero-tagline {
  font-family: var(--font-script);
  font-size: clamp(1.4rem, 5.5vw, 2rem);
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

/* Homepage sections (scrolled below hero) */
.home-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.home-section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--ink);
  margin-bottom: 1.4rem;
  line-height: 1.2;
}

.home-section p {
  font-family: var(--font-prayer);
  font-size: clamp(1rem, 3.5vw, 1.1rem);
  line-height: 1.85;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}

.home-section p em { font-style: italic; }

.email-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.email-form input[type="email"],
.email-form input[type="text"] {
  padding: 0.9rem 1.2rem;
  font-family: var(--font-prayer);
  font-size: 1rem;
  color: var(--ink);
  background: var(--rose-pale);
  border: 1px solid var(--terracotta-light);
  outline: none;
  transition: border-color var(--transition);
  border-radius: 0;
}

.email-form input:focus {
  border-color: var(--terracotta);
}

.email-form input::placeholder {
  color: var(--warm-gray);
  font-style: italic;
}

.home-footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--rose-deep);
  font-family: var(--font-prayer);
  font-size: 0.85rem;
  color: var(--warm-gray);
  letter-spacing: 0.06em;
}

.home-footer a {
  color: var(--terracotta);
  text-decoration: none;
}

.home-footer a:hover {
  text-decoration: underline;
}

/* ============================================================
   APP SCREENS (app.html)
   ============================================================ */

/* Full-screen screen container */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: var(--rose);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* Inner content wrapper */
.screen-inner {
  width: 100%;
  max-width: var(--max-w);
  padding: 4rem 2.2rem 6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
  margin: 0 auto;
}

.screen-inner.scrollable {
  overflow-y: auto;
  max-height: 100dvh;
  justify-content: flex-start;
  padding-top: 4.5rem;
  padding-bottom: 5rem;
  -webkit-overflow-scrolling: touch;
}

/* ---- Petition Screen ---- */
.petition-screen {
  justify-content: flex-start;
  overflow-y: auto;
}

.petition-heading {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 4.5vw, 1.6rem);
  line-height: 1.4;
  color: var(--ink);
  max-width: 30ch;
  text-align: center;
}

.petition-body {
  font-family: var(--font-prayer);
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
  line-height: 1.8;
  color: var(--ink-soft);
  max-width: 36ch;
  text-align: center;
}

.petition-textarea {
  width: 100%;
  min-height: 90px;
  padding: 1rem 1.2rem;
  font-family: var(--font-prayer);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink);
  background: var(--rose-pale);
  border: 1px solid var(--terracotta-light);
  border-radius: 0;
  resize: none;
  outline: none;
  transition: border-color var(--transition);
}

.petition-textarea:focus {
  border-color: var(--terracotta);
}

.petition-textarea::placeholder {
  color: var(--warm-gray);
  font-style: italic;
}

.prayer-board-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-prayer);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--warm-gray);
  cursor: pointer;
}

.prayer-board-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--terracotta);
  cursor: pointer;
  flex-shrink: 0;
}

/* ---- Mystery Set + First Mystery Screen ---- */
.mystery-date {
  font-family: var(--font-prayer);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--warm-gray);
}

.mystery-set-name {
  font-family: 'Spectral', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  color: var(--ink-soft);
  line-height: 1.2;
}

.mystery-set-theme {
  font-family: var(--font-prayer);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 34ch;
}

.mystery-separator {
  width: 100%;
  height: 1px;
  background: var(--terracotta-light);
  opacity: 0.4;
  margin: 0.5rem 0;
}

.mystery-number {
  font-family: var(--font-prayer);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--warm-gray);
}

.mystery-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 6.5vw, 2.4rem);
  color: var(--ink);
  line-height: 1.15;
}

.mystery-image-placeholder {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 3/4;
  background: linear-gradient(160deg, var(--rose-deep) 0%, var(--terracotta-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  border-radius: 2px;
}

.mystery-image {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
  border-radius: 2px;
}

.mystery-announcement-image {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
  border-radius: 2px;
  margin: 0.5rem auto;
}

.mystery-image-placeholder span {
  font-family: var(--font-prayer);
  font-style: italic;
  font-size: 0.8rem;
  color: var(--ink);
  letter-spacing: 0.08em;
}

.mystery-scripture {
  font-family: var(--font-prayer);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 36ch;
  line-height: 1.7;
}

.mystery-contemplation {
  font-family: var(--font-prayer);
  font-size: 0.88rem;
  color: var(--warm-gray);
  max-width: 36ch;
  line-height: 1.65;
  letter-spacing: 0.01em;
}

/* ---- Prayer Screen ---- */
.prayer-screen {
  background: var(--rose);
}

.prayer-label {
  font-family: var(--font-prayer);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--warm-gray);
}

.prayer-text {
  font-family: var(--font-prayer);
  font-weight: 300;
  font-size: clamp(1.15rem, 4.5vw, 1.4rem);
  line-height: 2;
  color: var(--ink);
  max-width: 32ch;
  text-align: center;
}

.prayer-text--flow {
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
  line-height: 1.9;
  max-width: 38ch;
  text-align: center;
}

.tap-hint {
  font-family: var(--font-prayer);
  font-style: italic;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--warm-gray);
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.6;
  pointer-events: none;
  z-index: 10;
}

/* ---- Divider ---- */
.divider {
  width: 2.5rem;
  height: 1px;
  background: var(--terracotta-light);
  opacity: 0.5;
  margin: 0.1rem auto;
}

/* ---- Bead Counter ---- */
.bead-counter {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.6rem 0;
}

.bead {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rose-deep);
  border: 1.5px solid var(--terracotta-light);
  transition: background 0.3s, transform 0.3s;
}

.bead.prayed {
  background: var(--terracotta);
  border-color: var(--terracotta);
  transform: scale(1.1);
}

.bead.current {
  background: var(--ink);
  border-color: var(--ink);
  transform: scale(1.35);
}

/* ---- Music Toggle ---- */
.music-toggle {
  position: fixed;
  top: 1.1rem;
  right: 1.2rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  transition: opacity var(--transition);
}

.music-toggle:hover { opacity: 0.7; }

.music-toggle-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--ink);
  flex-shrink: 0;
}

.music-toggle-label {
  font-family: var(--font-prayer);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--warm-gray);
}

.music-toggle.muted .music-toggle-icon {
  opacity: 0.35;
}

.music-toggle.muted .music-toggle-label {
  opacity: 0.45;
}

/* ---- Hand-drawn oval button ---- */
/* Uses an inline SVG background for the organic border effect */
.btn-drawn {
  position: relative;
  display: inline-block;
  padding: 0.75rem 2.4rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color var(--transition), transform 0.2s;
  text-decoration: none;
}

.btn-drawn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50% / 50%;
  border: 1.5px solid var(--terracotta);
  /* Slight imperfection via border-radius variation */
  border-radius: 62% 38% 58% 42% / 48% 52% 48% 52%;
  transition: border-color var(--transition), transform 0.2s;
  transform: rotate(-1deg);
}

.btn-drawn:hover {
  color: var(--terracotta-light);
  transform: translateY(-1px);
}

.btn-drawn:hover::before {
  border-color: var(--terracotta-light);
  transform: rotate(1deg) scale(1.02);
}

/* Tap-to-begin text link (no button shape) */
.tap-begin {
  font-family: var(--font-prayer);
  font-style: italic;
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  color: var(--warm-gray);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: color var(--transition);
  text-decoration: none;
}

.tap-begin:hover { color: var(--ink); }

/* Ghost link */
.btn-ghost {
  font-family: var(--font-prayer);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--warm-gray);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
  padding: 0.3rem;
}

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

/* ---- Closing Screen ---- */
.closing-screen {
  background: var(--rose);
}

.closing-screen .prayer-label {
  color: var(--warm-gray);
}

.closing-quote {
  font-family: var(--font-prayer);
  font-style: italic;
  font-size: clamp(1rem, 3.8vw, 1.2rem);
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink);
  text-align: center;
  max-width: 34ch;
}

.closing-attribution {
  font-family: var(--font-prayer);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--warm-gray);
  text-align: center;
  margin-top: -0.4rem;
}

.closing-body {
  font-family: var(--font-prayer);
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
  font-weight: 300;
  line-height: 1.9;
  color: var(--ink);
  text-align: center;
  margin-top: 0.5rem;
}

.closing-blessing {
  font-family: var(--font-prayer);
  font-style: italic;
  font-size: clamp(0.9rem, 3.2vw, 1.05rem);
  font-weight: 300;
  line-height: 1.8;
  color: var(--warm-gray);
  text-align: center;
  margin-top: 0.5rem;
}

.pray-again-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-prayer);
  font-style: italic;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--warm-gray);
  opacity: 0.75;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity var(--transition);
}

.pray-again-link:hover { opacity: 1; }

/* ---- Progress Bar ---- */
.progress-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--terracotta);
  opacity: 0.5;
  transition: width 0.4s ease;
  z-index: 50;
}

/* ---- Utility ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ---- Desktop adjustments ---- */
@media (min-width: 600px) {
  .screen-inner {
    padding: 4rem 3rem;
  }

  .prayer-text {
    font-size: 1.35rem;
  }
}
