/* ==========================================================================
   Base theme
   ========================================================================== */

:root {
  --bg: #fdf4ec;
  --bg-deep: #f8e6da;
  --surface: #fffbf7;
  --surface-soft: #faece2;
  --ink: #3b2a26;
  --ink-soft: #6d5751;
  --muted: #7d6660;
  --accent: #b95261;
  --accent-deep: #8e3a48;
  --accent-soft: #f2cdd0;
  --sage: #7f9a7f;
  --gold: #b08a55;
  --line: rgba(59, 42, 38, 0.13);
  --line-strong: rgba(59, 42, 38, 0.24);
  --shadow-sm: 0 6px 20px rgba(93, 57, 45, 0.07);
  --shadow-md: 0 18px 46px rgba(93, 57, 45, 0.11);
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 30px;
  --content: 68rem;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 5% 2%, rgba(242, 205, 208, 0.45), transparent 42%),
    radial-gradient(ellipse at 98% 28%, rgba(219, 231, 213, 0.5), transparent 38%),
    radial-gradient(ellipse at 45% 100%, rgba(247, 219, 193, 0.55), transparent 45%);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent-deep);
  text-underline-offset: 0.18em;
}

::selection {
  color: var(--ink);
  background: var(--accent-soft);
}

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

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 400;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: #fff9f5;
  background: var(--accent-deep);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.eyebrow {
  color: var(--accent-deep);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-transform: uppercase;
}

.section {
  padding: clamp(4.5rem, 11vw, 8rem) clamp(1.25rem, 4vw, 2rem);
}

.section--alt {
  border-block: 1px solid rgba(59, 42, 38, 0.07);
  background: linear-gradient(180deg, rgba(255, 251, 247, 0.6), rgba(250, 236, 226, 0.64));
}

.section__head {
  max-width: 42rem;
  margin: 0 auto clamp(2rem, 5vw, 3.2rem);
  text-align: center;
}

.section__head h2 {
  margin: 0.35rem 0 0.85rem;
  color: var(--ink);
  font-size: clamp(2rem, 6vw, 3.3rem);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.section__note {
  max-width: 32rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  text-wrap: pretty;
}

section[id] {
  scroll-margin-top: 1rem;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(3.75rem + env(safe-area-inset-top)) 1.25rem calc(3rem + env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(253, 244, 236, 0) 0%, rgba(251, 233, 222, 0.7) 68%, rgba(253, 244, 236, 0) 100%),
    radial-gradient(circle at 50% 38%, rgba(255, 251, 247, 0.9), transparent 62%);
  text-align: center;
}

.hero__glow {
  position: absolute;
  z-index: -1;
  width: min(78vw, 34rem);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
}

.hero__glow--one {
  top: -14%;
  left: -28%;
  background: radial-gradient(circle, rgba(242, 205, 208, 0.75), transparent 68%);
}

.hero__glow--two {
  right: -30%;
  bottom: -18%;
  background: radial-gradient(circle, rgba(219, 231, 213, 0.7), transparent 68%);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 60rem;
}

.hero__name {
  margin: 0.4rem 0 1.15rem;
  color: var(--ink);
  font-size: clamp(2.9rem, 14vw, 7.5rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.94;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.hero__tagline {
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 2.7vw, 1.22rem);
  line-height: 1.7;
  text-wrap: pretty;
}

.counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-top: 2.2rem;
  padding-top: 1.4rem;
}

.counter::before {
  content: "";
  width: 2.6rem;
  height: 1px;
  margin-bottom: 0.85rem;
  background: var(--line-strong);
}

.counter__value {
  color: var(--accent-deep);
  font-family: var(--serif);
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.counter__label {
  max-width: 19rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  margin-top: clamp(2.5rem, 8vh, 4.5rem);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.25s var(--ease);
}

.scroll-hint__arrow {
  animation: hint-bob 2.2s ease-in-out infinite;
}

@keyframes hint-bob {
  0%,
  100% {
    opacity: 0.65;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(5px);
  }
}

/* ==========================================================================
   Timeline
   ========================================================================== */

.timeline {
  position: relative;
  display: grid;
  gap: 2rem;
  max-width: 58rem;
  margin: 0 auto;
  padding: 0 0 0 1.6rem;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  left: 0.4rem;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, #e3b3ad 10%, #dcc7ba 90%, transparent);
}

.timeline__item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 251, 247, 0.88);
  box-shadow: var(--shadow-sm);
}

.timeline__item::before {
  content: "";
  position: absolute;
  top: 1.6rem;
  left: -1.55rem;
  z-index: 1;
  width: 11px;
  height: 11px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(185, 82, 97, 0.25);
}

.timeline__photo {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.7), transparent 45%),
    linear-gradient(135deg, #f4d8ce, #ecd9ca 50%, #dbe5d4);
}

.timeline__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline__body {
  padding: 1.2rem 1.25rem 1.4rem;
}

.timeline__date {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent-deep);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.timeline__title {
  margin-bottom: 0.45rem;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
}

.timeline__text {
  color: var(--ink-soft);
  font-size: 0.97rem;
  line-height: 1.65;
}

/* ==========================================================================
   Photos and fallback
   ========================================================================== */

.photo-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  color: rgba(142, 58, 72, 0.48);
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
}

.photo--empty img {
  display: none;
}

.photo--empty .photo-placeholder {
  display: grid;
}

.photo--empty {
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.78), transparent 46%),
    linear-gradient(135deg, #f5dbd2, #ecd9cb 50%, #dbe5d6);
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  max-width: 64rem;
  margin: 0 auto;
}

.gallery__btn {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 44px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.7), transparent 45%),
    linear-gradient(135deg, #f4d8ce, #ecd9ca 50%, #dbe5d4);
  box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
}

.gallery__btn::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 52%;
  background: linear-gradient(transparent, rgba(43, 28, 24, 0.62));
  pointer-events: none;
}

.gallery__btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.gallery__caption {
  position: absolute;
  right: 0.7rem;
  bottom: 0.6rem;
  left: 0.7rem;
  z-index: 1;
  display: -webkit-box;
  overflow: hidden;
  color: #fffaf6;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* ==========================================================================
   Buttons and lightbox
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}

.btn--primary {
  color: #fff8f4;
  background: var(--accent-deep);
  box-shadow: 0 12px 30px rgba(142, 58, 72, 0.28);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 250, 246, 0.28);
  border-radius: 50%;
  color: #fffaf6;
  background: rgba(43, 28, 24, 0.55);
  font-family: var(--sans);
  font-size: 1.7rem;
  line-height: 1;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(38, 25, 22, 0.9);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 64rem);
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding-top: 2.5rem;
}

.lightbox__placeholder {
  display: none;
  width: min(100%, 46rem);
  min-height: min(52svh, 26rem);
  place-items: center;
  border-radius: 16px;
  color: rgba(142, 58, 72, 0.5);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.8), transparent 46%),
    linear-gradient(135deg, #f5dbd2, #ecd9cb 50%, #dbe5d6);
  font-family: var(--serif);
  font-size: 3rem;
  line-height: 1;
}

.lightbox__figure--empty .lightbox__placeholder {
  display: grid;
}

.lightbox__figure--empty .lightbox__img {
  display: none;
}

.lightbox:not([hidden]) .lightbox__panel {
  animation: lightbox-in 0.3s var(--ease) both;
}

@keyframes lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox__img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 68svh;
  border-radius: 16px;
  background: #2b1c18;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.lightbox__caption {
  max-width: 36rem;
  color: #fdf4ec;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
}

.lightbox__nav--prev {
  left: 0.25rem;
}

.lightbox__nav--next {
  right: 0.25rem;
}

/* ==========================================================================
   Jokes and diploma
   ========================================================================== */

.jokes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  max-width: 64rem;
  margin: 0 auto;
}

.joke-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 15rem;
  padding: 0;
  border: 0;
  background: transparent;
  -webkit-perspective: 1000px;
  perspective: 1000px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.joke-card__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 15rem;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  transition: transform 0.65s var(--ease);
}

.joke-card.is-flipped .joke-card__inner {
  transform: rotateY(180deg);
}

.joke-card__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.joke-card__face--back {
  color: #4a2c31;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 255, 255, 0.6), transparent 40%),
    linear-gradient(155deg, #f8e1db, #efd0c3);
  transform: rotateY(180deg);
}

.joke-card__label {
  color: var(--accent-deep);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.joke-card__text {
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.35;
  text-wrap: pretty;
}

.joke-card__hint {
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.06em;
}

.diploma-wrap {
  max-width: 30rem;
  margin: clamp(2rem, 5vw, 3rem) auto 0;
}

.diploma {
  position: relative;
  padding: 2rem 1.5rem 2.4rem;
  overflow: hidden;
  border: 1px solid #d8c3a5;
  border-radius: 10px;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.85), transparent 45%),
    #fff9ec;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.diploma::before {
  content: "";
  position: absolute;
  inset: 0.5rem;
  border: 1px solid rgba(176, 138, 85, 0.4);
  border-radius: 6px;
  pointer-events: none;
}

.diploma__kicker {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.diploma__title {
  margin: 0.5rem 0 0.35rem;
  color: #5a4030;
  font-size: clamp(1.55rem, 6vw, 2rem);
  line-height: 1.15;
}

.diploma__text {
  color: #765a45;
  font-size: 0.92rem;
}

.diploma__stamp {
  display: grid;
  place-items: center;
  width: 5.2rem;
  height: 5.2rem;
  margin: 1.35rem auto 0;
  border: 3px double #a8484f;
  border-radius: 50%;
  color: #a8484f;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  white-space: pre-line;
  opacity: 1;
  transform: rotate(-12deg);
}

.diploma.is-stamped .diploma__stamp {
  animation: stamp-in 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.25) forwards;
}

@keyframes stamp-in {
  0% {
    opacity: 0;
    transform: rotate(-12deg) scale(1.45);
  }
  60% {
    opacity: 1;
    transform: rotate(-12deg) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: rotate(-12deg) scale(1);
  }
}

/* ==========================================================================
   Quiz
   ========================================================================== */

.quiz {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(1.25rem, 5vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 251, 247, 0.94);
  box-shadow: var(--shadow-md);
}

.quiz__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quiz__question {
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  line-height: 1.25;
  text-wrap: pretty;
}

.quiz__question:focus,
.quiz__result-title:focus {
  outline: none;
}

.quiz__options {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.4rem;
}

.quiz__option {
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #fffdfb;
  font-size: 0.97rem;
  line-height: 1.45;
  text-align: left;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.quiz__option.is-correct {
  border-color: #86a37f;
  background: #e8f1e4;
  color: #2f4a2c;
}

.quiz__option.is-wrong {
  border-color: #c98383;
  background: #f9e5e2;
  color: #733434;
}

.quiz__option:disabled {
  cursor: default;
  opacity: 1;
}

.quiz__feedback {
  min-height: 1.5rem;
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.quiz__actions {
  margin-top: 1.25rem;
}

.quiz__actions .btn,
.quiz__restart {
  width: 100%;
}

.quiz__result-title {
  color: var(--accent-deep);
  font-size: clamp(1.7rem, 6vw, 2.2rem);
}

.quiz__result-text {
  margin-top: 0.75rem;
  color: var(--ink-soft);
}

.quiz__restart {
  margin-top: 1.4rem;
}

/* ==========================================================================
   Finale and footer
   ========================================================================== */

.finale {
  position: relative;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(242, 205, 208, 0.55), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(219, 231, 213, 0.55), transparent 45%);
}

.finale__inner {
  max-width: 42rem;
  margin: 0 auto;
}

.finale h2 {
  margin: 0.4rem 0 0;
  font-size: clamp(2rem, 6.5vw, 3.4rem);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.finale__btn {
  min-height: 60px;
  margin-top: 1.8rem;
  padding: 1rem 2.75rem;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.finale__message {
  margin-top: 2rem;
  padding: clamp(1.4rem, 5vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 251, 247, 0.94);
  box-shadow: var(--shadow-md);
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.75;
  text-align: left;
}

.finale__message:focus {
  outline: none;
}

.finale__message p + p {
  margin-top: 1em;
}

.finale__message .finale__signature {
  margin-top: 1.5rem;
  color: var(--accent-deep);
  font-family: var(--serif);
  font-size: 1.3rem;
  text-align: right;
}

.finale__message.is-visible {
  animation: fade-up 0.8s var(--ease) both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.footer {
  padding: 2rem 1.25rem calc(2rem + env(safe-area-inset-bottom));
  color: var(--muted);
  text-align: center;
}

.footer__heart {
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-size: 0.9rem;
  line-height: 1;
}

.footer__signature {
  font-family: var(--serif);
  font-size: 0.98rem;
}

/* ==========================================================================
   Effects
   ========================================================================== */

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 90;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hearts {
  position: fixed;
  inset: 0;
  z-index: 95;
  overflow: hidden;
  pointer-events: none;
}

.hearts__item {
  position: absolute;
  top: -12vh;
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  will-change: transform, opacity;
  animation: heart-fall linear forwards;
}

@keyframes heart-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -12vh, 0) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift, 0), 112vh, 0) rotate(var(--spin, 30deg));
  }
}

/* Scroll reveal: the class is added by JS, so content stays visible without JS. */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {
  .scroll-hint:hover {
    color: var(--accent-deep);
  }

  .gallery__btn:hover img {
    transform: scale(1.045);
  }

  .gallery__btn:hover::after {
    opacity: 0.9;
  }

  .btn--primary:hover {
    background: #7a2f3c;
    box-shadow: 0 16px 36px rgba(142, 58, 72, 0.32);
    transform: translateY(-2px);
  }

  .icon-btn:hover {
    background: rgba(43, 28, 24, 0.82);
  }

  .quiz__option:not(:disabled):hover {
    border-color: var(--accent);
    background: #fff7f3;
  }
}

.btn--primary:active {
  transform: translateY(0) scale(0.99);
}

@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }

  .lightbox__nav--prev {
    left: 0.5rem;
  }

  .lightbox__nav--next {
    right: 0.5rem;
  }
}

@media (min-width: 760px) {
  body {
    font-size: 1.09375rem;
  }

  .timeline {
    padding-left: 2rem;
  }

  .timeline__item {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: stretch;
  }

  .timeline__item::before {
    top: 2rem;
    left: -1.95rem;
  }

  .timeline__photo {
    height: 100%;
    min-height: 15rem;
    aspect-ratio: auto;
    border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
  }

  .timeline__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.75rem 1.8rem;
  }

  .timeline__title {
    font-size: 1.7rem;
  }

  .lightbox__figure {
    padding-top: 3rem;
  }

  .lightbox__img {
    max-height: 74svh;
  }

  .lightbox__nav {
    width: 52px;
    height: 52px;
  }
}

@media (min-width: 960px) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero__name {
    font-size: clamp(6rem, 10vw, 7.5rem);
  }

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

  .joke-card {
    min-height: 16rem;
  }

  .joke-card__inner {
    min-height: 16rem;
  }
}

@media (min-width: 1280px) {
  .section {
    padding-inline: 2rem;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

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

  .confetti-canvas,
  .hearts {
    display: none;
  }
}
