:root {
  color-scheme: light;
  --milk: #fbf8f6;
  --ivory: #fffdf9;
  --cream: #f5efec;
  --rose: #e8c7cd;
  --rose-strong: #dfaeb9;
  --burgundy: #8f3e4a;
  --ink: #26303b;
  --muted: #68717b;
  --gold: #d5ad68;
  --ice: #eef8fb;
  --line: rgba(38, 48, 59, 0.13);
  --shadow: 0 18px 44px rgba(68, 52, 48, 0.14);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
  --hand: "Caveat", cursive;
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(232, 199, 205, 0.62), transparent 26rem),
    radial-gradient(circle at 90% 38rem, rgba(213, 173, 104, 0.13), transparent 22rem),
    linear-gradient(180deg, var(--milk), var(--cream) 54%, #fffaf6);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
  pointer-events: none;
}

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

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem max(1rem, env(safe-area-inset-right)) 0.85rem max(1rem, env(safe-area-inset-left));
  background: rgba(251, 248, 246, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 0.9rem;
  max-width: 100%;
  overflow-x: auto;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  scrollbar-width: none;
}

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

.nav a {
  flex: 0 0 auto;
  text-decoration: none;
}

.hero,
.section,
.finale {
  width: min(100% - 1.25rem, 72rem);
  margin: 0 auto;
}

.hero {
  min-height: calc(100svh - 3.5rem);
  display: grid;
  gap: 1.2rem;
  align-items: end;
  padding: 2rem 0 4rem;
}

.hero__image {
  width: min(100%, 26rem);
  justify-self: center;
}

.hero__image img {
  aspect-ratio: 4 / 5;
  border: 0.6rem solid var(--ivory);
  border-radius: 1.6rem 1.6rem 0.7rem 1.6rem;
  object-position: center;
}

.hero__copy {
  padding: 1.2rem 0.3rem 0;
}

.eyebrow,
.section-kicker,
.photo span {
  color: var(--burgundy);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 0.98;
}

h1 {
  margin: 0.25rem 0 1rem;
  font-size: clamp(5rem, 29vw, 12rem);
}

h2 {
  margin-top: 0.65rem;
  font-size: clamp(2.35rem, 11vw, 5.8rem);
}

h3 {
  font-size: 2rem;
}

p {
  margin: 1rem 0 0;
  color: var(--muted);
}

.copy p,
.section-title p,
.hero__copy p {
  max-width: 42rem;
  font-size: 1rem;
}

.soft-link,
.continue-button,
.horse__button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  margin-top: 1.35rem;
  border: 1px solid rgba(143, 62, 74, 0.28);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
  color: var(--burgundy);
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
}

.section {
  padding: clamp(4.5rem, 13vw, 8.5rem) 0;
  border-bottom: 1px solid var(--line);
}

.section-title {
  margin-bottom: 2rem;
}

.person {
  display: grid;
  gap: 1.6rem;
}

.person h2 {
  max-width: 43rem;
  font-size: clamp(2.25rem, 7vw, 4.2rem);
  line-height: 1.03;
}

.person__notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.person__notes span,
.support__strips span {
  display: inline-block;
  border: 1px solid rgba(143, 62, 74, 0.16);
  border-radius: 1rem 1rem 1rem 0.3rem;
  background: rgba(255, 253, 249, 0.72);
  box-shadow: 0 8px 24px rgba(68, 52, 48, 0.08);
  color: var(--ink);
  padding: 0.55rem 0.8rem;
  transform: rotate(var(--r, -1deg));
}

.person__notes span:nth-child(2n),
.support__strips span:nth-child(2n) {
  --r: 1.5deg;
  background: rgba(232, 199, 205, 0.34);
}

.person__notes span:nth-child(3n),
.support__strips span:nth-child(3n) {
  --r: -2deg;
}

.photo {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.photo img {
  width: 100%;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.photo span {
  display: block;
  margin-top: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.07em;
}

.diary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: start;
}

.album-photo {
  padding: 0.45rem;
  border-radius: 1.15rem;
  background: var(--ivory);
  box-shadow: 0 10px 30px rgba(68, 52, 48, 0.09);
}

.album-photo img {
  aspect-ratio: 4 / 5;
  border-radius: 0.8rem;
  box-shadow: none;
}

.album-photo.large,
.album-photo.wide {
  grid-column: 1 / -1;
}

.album-photo.large img,
.album-photo.wide img {
  aspect-ratio: 16 / 10;
}

.album-photo.tall {
  margin-top: 1.8rem;
}

.sesha,
.ice,
.cinema,
.horse,
.teddy,
.moments,
.support,
.connection {
  display: grid;
  gap: 2rem;
}

.sesha__photos,
.moments__duo {
  display: grid;
  gap: 1rem;
}

.polaroid {
  padding: 0.65rem 0.65rem 1rem;
  border-radius: 0.45rem;
  background: var(--ivory);
  box-shadow: var(--shadow);
}

.polaroid img {
  aspect-ratio: 4 / 5;
  border-radius: 0.25rem;
  box-shadow: none;
}

.small-polaroid {
  width: min(76%, 20rem);
  justify-self: end;
  margin-top: -1rem;
}

.tilt-left {
  transform: rotate(-2.2deg);
}

.tilt-right {
  transform: rotate(2deg);
}

.ice {
  width: 100%;
  max-width: none;
  padding-inline: max(0.65rem, env(safe-area-inset-left));
  background:
    linear-gradient(180deg, rgba(238, 248, 251, 0.94), rgba(255, 253, 249, 0.78)),
    var(--ice);
}

.ice__image {
  width: min(100%, 70rem);
  margin: 0 auto;
}

.ice__image img {
  max-height: 78svh;
  aspect-ratio: 4 / 3;
  border-radius: 1.5rem;
  object-position: center;
  box-shadow: 0 22px 66px rgba(70, 113, 138, 0.18);
}

.ice__text {
  width: min(100% - 1.25rem, 70rem);
  margin: 0 auto;
}

.ice__text h2 {
  max-width: 68rem;
  font-size: clamp(2.15rem, 7vw, 4.6rem);
  line-height: 1.02;
}

.ice__stage {
  width: min(100% - 1.25rem, 70rem);
  margin: 0 auto;
  display: grid;
  gap: 1.2rem;
}

.poem-note,
.quote-paper {
  width: fit-content;
  max-width: 100%;
  margin-top: 1.4rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(143, 62, 74, 0.16);
  border-radius: 1rem 1rem 1rem 0.25rem;
  background: rgba(255, 253, 249, 0.82);
  box-shadow: 0 12px 30px rgba(68, 52, 48, 0.1);
  color: var(--burgundy);
  font-family: var(--hand);
  font-size: clamp(1.45rem, 6vw, 2.15rem);
  line-height: 1.08;
}

.cinema__screen img {
  aspect-ratio: 4 / 3;
  border-radius: 1.2rem;
  filter: saturate(0.86) contrast(0.94);
}

.horse__card {
  padding: 0.75rem;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, rgba(255, 253, 249, 0.96), rgba(232, 199, 205, 0.36));
  box-shadow: var(--shadow);
}

.horse__photo img {
  aspect-ratio: 1 / 1;
  border-radius: 1rem;
  box-shadow: none;
  object-fit: contain;
  background: #fff;
}

.horse__photo {
  display: block;
  opacity: 0;
  transform: translateY(0.8rem) scale(0.96);
  pointer-events: none;
  transition: opacity 520ms ease, transform 520ms ease;
}

.horse__card.is-won .horse__photo {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.horse__button {
  width: 100%;
  justify-content: center;
  background: var(--burgundy);
  color: var(--ivory);
}

.horse__card.is-won .horse__photo {
  animation: horseFloat 760ms ease both;
}

.horse__result {
  color: var(--burgundy);
}

.teddy__album {
  position: relative;
  min-height: 28rem;
}

.teddy-main img {
  aspect-ratio: 4 / 5;
  border: 0.55rem solid var(--ivory);
  border-radius: 1.4rem;
}

.teddy-sticker {
  position: absolute;
  right: 0.2rem;
  bottom: 1rem;
  width: min(42vw, 12rem);
  padding: 0.45rem;
  border-radius: 1rem;
  background: var(--ivory);
  transform: rotate(5deg);
}

.teddy-sticker img {
  aspect-ratio: 1 / 1;
  border-radius: 0.7rem;
  box-shadow: none;
}

.teddy-sticker.second {
  right: auto;
  left: 0.2rem;
  bottom: -0.5rem;
  transform: rotate(-5deg);
}

.scraps {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.5rem 0;
}

.scrap {
  min-height: 3rem;
  border: 1px solid rgba(38, 48, 59, 0.11);
  border-radius: 1rem 1rem 0.35rem 1rem;
  background: rgba(255, 253, 249, 0.82);
  box-shadow: 0 10px 26px rgba(68, 52, 48, 0.09);
  color: var(--ink);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transform: rotate(var(--r, -2deg));
  transition: transform 220ms ease, background 220ms ease;
}

.scrap:nth-child(2n) {
  --r: 2deg;
}

.scrap:nth-child(3n) {
  --r: -1deg;
}

.scrap.big {
  font-family: var(--hand);
  font-size: 1.55rem;
}

.scrap.pink,
.scrap.is-active {
  background: var(--rose);
}

.scrap.shout {
  font-weight: 800;
}

.scrap.quiet {
  color: var(--muted);
  font-size: 0.9rem;
}

.scrap:hover,
.scrap.is-active {
  transform: translateY(-0.25rem) rotate(0deg);
}

.joke-answer {
  min-height: 1.8rem;
  color: var(--burgundy);
}

.moments__duo {
  align-items: start;
}

.moments__duo .polaroid:nth-child(2) {
  margin-top: 1.6rem;
}

.support__strips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.support-poem {
  margin-top: 0;
}

.fragment-grid {
  display: grid;
  gap: 1rem;
}

.fragment-grid .album-photo img {
  aspect-ratio: 4 / 5;
}

.trip-path {
  display: grid;
  gap: 1rem;
}

.trip-photo {
  justify-self: var(--align, start);
  width: min(100%, var(--w, 25rem));
  padding: 0.55rem;
  border-radius: 1.2rem;
  background: var(--ivory);
  box-shadow: var(--shadow);
}

.trip-photo img {
  aspect-ratio: var(--ratio, 4 / 5);
  border-radius: 0.85rem;
  box-shadow: none;
}

.trip-photo.door {
  --w: 20rem;
}

.trip-photo.teddy-rock {
  --align: end;
  --w: 18rem;
}

.trip-photo.stones {
  --w: 28rem;
  --ratio: 16 / 10;
}

.extras-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.extras-grid img {
  aspect-ratio: 1 / 1;
  border-radius: 0.9rem;
}

.connection {
  width: min(100% - 1.25rem, 56rem);
}

.connection__paper {
  padding: clamp(2rem, 8vw, 5rem);
  border: 1px solid rgba(143, 62, 74, 0.16);
  border-radius: 2rem 2rem 0.7rem 2rem;
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.95), rgba(232, 199, 205, 0.24)),
    var(--ivory);
  box-shadow: var(--shadow);
}

.connection__paper p:not(.eyebrow) {
  max-width: 42rem;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 5vw, 1.9rem);
  line-height: 1.38;
  color: var(--ink);
}

.finale {
  min-height: 92svh;
  display: grid;
  place-items: center;
  padding: 5rem 0;
  text-align: center;
}

.finale h2 {
  font-size: clamp(3rem, 13vw, 6rem);
}

.finale p:not(.eyebrow) {
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.55rem, 6vw, 2.45rem);
  line-height: 1.2;
}

.continue-button {
  background: transparent;
}

.after-note {
  min-height: 1.6rem;
  color: var(--burgundy) !important;
  font-family: var(--sans) !important;
  font-size: 0.95rem !important;
}

.reveal {
  opacity: 0;
  transform: translateY(1.1rem);
  transition: opacity 760ms ease, transform 760ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(38, 48, 59, 0.86);
}

.lightbox.is-open {
  display: grid;
}

.lightbox img {
  max-width: min(100%, 72rem);
  max-height: 86svh;
  object-fit: contain;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

.lightbox__close {
  position: fixed;
  top: max(0.8rem, env(safe-area-inset-top));
  right: max(0.8rem, env(safe-area-inset-right));
  width: 3rem;
  height: 3rem;
  border: 1px solid rgba(255, 250, 245, 0.38);
  border-radius: 50%;
  background: rgba(255, 250, 245, 0.12);
  color: var(--ivory);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

@keyframes horseFloat {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-0.7rem) rotate(-2deg);
  }
  100% {
    transform: translateY(0) rotate(1deg);
  }
}

@media (min-width: 740px) {
  .topbar {
    padding-inline: clamp(2rem, 5vw, 4.5rem);
  }

  .hero {
    grid-template-columns: minmax(20rem, 0.8fr) minmax(0, 1fr);
    gap: clamp(2rem, 7vw, 6rem);
    align-items: center;
  }

  .hero__image {
    justify-self: start;
  }

  .person,
  .sesha,
  .cinema,
  .horse,
  .teddy,
  .moments,
  .support {
    grid-template-columns: minmax(0, 0.9fr) minmax(19rem, 1fr);
    align-items: center;
  }

  .sesha__photos,
  .horse__card,
  .support__strips {
    order: 2;
  }

  .person {
    grid-template-columns: minmax(16rem, 0.72fr) minmax(0, 1fr);
    align-items: start;
  }

  .person .section-kicker {
    grid-column: 1 / -1;
  }

  .diary-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
  }

  .album-photo {
    grid-column: span 2;
  }

  .album-photo.large {
    grid-column: span 3;
  }

  .album-photo.wide {
    grid-column: span 3;
  }

  .up {
    margin-top: 2.5rem;
  }

  .ice {
    padding-inline: clamp(2rem, 5vw, 4rem);
  }

  .ice__stage {
    grid-template-columns: minmax(18rem, 0.75fr) minmax(0, 1fr);
    align-items: center;
  }

  .ice__stage .poem-note {
    align-self: end;
  }

  .fragment-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
  }

  .fragment-grid > * {
    grid-column: span 2;
  }

  .trip-path {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: center;
  }

  .trip-path > * {
    grid-column: span 4;
  }

  .trip-path .quote-paper:nth-of-type(1) {
    grid-column: 5 / span 4;
  }

  .trip-path .teddy-rock {
    grid-column: 9 / span 3;
  }

  .trip-path .quote-paper:nth-of-type(2) {
    grid-column: 2 / span 4;
  }

  .trip-path .stones {
    grid-column: 6 / span 6;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .section,
  .finale {
    width: min(100% - 1rem, 72rem);
  }

  .hero {
    min-height: auto;
  }

  .diary-grid {
    gap: 0.65rem;
  }

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

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
