/* ═══════════════════════════════════════════════════════════
   ASPIRO — The Morning Star
   A single scroll through the hour before sunrise.
   ═══════════════════════════════════════════════════════════ */

:root {
  --night: #050510;
  --ink: #f4efe6;
  --ink-dim: rgba(244, 239, 230, 0.72);
  --gold: #ffd98a;
  --gold-deep: #f0b45c;
  --rose: #e8788a;
  --serif-display: "Fraunces", Georgia, serif;
  --serif-body: "Newsreader", Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--serif-body);
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold); color: #201203; }

/* ── The fixed sky ─────────────────────────────────────── */

.sky { position: fixed; inset: 0; z-index: -1; }

.sky-layer { position: absolute; inset: 0; opacity: 0; will-change: opacity; }

.sky-night {
  opacity: 1;
  background:
    radial-gradient(120% 90% at 70% -10%, #101736 0%, transparent 60%),
    linear-gradient(180deg, #030308 0%, #060818 45%, #0b1030 80%, #131a3f 100%);
}
.sky-nautical {
  background:
    linear-gradient(180deg, #050716 0%, #0b1234 45%, #23255c 74%, #4c3a6b 90%, #7a4a63 100%);
}
.sky-civil {
  background:
    linear-gradient(180deg, #101642 0%, #2d2a67 40%, #714a7a 65%, #c96a72 84%, #f0975f 96%, #ffc27a 100%);
}
.sky-sunrise {
  background:
    radial-gradient(90% 55% at 50% 102%, #fff3c4 0%, #ffcf7e 28%, #f79a63 52%, #d4687c 74%, transparent 100%),
    linear-gradient(180deg, #3a3a7a 0%, #8f5a86 40%, #e08a71 72%, #ffc98a 100%);
}

#stars { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Venus herself — the one bright star */
.venus-star {
  position: absolute;
  top: 18vh; right: 16vw;
  width: 220px; height: 220px;
  transform: translate(50%, -50%);
  pointer-events: none;
  will-change: transform, opacity;
}
.venus-core {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle, #fff 0%, #fff8e6 3%, rgba(255, 220, 150, 0.85) 6%, rgba(255, 210, 130, 0.28) 16%, transparent 45%);
  animation: venusPulse 5s ease-in-out infinite;
}
.venus-core::before, .venus-core::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  background: linear-gradient(90deg, transparent, rgba(255, 240, 200, 0.55), transparent);
}
.venus-core::before { width: 150px; height: 1.5px; transform: translate(-50%, -50%); }
.venus-core::after  { width: 1.5px; height: 150px; transform: translate(-50%, -50%); }

@keyframes venusPulse {
  0%, 100% { transform: scale(1);    filter: brightness(1); }
  50%      { transform: scale(1.06); filter: brightness(1.18); }
}

/* The sun — rises during the finale */
.sun {
  position: absolute;
  left: 50%; bottom: -30vh;
  width: 46vmin; height: 46vmin;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, #fffbe8 0%, #ffe9a8 35%, #ffc26a 62%, rgba(255, 170, 90, 0.35) 78%, transparent 100%);
  filter: blur(2px);
  opacity: 0;
  will-change: transform, opacity;
}

/* Film grain */
.grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grainShift 9s steps(6) infinite;
  pointer-events: none;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); } 20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); } 60% { transform: translate(-5%, -2%); }
  80% { transform: translate(4%, 4%); } 100% { transform: translate(0, 0); }
}

/* ── Layout ────────────────────────────────────────────── */

main { position: relative; }

.hero, .chapter, .finale {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 28px;
}

.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 12vh; padding-bottom: 10vh;
}

.chapter { padding-top: 22vh; padding-bottom: 22vh; }

.finale {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  padding-top: 24vh; padding-bottom: 12vh;
}

/* ── Typography ────────────────────────────────────────── */

.eyebrow {
  font-family: var(--serif-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: var(--gold);
  margin-bottom: 2.2rem;
}

h1 {
  font-family: var(--serif-display);
  font-optical-sizing: auto;
  font-size: clamp(2.6rem, 7.5vw, 4.9rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 2.4rem;
}
h1 em, h2 em, .finale h2 em {
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(100deg, var(--gold) 20%, #fff2cf 50%, var(--gold-deep) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-family: var(--serif-display);
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  font-weight: 300;
  line-height: 1.16;
  margin-bottom: 2rem;
}

.chapter-num {
  font-family: var(--serif-display);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  color: var(--gold);
  margin-bottom: 1.6rem;
}

.lede {
  font-size: clamp(1.08rem, 2.1vw, 1.3rem);
  color: var(--ink-dim);
  max-width: 58ch;
}
.lede + .lede { margin-top: 1.2rem; }

.gold { color: var(--gold); }

.prose p {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--ink-dim);
  margin-bottom: 1.3rem;
  max-width: 60ch;
}
.prose strong { color: var(--ink); font-weight: 400; }
.prose em { color: var(--ink); }

blockquote {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: clamp(1.25rem, 2.6vw, 1.65rem);
  line-height: 1.45;
  color: var(--gold);
  border-left: 1px solid rgba(255, 217, 138, 0.4);
  padding-left: 1.6rem;
  margin-top: 3rem;
}

.scroll-cue {
  margin-top: 9vh;
  font-family: var(--serif-display);
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  color: rgba(244, 239, 230, 0.45);
  display: flex; align-items: center; gap: 1rem;
  text-transform: uppercase;
}
.scroll-cue span {
  display: block; width: 1px; height: 54px;
  background: linear-gradient(180deg, var(--gold), transparent);
  animation: cueDrop 2.4s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cueDrop {
  0% { transform: scaleY(0); opacity: 0; }
  35% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(18px); opacity: 0; }
}

/* ── Constellation ─────────────────────────────────────── */

.constellation-chapter { max-width: 1060px; }

.constellation-wrap { margin: 4rem 0 2rem; }

#constellation { width: 100%; height: auto; overflow: visible; }

#cline {
  stroke: rgba(255, 217, 138, 0.5);
  stroke-width: 1;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  transition: stroke-dashoffset 2.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.constellation-wrap.drawn #cline { stroke-dashoffset: 0; }

.cstar .core { fill: #fff6dd; }
.cstar .halo {
  fill: rgba(255, 217, 138, 0.12);
  transition: fill 0.4s, r 0.4s;
}
.cstar text {
  font-family: var(--serif-display);
  font-size: 26px;
  font-style: italic;
  fill: var(--gold);
  text-anchor: middle;
  opacity: 0.85;
}
.cstar.lit .halo { fill: rgba(255, 217, 138, 0.32); }
.cstar.lit .core { fill: #ffffff; filter: drop-shadow(0 0 8px var(--gold)); }

.values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
  margin-top: 3rem;
}

.value {
  position: relative;
  border: 1px solid rgba(244, 239, 230, 0.13);
  border-radius: 4px;
  padding: 1.7rem 1.6rem 1.5rem;
  background: rgba(10, 12, 32, 0.35);
  backdrop-filter: blur(6px);
  transition: border-color 0.4s, background 0.4s, transform 0.4s;
}
.value:hover {
  border-color: rgba(255, 217, 138, 0.55);
  background: rgba(20, 20, 46, 0.55);
  transform: translateY(-4px);
}
.v-letter {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 2.4rem;
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
  display: block;
  margin-bottom: 0.8rem;
}
.value h3 {
  font-family: var(--serif-display);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}
.value p { font-size: 0.98rem; color: var(--ink-dim); }

/* ── Who it's for ──────────────────────────────────────── */

.who-chapter { max-width: 1060px; }

.who {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.1rem;
  margin-top: 2.6rem;
}

.who-card {
  border: 1px solid rgba(244, 239, 230, 0.13);
  border-left: 2px solid rgba(255, 217, 138, 0.5);
  border-radius: 4px;
  padding: 1.7rem 1.6rem 1.5rem;
  background: rgba(10, 12, 32, 0.35);
  backdrop-filter: blur(6px);
  transition: border-color 0.4s, background 0.4s, transform 0.4s;
}
.who-card:hover {
  border-color: rgba(255, 217, 138, 0.55);
  background: rgba(20, 20, 46, 0.55);
  transform: translateY(-4px);
}
.who-card h3 {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--gold);
  margin-bottom: 0.7rem;
}
.who-card p { font-size: 0.98rem; color: var(--ink-dim); }

/* ── Finale ────────────────────────────────────────────── */

.finale h2 {
  font-size: clamp(3rem, 9vw, 6rem);
  line-height: 1.04;
  margin-bottom: 2.2rem;
}
.finale .lede { margin-left: auto; margin-right: auto; }

.wordmark {
  margin-top: 4.5rem;
  font-family: var(--serif-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 500;
  letter-spacing: 0.55em;
  color: var(--ink);
  text-shadow: 0 0 24px rgba(255, 217, 138, 0.55);
}

.finale footer {
  margin-top: 7vh;
  font-size: 0.85rem;
  color: rgba(244, 239, 230, 0.5);
}

/* ── Reveal animations ─────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1), transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: 0.15s; }
.d2 { transition-delay: 0.3s; }
.d3 { transition-delay: 0.45s; }
.d4 { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .venus-core, .scroll-cue span, .grain { animation: none; }
  #cline { transition: none; stroke-dashoffset: 0; }
}

/* ── Mobile ────────────────────────────────────────────── */

@media (max-width: 640px) {
  .venus-star { top: 12vh; right: 20vw; width: 150px; height: 150px; }
  .chapter { padding-top: 16vh; padding-bottom: 16vh; }
  blockquote { padding-left: 1.1rem; }
  .cstar text { font-size: 34px; }
}
