:root {
  --bg: #0b0b0f;
  --surface: rgba(21, 21, 32, 0.72);
  --surface-strong: rgba(26, 26, 42, 0.88);
  --border: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.7);
  --dim: rgba(255, 255, 255, 0.5);
  --violet: #8b5cf6;
  --pink: #ec4899;
  --glow: rgba(139, 92, 246, 0.28);
  --glow-strong: rgba(236, 72, 153, 0.24);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 16px;
  --content: min(1120px, calc(100vw - 40px));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.16), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(236, 72, 153, 0.16), transparent 28%),
    linear-gradient(180deg, #08090d 0%, #0b0b0f 35%, #0d0d14 100%);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body.home-locked {
  overflow: hidden;
  height: 100vh;
}

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.03), transparent 20%, transparent 80%, rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.02), transparent 38%);
  pointer-events: none;
  z-index: -3;
}

img {
  max-width: 100%;
  display: block;
}

a,
button {
  color: inherit;
}

a {
  text-decoration: none;
}

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 4px;
}

.starfield,
.constellation-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -4;
}

.constellation-canvas {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

.constellation-canvas.active {
  opacity: 1;
}

.page-glow {
  position: fixed;
  width: 38vw;
  aspect-ratio: 1;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.34;
  z-index: -2;
  pointer-events: none;
  mix-blend-mode: screen;
}

.page-glow-one {
  top: -10vw;
  left: -8vw;
  background: rgba(139, 92, 246, 0.2);
}

.page-glow-two {
  right: -10vw;
  bottom: -12vw;
  background: rgba(236, 72, 153, 0.18);
}

.cursor-ripple-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.cursor-ripple {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ripple-out 1s ease-out forwards;
}

.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.site-header {
  position: sticky;
  top: calc(14px + var(--safe-top));
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  width: var(--content);
  margin: 14px auto 0;
  padding: 16px 22px;
  border-radius: 999px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.2em;
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.35s var(--ease), opacity 0.35s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.audio-toggle {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

.audio-toggle.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.audio-toggle:hover,
.audio-toggle[aria-pressed="true"] {
  color: var(--text);
  transform: translateY(-1px);
}

main {
  width: 100%;
}

.panel {
  width: var(--content);
  margin: 0 auto;
}

.hero,
.page-hero,
.future-hero {
  min-height: calc(100vh - 120px);
  display: grid;
  align-items: center;
  position: relative;
}

.hero-home {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 40px;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.78rem;
}

.hero-title,
.page-title,
.finale-word {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero-title {
  font-size: clamp(4.8rem, 14vw, 10rem);
}

.page-title {
  font-size: clamp(3.4rem, 9vw, 7rem);
  max-width: 11ch;
}

.hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.86);
}

.hero-subtitle,
.finale-subtitle {
  margin: 22px 0 10px;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.05em;
}

.hero-note,
.page-lead,
.transition-copy p,
.split-callout p,
.constellation-copy p {
  max-width: 34rem;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.8;
  color: var(--muted);
}

.hero-actions,
.footer-nav,
.finale-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-actions {
  margin-top: 34px;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 156px;
  padding: 15px 24px;
  border-radius: 999px;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), color 0.4s var(--ease), background 0.4s var(--ease);
  will-change: transform;
}

.button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03));
  z-index: -1;
}

.button:hover {
  transform: translateY(-2px) scale(1.01);
}

.button-primary {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.8), rgba(236, 72, 153, 0.72));
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.28), 0 0 60px rgba(236, 72, 153, 0.18);
}

.button-secondary {
  border: 1px solid var(--border);
  color: var(--muted);
}

.hero-orbit {
  position: relative;
  min-height: 460px;
}

.orbit {
  position: absolute;
  inset: 50%;
  width: clamp(220px, 24vw, 340px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
}

.orbit::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  top: 10%;
  left: 75%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(236, 72, 153, 0.55));
  box-shadow: 0 0 40px rgba(236, 72, 153, 0.5);
}

.orbit-one {
  animation: slow-spin 22s linear infinite;
}

.orbit-two {
  width: clamp(280px, 32vw, 420px);
  animation: slow-spin 30s linear infinite reverse;
}

.orbit-three {
  width: clamp(360px, 40vw, 520px);
  animation: slow-spin 38s linear infinite;
}

.intro-strip,
.transition-banner,
.split-callout,
.constellation-copy {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 26px;
  padding: clamp(26px, 4vw, 42px);
  margin-top: 40px;
  border-radius: var(--radius-lg);
}

.intro-strip {
  margin-top: 14px;
}

.intro-strip p {
  margin: 0;
  max-width: 54rem;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.9;
  color: var(--muted);
}

.transition-copy h2,
.split-callout h2,
.constellation-copy h2 {
  margin: 0 0 12px;
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
}

.story-shell {
  margin: 14vh auto 0;
}

.gate-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body:not(.home-locked) .gate-hidden {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.story-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.story-inner {
  width: 100%;
  display: grid;
  gap: 18px;
  padding: 6vh 0;
}

.story-index {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.22em;
}

.story-line,
.future-line h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(2.8rem, 6.2vw, 5.8rem);
  line-height: 1.04;
  max-width: 11ch;
}

.story-support {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.85;
}

.page-hero {
  padding-top: 10vh;
}

.listening-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 26px;
  align-items: end;
  padding: 3vh 0 1vh;
}

.section-heading h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
}

.listening-intro p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
  font-size: clamp(1rem, 1.5vw, 1.12rem);
}

.stacked-text-shell {
  width: min(860px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 6vh 0 10vh;
}

.text-panel {
  margin: 18px 0;
  padding: 34px;
  border-radius: var(--radius-md);
}

.text-panel p {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.88);
}

.letter-shell {
  padding: 4vh 0 2vh;
}

.letter-card {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 56px);
  border-radius: var(--radius-lg);
}

.letter-intro,
.signature {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
}

.typewriter {
  min-height: 300px;
  margin: 26px 0 30px;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.5rem, 2.7vw, 2.3rem);
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.92);
}

.typewriter-line {
  display: block;
  opacity: 0;
}

.apology-highlights {
  display: grid;
  gap: 18px;
  padding: 6vh 0 10vh;
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  padding: 4vh 0 8vh;
}

.promise-card {
  padding: 28px;
  border-radius: var(--radius-md);
}

.promise-card h2 {
  margin: 0 0 14px;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.1;
}

.promise-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.chapter-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 0 0 8vh;
}

.chapter-item {
  padding: 24px;
  border-radius: 24px;
}

.chapter-item span,
.chapter-item strong,
.chapter-item p {
  display: block;
}

.chapter-item span {
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.16em;
}

.chapter-item strong {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.chapter-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.highlight-line {
  font-family: "Playfair Display", serif;
  font-size: clamp(2rem, 5vw, 4rem);
}

.animated-underline {
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.animated-underline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.95), rgba(236, 72, 153, 0.9));
  transform: scaleX(var(--underline-progress, 0));
  transform-origin: left;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 4vh 0 10vh;
}

.polaroid {
  padding: 18px 18px 24px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.95);
  color: #101014;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transform-style: preserve-3d;
}

.memory-image {
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.06), rgba(16, 16, 20, 0.16));
}

.memory-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.7s var(--ease);
}

.memory-card:hover .memory-image img {
  transform: scale(1.04);
}

.future-sequence {
  padding: 8vh 0 2vh;
}

.future-line {
  min-height: 74vh;
  display: grid;
  align-items: center;
}

.constellation-section {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.finale {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10vh 0;
}

.finale-word {
  font-size: clamp(4.2rem, 12vw, 9rem);
}

.finale-subtitle {
  margin-top: 20px;
}

.finale-signoff {
  margin: 10px 0 38px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer-nav {
  justify-content: center;
  padding: 6vh 0 calc(10vh + var(--safe-bottom));
}

.gradient-starfield {
  filter: saturate(1.1);
}

@media (max-width: 1024px) {
  .hero-home,
  .listening-intro,
  .split-callout,
  .transition-banner,
  .constellation-copy {
    grid-template-columns: 1fr;
    display: grid;
  }

  .promise-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chapter-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
    border-radius: 28px;
  }
}

@media (max-width: 720px) {
  :root {
    --content: min(1120px, calc(100vw - 24px));
  }

  .site-header {
    gap: 12px;
    padding: 14px 16px;
    margin-top: 10px;
  }

  .site-nav {
    gap: 10px;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    white-space: nowrap;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
  }

  .hero,
  .page-hero,
  .future-hero {
    min-height: auto;
    padding: 12vh 0 8vh;
  }

  .hero-orbit {
    min-height: 320px;
  }

  .hero-badges,
  .hero-actions {
    margin-top: 20px;
  }

  .promise-grid,
  .chapter-rail,
  .memory-grid {
    grid-template-columns: 1fr;
  }

  .story-panel,
  .future-line,
  .constellation-section,
  .finale {
    min-height: 72vh;
  }

  .text-panel,
  .promise-card,
  .chapter-item,
  .letter-card,
  .intro-strip,
  .transition-banner,
  .split-callout,
  .constellation-copy {
    padding: 24px;
  }

  .story-shell {
    margin-top: 8vh;
  }

  .story-inner {
    gap: 14px;
  }

  .site-nav a[aria-current="page"] {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.18));
  }

  .button {
    width: 100%;
  }

  .audio-toggle {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
