/* =========================================================
   LUX ROSARII — Design System
   ========================================================= */

:root {
  --bg: #000000;
  --text: #f0e6d2;          /* warm cream */
  --text-muted: #b8a888;    /* muted warm gray */
  --gold: #c9a961;          /* gold accent — used sparingly */
  --gold-deep: #8b7637;     /* deeper gold for frame layering */
  --shadow-deep: #2a2010;   /* near-black brown for frame layering */
  --bead-inactive: #3a3a3a;
  --bead-active: #ffffff;

  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  --transition-bead: fill 0.5s ease-in-out, stroke 0.5s ease-in-out, filter 0.5s ease-in-out;
  --transition-fade: opacity 0.8s ease-out;
}

/* ----- Reset & base ---------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
a:hover {
  border-bottom-color: var(--gold);
}

button {
  font-family: var(--serif);
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
}

/* =========================================================
   HOME PAGE
   ========================================================= */

.home-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url("assets/mary-background.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
  background-attachment: fixed;
  opacity: 0.18;
  pointer-events: none;
}

.home-wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 32px 100px;
  text-align: center;
}

.site-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(56px, 9vw, 96px);
  line-height: 1.05;
  margin: 0;
  color: var(--text);
  letter-spacing: 0.01em;
}

.site-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--text-muted);
  margin: 14px 0 60px;
  letter-spacing: 0.05em;
}

.intro {
  text-align: left;
  font-size: 19px;
  line-height: 1.75;
  color: var(--text);
}
.intro p {
  margin: 0 0 1.2em;
}
.intro p:last-child {
  margin-bottom: 0;
}

/* Mystery card --------------------------------------------------------- */

.mystery-card {
  margin: 64px auto 0;
  padding: 28px 24px 22px;
  max-width: 520px;
  border: 1px solid rgba(201, 169, 97, 0.25);
  background: rgba(0, 0, 0, 0.55);
  border-radius: 2px;
}

.mystery-today-label {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.mystery-today-name {
  font-family: var(--display);
  font-style: italic;
  font-size: 36px;
  color: var(--gold);
  margin: 0;
  line-height: 1.2;
}

.mystery-toggle {
  display: inline-block;
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-muted);
  background: none;
  border: none;
  font-family: var(--serif);
  font-style: italic;
  padding: 4px 8px;
  cursor: pointer;
}
.mystery-toggle:hover {
  color: var(--gold);
}

.mystery-options {
  display: none;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.mystery-options.is-open {
  display: flex;
}
.mystery-option {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(201, 169, 97, 0.4);
  padding: 8px 18px;
  border-radius: 2px;
  transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}
.mystery-option:hover,
.mystery-option.is-active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201, 169, 97, 0.06);
}

/* Begin button --------------------------------------------------------- */

.begin-btn {
  display: inline-block;
  margin-top: 56px;
  padding: 18px 56px;
  font-family: var(--display);
  font-style: italic;
  font-size: 28px;
  color: var(--gold);
  background: transparent;
  border: 1.5px solid var(--gold);
  border-radius: 2px;
  letter-spacing: 0.05em;
  transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
  text-decoration: none;
}
.begin-btn:hover,
.begin-btn:focus-visible {
  background: rgba(201, 169, 97, 0.08);
  box-shadow: 0 0 32px rgba(201, 169, 97, 0.2);
  outline: none;
  border-bottom-color: var(--gold);
}

.home-footer {
  margin-top: 80px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* =========================================================
   PRAYER PAGE
   ========================================================= */

.prayer-page {
  background: #000;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

.exit-link {
  position: fixed;
  top: 18px;
  right: 24px;
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--serif);
  font-style: italic;
  border-bottom: none;
  z-index: 10;
  letter-spacing: 0.05em;
}
.exit-link:hover {
  color: var(--gold);
  border-bottom: none;
}

.kb-hint {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(184, 168, 136, 0.45);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  z-index: 5;
  pointer-events: none;
  text-align: center;
}

/* Rosary in corner ----------------------------------------------------- */

.rosary-corner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 180px;
  height: 220px;
  z-index: 10;
  pointer-events: none;
}

.rosary-corner svg {
  width: 100%;
  height: 100%;
  display: block;
}

.bead {
  fill: var(--bead-inactive);
  transition: var(--transition-bead);
}
.bead.active {
  fill: var(--bead-active);
  filter: drop-shadow(0 0 6px var(--gold));
}

.bead-stroke {
  fill: none;
  stroke: var(--bead-inactive);
  stroke-width: 1;
  transition: var(--transition-bead);
}

.cross-shape {
  stroke: var(--bead-inactive);
  stroke-width: 3;
  stroke-linecap: square;
  fill: none;
  transition: var(--transition-bead);
}
.cross-shape.active {
  stroke: var(--bead-active);
  filter: drop-shadow(0 0 6px var(--gold));
}

.medallion {
  fill: var(--bead-inactive);
  stroke: var(--bead-inactive);
  stroke-width: 1;
  transition: var(--transition-bead);
}
.medallion.active {
  fill: var(--bead-active);
  filter: drop-shadow(0 0 8px var(--gold));
}

.connector {
  stroke: rgba(201, 169, 97, 0.18);
  stroke-width: 0.6;
  fill: none;
}

/* Prayer stage --------------------------------------------------------- */

.stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 80px 80px;
}

.stage-inner {
  width: 100%;
  max-width: 900px;
  text-align: center;
  opacity: 1;
  animation: stage-fade 0.6s ease-out;
}

@keyframes stage-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.prayer-label {
  font-family: var(--serif);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.prayer-text {
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.65;
  color: var(--text);
  margin: 0 auto;
  max-width: 820px;
}

.prayer-text em {
  color: var(--gold);
  font-style: italic;
}

/* Long prayers (Apostles' Creed, Hail Holy Queen, Closing Prayer,
   Prayer to St. Michael) render their sentences/clauses on individual
   lines so the text doesn't wrap into a ragged center-aligned block. */
.prayer-text.long {
  font-size: clamp(19px, 2.1vw, 26px);
  line-height: 1.55;
  max-width: 880px;
}
.prayer-text.long .prose-line {
  display: block;
  margin: 0 auto 0.55em;
  max-width: 760px;
}
.prayer-text.long .prose-line:last-child {
  margin-bottom: 0;
}

.prayer-note {
  margin-top: 22px;
  font-style: italic;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--text-muted);
}

.prayer-pair {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.prayer-pair .prayer-text + .prayer-text {
  border-top: 1px solid rgba(201, 169, 97, 0.18);
  padding-top: 28px;
}

.hm-count {
  color: var(--gold);
  font-style: normal;
  letter-spacing: 0.18em;
  margin-left: 8px;
}

/* =========================================================
   IN-DECADE LAYOUT — painting + prayer side by side
   ========================================================= */

.with-decade {
  width: 100%;
  max-width: 1200px;
}

.decade-layout {
  display: grid;
  grid-template-columns: minmax(260px, 38%) 1fr;
  gap: 56px;
  align-items: center;
  text-align: left;
}

.painting-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.prayer-side {
  text-align: left;
}

.prayer-side .prayer-label,
.prayer-side .prayer-text {
  text-align: left;
  margin-left: 0;
}

.decade-banner {
  font-family: var(--display);
  font-style: italic;
  text-align: center;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.decade-banner .db-num {
  font-family: var(--serif);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 11px;
  color: var(--text-muted);
}
.decade-banner .db-name {
  font-size: clamp(22px, 2.4vw, 30px);
  color: var(--gold);
}

/* Smaller frame variant used during the 10 Hail Marys, OF, and Glory/Fatima */
.painting-frame.painting-frame-side {
  border-width: 6px;
  box-shadow:
    0 0 0 2px var(--shadow-deep),
    0 0 0 11px var(--gold-deep),
    0 0 0 13px var(--shadow-deep),
    0 8px 28px rgba(0, 0, 0, 0.55);
  max-width: min(36vw, 420px);
}
.painting-frame.painting-frame-side img {
  max-height: 44vh;
}

/* Versicle (leader / response) */
.versicle {
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.7;
}
.versicle-line {
  margin: 0 0 10px;
}
.versicle-line .speaker {
  color: var(--text-muted);
  font-style: italic;
  margin-right: 10px;
  font-size: 0.7em;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* =========================================================
   MYSTERY ANNOUNCEMENT
   ========================================================= */

.announce {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 1100px;
}

.announce-decade {
  font-family: var(--serif);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.announce-name {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(36px, 5vw, 64px);
  color: var(--gold);
  line-height: 1.1;
  margin: 0;
}

.announce-fruit {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--text-muted);
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}

.announce-fruit::before {
  content: "Fruit: ";
  color: var(--text-muted);
  opacity: 0.7;
}

/* Painting in gold frame ------------------------------------------------ */

.painting-frame {
  border: 8px solid var(--gold);
  box-shadow:
    0 0 0 2px var(--shadow-deep),
    0 0 0 14px var(--gold-deep),
    0 0 0 16px var(--shadow-deep),
    0 12px 40px rgba(0, 0, 0, 0.6);
  background: #000;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(50vw, 540px);
  margin: 4px auto;
  position: relative;
  transition: var(--transition-fade);
}

.painting-frame img {
  display: block;
  max-width: 100%;
  max-height: 46vh;
  object-fit: contain;
  transition: var(--transition-fade);
}

.painting-fallback {
  display: none;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  min-width: 280px;
  min-height: 260px;
  text-align: center;
}
.painting-frame.has-fallback img {
  display: none;
}
.painting-frame.has-fallback .painting-fallback {
  display: flex;
}
.painting-fallback .pf-title {
  font-family: var(--display);
  font-style: italic;
  font-size: 22px;
  color: var(--gold);
}
.painting-fallback .pf-artist {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--text-muted);
}

/* Scripture & quote ---------------------------------------------------- */

.announce-scripture {
  font-family: var(--serif);
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.7;
  color: var(--text);
  max-width: 820px;
  margin: 14px auto 0;
}
.announce-scripture .ref {
  font-style: italic;
  color: var(--gold);
  margin-right: 10px;
}

.announce-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 820px;
  margin: 6px auto 0;
}
.announce-quote .author {
  font-style: normal;
  color: var(--gold);
  margin-right: 8px;
}
.announce-quote .author::before {
  content: "— ";
}

/* =========================================================
   END SCREEN
   ========================================================= */

.end-amen {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(60px, 10vw, 120px);
  color: var(--gold);
  margin: 0;
  letter-spacing: 0.05em;
}

.end-link {
  display: inline-block;
  margin-top: 40px;
  font-size: 16px;
  color: var(--text-muted);
  font-style: italic;
  border-bottom: 1px solid transparent;
}
.end-link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
  .decade-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  .prayer-side,
  .prayer-side .prayer-label,
  .prayer-side .prayer-text {
    text-align: center;
  }
  .painting-frame.painting-frame-side {
    max-width: min(70vw, 340px);
  }
  .painting-frame.painting-frame-side img {
    max-height: 32vh;
  }
}

@media (max-width: 720px) {
  .home-wrap { padding: 56px 22px 80px; }
  .stage { padding: 30px 26px 80px; }
  .rosary-corner {
    width: 110px;
    height: 140px;
    bottom: 12px;
    left: 12px;
  }
  .painting-frame {
    max-width: 86vw;
    box-shadow:
      0 0 0 2px var(--shadow-deep),
      0 0 0 9px var(--gold-deep),
      0 0 0 11px var(--shadow-deep),
      0 8px 24px rgba(0, 0, 0, 0.6);
    border-width: 5px;
  }
  .painting-frame img { max-height: 38vh; }
  .kb-hint { display: none; }
}

/* Reduce motion preference -- respect user setting -------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
