:root {
  /* Single look everywhere — no light/dark OS switch */
  --bg: #14151f;
  --surface: #1c1e2c;
  --text: #e8e9f4;
  --muted: #9a9db5;
  --accent: #8c98ff;
  --accent-soft: #252844;
  --line: #2c2f45;
  --heart: #e5484d;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Nunito", system-ui, sans-serif;
  --hand: "Caveat", cursive;
  --page-max: 680px;
  --page-pad: 1.25rem;
  --duration-slow: 520ms;
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
}

/* Intro string art */
body.intro-on {
  overflow: hidden;
}

#sIntro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.2rem;
  transition:
    opacity 0.8s ease,
    transform 0.8s ease,
    filter 0.8s ease;
}

#sIntro.out {
  opacity: 0;
  transform: scale(1.04);
  filter: blur(6px);
  pointer-events: none;
}

#sa {
  width: min(78vw, 400px);
  height: min(78vw, 400px);
}

#sIntro .t {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--accent);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
}

#sIntro .t.show {
  opacity: 1;
  transform: none;
}

#sIntro .skip {
  position: absolute;
  right: 1.2rem;
  bottom: 1.2rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

#sIntro .skip:hover {
  color: var(--text);
  border-color: var(--muted);
}

.hero > * {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
}

body.ready .hero > * {
  opacity: 1;
  transform: none;
}

body.ready .hero > *:nth-child(2) {
  transition-delay: 0.12s;
}

body.ready .hero > *:nth-child(3) {
  transition-delay: 0.24s;
}

body.ready .hero > *:nth-child(4) {
  transition-delay: 0.36s;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 10;
}

.page {
  position: relative;
  width: min(100%, var(--page-max));
  margin: 0 auto;
  padding: 0 var(--page-pad) 4rem;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0 2.5rem;
  text-align: center;
}

.hero-title-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.hero-title {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 7vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.shimmer-text {
  font-style: normal;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    #a8b4ff 25%,
    var(--heart) 50%,
    #a8b4ff 75%,
    var(--accent) 100%
  );
  background-size: 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: -200%;
  }
  to {
    background-position: 200%;
  }
}

.hero-subtitle {
  margin: 0 0 1.8rem;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--muted);
}

.hero-collage {
  position: relative;
  width: min(400px, 88%);
  margin: 0 auto 1.2rem;
  aspect-ratio: 1;
}

.hero-main {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.hero-portrait {
  position: absolute;
  top: -24px;
  left: -52px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow);
}

.hero-final {
  position: absolute;
  right: -44px;
  top: -20px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow);
}

.hero-greeting {
  margin: 2.2rem 0 0.6rem;
  max-width: 420px;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text);
}

.continue-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.continue-btn:hover,
.continue-btn:focus-visible {
  color: var(--heart);
}

.continue-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.continue-btn svg {
  width: 28px;
  height: 28px;
  animation: continue-bounce 1.4s ease-in-out infinite;
}

@keyframes continue-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  20% {
    transform: translateY(7px);
  }
  40% {
    transform: translateY(0);
  }
  55% {
    transform: translateY(4px);
  }
  70% {
    transform: translateY(0);
  }
}

.story {
  padding: 0.5rem 0 2rem;
}

.story-block {
  margin-bottom: 2rem;
}

.story-copy {
  margin: 0 0 1.1rem;
  font-size: 1.1rem;
  line-height: 1.75;
  text-align: left;
  color: var(--text);
}

.story-copy--left {
  text-align: left;
}

.story-copy strong {
  font-weight: 600;
}

.reqs {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  margin: 2rem 0 3rem;
  box-shadow: var(--shadow);
}

.section-label {
  margin: 0 0 0.9rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.materials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.materials li {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
}

.materials li::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  transform: translateY(-0.1rem);
}

.materials li:has(.material-icon) {
  align-items: center;
  flex-wrap: nowrap;
}

.materials li.muted {
  color: var(--muted);
}

.material-icon {
  width: 1.45em;
  height: 1.2em;
  flex: none;
  object-fit: contain;
  display: block;
}

.step {
  padding-top: 2.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0;
  border-top: 1px solid var(--line);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1.4rem;
}

.step-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  margin: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
}

.step-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  color: var(--accent);
}

.step .story-copy {
  font-size: 1.0625rem;
}

.photo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin: 1.6rem 0;
}

.photo-row:has(> :only-child),
.photo-row:has(> .photo-wide),
.photo-row:has(> .photo-mid),
.photo-row:has(> .photo-square),
.photo-row:has(> .crop.photo-square) {
  grid-template-columns: 1fr;
  justify-items: center;
}

.photo-row img,
.photo-row .crop {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--accent-soft);
}

.photo-row > img {
  width: 100%;
  object-fit: cover;
}

.crop {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  width: 100%;
}

.crop img {
  position: absolute;
  max-width: none;
  display: block;
}

.crop--white-center img {
  width: 100%;
  height: 131.99%;
  left: 0;
  top: -31.99%;
  object-fit: cover;
}

.crop--first-progress img {
  width: 100%;
  object-fit: cover;
}

.crop--progress-mid img {
  width: 100%;
  height: 154.34%;
  left: 0;
  top: -0.11%;
  object-fit: cover;
}

.crop--nearly-done img {
  width: 100%;
  object-fit: cover;
}

.photo-wide {
  width: 100%;
  max-width: none;
}

.photo-half {
  width: 100%;
  max-width: none;
}

.photo-mid {
  width: min(100%, 340px);
}

.photo-square {
  width: min(100%, 340px);
  aspect-ratio: 1;
  object-fit: cover;
}

.crop.photo-square {
  object-fit: unset;
}

.crop.photo-half {
  height: auto;
}

.crop--white-center {
  aspect-ratio: 170 / 172;
  width: min(100%, 340px);
}

.crop--first-progress {
  aspect-ratio: 163 / 154;
  width: min(100%, 340px);
}

.crop--progress-mid {
  aspect-ratio: 183 / 158;
  width: min(100%, 340px);
}

.crop--nearly-done {
  aspect-ratio: 182 / 194;
  width: min(100%, 340px);
}

.photo-portrait {
  width: 100%;
}

.step-stage {
  position: relative;
  margin: 2rem 0;
}

.step-stage-art {
  display: block;
  width: min(100%, 340px);
  margin: 0 auto;
  aspect-ratio: 1;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.letter {
  margin-top: 4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2.2rem clamp(1.3rem, 5vw, 2.6rem);
  box-shadow: var(--shadow);
}

.letter-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.3rem;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}

.letter-capi {
  width: 1.35em;
  height: 1.1em;
}

.letter-to {
  margin: 0 0 1.2rem;
  font-family: var(--hand);
  font-size: 1.7rem;
  color: var(--heart);
}

.letter-body {
  margin: 0 0 1.1rem;
  font-size: 1.08rem;
  line-height: 1.75;
  text-align: left;
}

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

.letter-photos {
  display: grid;
  gap: 1.2rem;
  margin-top: 2rem;
}

.closing-art {
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.closing-final {
  width: min(100%, 340px);
  margin: 0 auto;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.date-line {
  margin: 2.5rem 0 0;
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes reveal-scale-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.reveal-mount {
  animation: reveal-up var(--duration-slow) var(--ease-smooth) both;
}

.reveal-mount-scale {
  animation: reveal-scale-in var(--duration-slow) var(--ease-smooth) both;
}

.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity var(--duration-slow) var(--ease-smooth),
    transform var(--duration-slow) var(--ease-smooth);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.97);
  transition:
    opacity var(--duration-slow) var(--ease-smooth),
    transform var(--duration-slow) var(--ease-smooth);
}

.reveal.is-visible,
.reveal-scale.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 {
  transition-delay: 50ms;
  animation-delay: 50ms;
}

.reveal-delay-2 {
  transition-delay: 100ms;
  animation-delay: 100ms;
}

.reveal-delay-4 {
  transition-delay: 200ms;
  animation-delay: 200ms;
}

.reveal-delay-5 {
  transition-delay: 250ms;
  animation-delay: 250ms;
}

.reveal-delay-6 {
  transition-delay: 300ms;
  animation-delay: 300ms;
}

.reveal-delay-7 {
  transition-delay: 350ms;
  animation-delay: 350ms;
}

.reveal-delay-8 {
  transition-delay: 400ms;
  animation-delay: 400ms;
}

@media (max-width: 520px) {
  body {
    font-size: 1rem;
  }

  .hero-portrait {
    left: -14px;
    width: 72px;
    height: 72px;
  }

  .hero-final {
    right: -14px;
    width: 78px;
    height: 78px;
  }

  .materials {
    grid-template-columns: 1fr;
  }

  .photo-row {
    grid-template-columns: 1fr;
  }

  .step-title {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .continue-btn svg {
    animation: none;
  }

  .shimmer-text {
    animation: none;
    background: none;
    -webkit-text-fill-color: var(--accent);
    color: var(--accent);
  }

  #sIntro {
    display: none;
  }

  .hero > *,
  body.ready .hero > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal,
  .reveal-scale,
  .reveal-mount,
  .reveal-mount-scale {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
}
