/* Homepage layout. The light engine draws on #light (fixed, behind the page);
   every [data-light] element is a stage: its box is where the light forms.
   Copy is always visible: no opacity gates on text. */

#light {
  position: fixed; top: 0; left: 0; z-index: 0;
  width: 100%; height: 100vh; height: 100lvh;
  display: block; pointer-events: none;
  opacity: 0; transition: opacity 1.1s ease;
}
.gl-live #light { opacity: 1; }
.gl-failed #light, .gl-off #light { display: none; }
#stars2d { position: fixed; inset: 0; z-index: 0; pointer-events: none; display: none; }
.no-js #stars2d, .no-gl #stars2d, .gl-failed #stars2d, .gl-off #stars2d { display: block; }

main { position: relative; z-index: 1; }
main > section { position: relative; }
.stage { position: relative; }
.section-head { text-align: center; margin-bottom: clamp(1rem, 3vw, 2.5rem); }
.section-head .eyebrow { display: block; margin-bottom: 1.1rem; }
h2.title {
  font-family: var(--serif); font-weight: 300; color: var(--light);
  font-size: clamp(2.3rem, 4.8vw, 3.9rem); line-height: 1.12; letter-spacing: -0.01em;
}
.prose p { font-size: clamp(1.12rem, 1.5vw, 1.26rem); line-height: 1.88; color: var(--text); max-width: var(--measure); }
.prose p + p { margin-top: 1.3rem; }
.quote { margin-top: 1.8rem; padding-left: 1.25rem; border-left: 1px solid var(--line-2); }
.quote p { font-size: clamp(1.15rem, 1.6vw, 1.32rem); font-style: italic; font-weight: 300; color: var(--light-dim); line-height: 1.7; }
.quote cite { display: block; margin-top: 0.7rem; }

/* ── Hero ── */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  padding: 5.25rem var(--pad) 2.25rem; text-align: center;
  overflow-x: clip; /* the glow reaches past the stage: never past the screen, or phones pan sideways */
}
.hero-stage { justify-self: center; width: min(100%, 76vh); min-height: 42vh; }
.hero-mark {
  position: absolute; inset: 9%;
  background-color: var(--light);
  -webkit-mask: url(/sacred-heart.svg) center / contain no-repeat; mask: url(/sacred-heart.svg) center / contain no-repeat;
  transition: opacity 0.6s ease;
}
.hero-glow {
  position: absolute; inset: -6%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(240, 230, 200, 0.2) 0%, rgba(240, 230, 200, 0.05) 38%, transparent 68%);
  animation: breathe 6s ease-in-out infinite; will-change: opacity;
}
@keyframes breathe { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.gl .hero-mark, .gl .hero-glow { opacity: 0; animation: none; }
/* While the engine boots, the mark holds the place until the light takes it. */
.gl:not(.intro):not(.gl-live) .hero-mark { opacity: 1; }
.gl-failed .hero-mark, .gl-off .hero-mark { opacity: 1; }
.gl-failed .hero-glow, .gl-off .hero-glow { opacity: 1; animation: breathe 6s ease-in-out infinite; }

.genesis {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  text-align: center; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 0.8s ease;
}
.genesis p { font-style: italic; font-weight: 300; font-size: clamp(1.5rem, 3.2vw, 2.4rem); color: var(--light-dim); }
.genesis .ref { display: block; margin-top: 0.8rem; }
/* First visit: the words come first, in the dark, then the light. */
.intro .genesis { opacity: 1; }
.intro.intro-lit .genesis { opacity: 0; }

.hero-copy { position: relative; padding-top: 0.75rem; }
.hero h1 {
  font-family: var(--sans); font-size: clamp(0.72rem, 1vw, 0.84rem); font-weight: 600;
  letter-spacing: 0.44em; text-transform: uppercase; color: var(--light); margin-right: -0.44em;
}
.hero .verse { font-size: clamp(1.3rem, 2.3vw, 1.95rem); max-width: 30ch; margin: 1rem auto 0.75rem; }
.cue {
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.45rem; margin-top: 1.6rem;
  font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none;
}
.cue i { display: block; width: 1px; height: 2.4rem; background: linear-gradient(var(--light-faint), transparent); animation: cue 2.6s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ── Daily Light ── */
.daily { min-height: 100vh; display: grid; place-items: center; padding: 8rem var(--pad); text-align: center; }
.daily > .stage { position: absolute; inset: 0; }
.daily-inner { position: relative; max-width: 46rem; }
.daily .eyebrow { display: block; margin-bottom: 2.2rem; }
.daily .eyebrow span { color: var(--text-muted); }
.daily-quote p { font-size: clamp(1.55rem, 3.1vw, 2.55rem); }
.daily-quote cite { display: block; margin-top: 1.4rem; color: var(--light); }
.daily-note { font-size: 1.12rem; color: var(--text-muted); line-height: 1.8; max-width: 30rem; margin: 1.6rem auto 2.2rem; }

/* ── The Name: star, heart, Starheart ── */
.name { padding: 7rem var(--pad) 3rem; }
.name-row {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center;
  gap: clamp(2rem, 6vw, 6rem); min-height: 88vh; max-width: 1180px; margin: 0 auto;
}
.name-row > .stage { width: min(100%, 70vh); aspect-ratio: 1 / 1; justify-self: center; }
.name-row:nth-of-type(even) > .stage { order: 2; }
.name-copy .eyebrow { display: block; margin-bottom: 1rem; }
.name-copy h3 { font-weight: 300; font-size: clamp(2.8rem, 6vw, 4.6rem); line-height: 1; color: var(--light); margin-bottom: 1.2rem; }
.name-copy > p { font-size: clamp(1.2rem, 1.7vw, 1.4rem); line-height: 1.75; color: var(--text); max-width: 26rem; }

/* ── Mission ── */
.mission {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); align-items: center;
  gap: clamp(2rem, 6vw, 6rem); min-height: 100vh; max-width: 1180px; margin: 0 auto; padding: 6rem var(--pad);
}
.mission > .stage { width: min(100%, 76vh); aspect-ratio: 1 / 1; justify-self: center; }
.mission .eyebrow { display: block; margin-bottom: 1.2rem; }
.mission h2.title { margin-bottom: 1.8rem; }

/* ── Three Pillars ── */
.pillars { padding: 6rem var(--pad) 7rem; max-width: 1180px; margin: 0 auto; }
.pillars-stage { width: 100%; height: clamp(17rem, 50vh, 31rem); }
.pillars-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.pillar {
  position: relative; padding: 2.3rem 2rem 2.1rem;
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 16, 14, 0.82), rgba(8, 8, 14, 0.9));
}
.pillar::before {
  content: ''; position: absolute; left: 22%; right: 22%; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 200, 140, 0.65), transparent);
}
.pillar .eyebrow { display: block; margin-bottom: 1.3rem; }
.pillar h3 { font-weight: 400; font-size: 1.75rem; color: var(--light); margin-bottom: 0.8rem; }
.pillar > p { font-size: 1.06rem; line-height: 1.8; color: var(--text-muted); }
.pillar .quote { margin-top: 1.4rem; padding: 1.1rem 0 0; border-left: none; border-top: 1px solid var(--line); }
.pillar .quote p { font-size: 1rem; line-height: 1.65; }

/* ── The heavens: the Verse Sky ── */
.heavens { min-height: 100vh; padding: 7rem var(--pad) 5rem; text-align: center; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 1.5rem; }
.heavens > .stage { width: 100%; max-width: 1280px; justify-self: center; min-height: 52vh; }
.heavens .verse { font-size: clamp(1.4rem, 2.6vw, 2.15rem); max-width: 26ch; margin: 0 auto; }
.heavens .ref { display: block; margin-top: 0.9rem; }
.heavens-copy p { font-size: 1.15rem; line-height: 1.8; color: var(--text); max-width: 32rem; margin: 0 auto 1.8rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem 1.6rem; align-items: center; }

/* ── In the making: Letters, Text Starheart ── */
.making {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
  gap: clamp(2rem, 5vw, 5rem); max-width: 1180px; margin: 0 auto; padding: 6rem var(--pad); min-height: 90vh;
}
.making > .stage { width: min(100%, 68vh); aspect-ratio: 1 / 1; justify-self: center; }
.making .eyebrow { display: block; margin-bottom: 1.2rem; }
.making h2.title { margin-bottom: 2rem; }
.cards { display: grid; gap: 1.1rem; }
.card {
  display: block; position: relative; text-decoration: none; color: inherit;
  padding: 1.7rem 1.8rem 1.6rem; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 14, 18, 0.78), rgba(8, 8, 14, 0.86));
  transition: border-color 0.35s, transform 0.35s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.card .eyebrow { display: block; margin-bottom: 0.7rem; color: var(--gold); }
.card h3 { font-weight: 400; font-size: 1.7rem; color: var(--light); margin-bottom: 0.5rem; }
.card p { font-size: 1.06rem; line-height: 1.7; color: var(--text-muted); }
.card .go { position: absolute; right: 1.6rem; top: 1.7rem; font-family: var(--sans); color: var(--light-faint); transition: transform 0.3s, color 0.3s; }
.card:hover .go { transform: translateX(3px); color: var(--light); }

/* ── Finale: the light of the world ── */
.finale { min-height: 100vh; padding: 6rem var(--pad) 3rem; text-align: center; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.finale > .stage { justify-self: center; width: min(100%, 70vh); min-height: 50vh; }
.finale .verse { font-size: clamp(1.45rem, 2.7vw, 2.25rem); max-width: 28ch; margin: 0.5rem auto 0; }
.finale .ref { display: block; margin-top: 1rem; }

.connect { padding: 4rem var(--pad) 6rem; text-align: center; }
.connect .eyebrow { display: block; margin-bottom: 1.4rem; }
.connect p { font-size: 1.2rem; color: var(--text); margin-bottom: 2rem; }
.connect-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; max-width: 48rem; margin: 0 auto; }
.connect .connect-friends { margin: 3rem 0 1.2rem; }
.connect-mail { margin-top: 3rem; }

/* ── Small screens: the light above the words ── */
@media (max-width: 860px) {
  .hero { padding-top: 4.6rem; }
  .hero-stage { width: 100%; min-height: 46vh; }
  .name { padding-top: 4rem; }
  .name-row, .mission, .making { grid-template-columns: 1fr; min-height: 0; gap: 1.2rem; text-align: center; padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .name-row > .stage, .mission > .stage, .making > .stage { width: min(100%, 50vh); order: -1 !important; }
  .name-copy > p, .prose p { margin-left: auto; margin-right: auto; }
  .quote { border-left: none; padding-left: 0; }
  .pillars-grid { grid-template-columns: 1fr; }
  .pillars-stage { height: clamp(13rem, 34vh, 18rem); }
  .heavens > .stage { min-height: 46vh; }
  .finale > .stage { min-height: 44vh; }
}

/* ── No light engine: the mark and a still sky; empty stages fold away ── */
.no-js .stage:not(.hero-stage):not(.sky-stage), .no-gl .stage:not(.hero-stage):not(.sky-stage), .gl-failed .stage:not(.hero-stage):not(.sky-stage) { display: none; }
.no-js .name-row, .no-gl .name-row, .gl-failed .name-row { min-height: 0; padding: 3rem 0; grid-template-columns: 1fr; text-align: center; }
.no-js .name-copy > p, .no-gl .name-copy > p, .gl-failed .name-copy > p { margin: 0 auto; }
