:root {
  color-scheme: light;
  --color-birthday-pink: oklch(87% 0.055 6);
  --color-birthday-pink-deep: oklch(78% 0.09 4);
  --color-frosted-cream: oklch(97% 0.018 75);
  --color-paper-shadow: oklch(69% 0.055 342);
  --color-muted-violet: oklch(73% 0.09 312);
  --color-plum-ink: oklch(36% 0.105 335);
  --color-raspberry: oklch(48% 0.18 354);
  --color-focus: oklch(43% 0.16 300);
  --font-display: "DynaPuff", "Arial Rounded MT Bold", ui-rounded, sans-serif;
  --font-body: ui-rounded, "Avenir Next", "Segoe UI", sans-serif;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --radius-soft: 1.25rem;
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-paper: 0 0.75rem 2rem oklch(42% 0.06 340 / 0.12);
}

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

html {
  background: var(--color-birthday-pink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 20rem;
  overflow-x: hidden;
  color: var(--color-plum-ink);
  background:
    radial-gradient(circle at 24% 18%, oklch(99% 0.006 75 / 0.2) 0 0.06rem, transparent 0.08rem),
    radial-gradient(circle at 78% 64%, oklch(70% 0.05 340 / 0.08) 0 0.05rem, transparent 0.07rem),
    var(--color-birthday-pink);
  background-size: 1.15rem 1.15rem, 1.4rem 1.4rem, auto;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
iframe {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: var(--space-md);
  left: var(--space-md);
  padding: 0.75rem 1rem;
  color: var(--color-frosted-cream);
  background: var(--color-plum-ink);
  border-radius: 999px;
  transform: translateY(-180%);
  transition: transform 180ms var(--ease-out-quint);
}

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

.chapter {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 100svh;
  overflow: clip;
  padding-inline:
    max(clamp(1.25rem, 6vw, 5rem), env(safe-area-inset-left))
    max(clamp(1.25rem, 6vw, 5rem), env(safe-area-inset-right));
  isolation: isolate;
}

.chapter--hello {
  place-content: center;
  min-height: 100svh;
  padding-block: max(5rem, env(safe-area-inset-top)) var(--space-4xl);
  text-align: center;
}

.birthday-title {
  display: grid;
  justify-items: center;
  margin: 0;
  color: var(--color-raspberry);
  font-family: var(--font-display);
  font-size: clamp(3rem, 15vw, 7.5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.name-reveal {
  position: relative;
  min-width: min(90vw, 7.5em);
  min-height: 44px;
  margin: 0.04em 0 0;
  padding: 0.03em 0.1em 0.11em;
  overflow: visible;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0.55em;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  -webkit-tap-highlight-color: transparent;
}

.name-reveal__name {
  display: block;
  opacity: 0.48;
  filter: blur(0.7rem);
  transform-origin: 50% 50%;
  transition:
    opacity 280ms var(--ease-out-quint),
    filter 360ms var(--ease-out-quint),
    transform 360ms var(--ease-out-quint);
}

.name-reveal.is-revealed .name-reveal__name {
  opacity: 1;
  filter: blur(0);
  transform: scale(1.015);
}

.name-reveal:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 0.12em;
}

.reveal-cue {
  position: relative;
  margin: var(--space-xl) auto 0;
  padding-top: 1.8rem;
  color: var(--color-plum-ink);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.reveal-cue::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1rem;
  height: 1rem;
  border-right: 0.16rem solid currentColor;
  border-bottom: 0.16rem solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.paper-cloud {
  position: absolute;
  z-index: -1;
  background: var(--color-frosted-cream);
  box-shadow: var(--shadow-paper);
}

.paper-cloud--corner {
  top: -3.5rem;
  left: -3rem;
  width: clamp(9rem, 38vw, 22rem);
  aspect-ratio: 1.9;
  border-radius: 45% 55% 51% 49% / 66% 61% 39% 34%;
  transform: rotate(-7deg);
}

.chapter--tutorials {
  align-content: center;
  gap: clamp(5rem, 16vw, 9rem);
  padding-block: clamp(7rem, 22vw, 11rem);
  background: var(--color-frosted-cream);
}

.paper-edge {
  position: absolute;
  z-index: 1;
  right: -2%;
  left: -2%;
  height: 3rem;
  background: var(--color-frosted-cream);
  clip-path: polygon(0 30%, 4% 21%, 9% 36%, 14% 18%, 20% 32%, 27% 15%, 33% 29%, 41% 13%, 48% 28%, 55% 16%, 62% 31%, 70% 14%, 77% 30%, 84% 18%, 92% 33%, 100% 21%, 100% 100%, 0 100%);
}

.paper-edge--top {
  top: -2.95rem;
}

.paper-edge--bottom {
  bottom: -2.95rem;
  transform: rotate(180deg);
}

.tutorial {
  position: relative;
  width: min(100%, 52rem);
  margin-inline: auto;
}

.tutorial--short {
  width: min(72%, 23rem);
  margin-inline: auto;
  justify-self: center;
}

.tutorial__label {
  margin: 0 0 var(--space-md);
  color: var(--color-plum-ink);
  font-size: clamp(1rem, 3.8vw, 1.25rem);
  font-weight: 750;
}

.tutorial--short .tutorial__label {
  text-align: center;
}

.video-frame {
  position: relative;
  overflow: hidden;
  background: var(--color-muted-violet);
  border: clamp(0.4rem, 1.5vw, 0.75rem) solid var(--color-muted-violet);
  box-shadow: var(--shadow-paper);
}

.video-frame--landscape {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-soft) calc(var(--radius-soft) * 0.7) calc(var(--radius-soft) * 1.2) calc(var(--radius-soft) * 0.8);
  transform: rotate(-0.6deg);
}

.video-frame--short {
  aspect-ratio: 9 / 16;
  border-color: var(--color-birthday-pink-deep);
  border-radius: calc(var(--radius-soft) * 0.75) calc(var(--radius-soft) * 1.15) calc(var(--radius-soft) * 0.8) var(--radius-soft);
  transform: rotate(0.8deg);
}

.video-frame iframe,
.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: calc(var(--radius-soft) * 0.55);
}

.chapter--closing {
  place-content: center;
  min-height: 82svh;
  padding-block: var(--space-4xl) max(var(--space-4xl), env(safe-area-inset-bottom));
  text-align: center;
}

.chapter--closing h2 {
  max-width: 12ch;
  margin: 0 auto;
  color: var(--color-raspberry);
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 13vw, 7rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.paper-cloud--footer {
  right: -3rem;
  bottom: -4rem;
  width: clamp(12rem, 55vw, 32rem);
  aspect-ratio: 2;
  border-radius: 56% 44% 38% 62% / 64% 56% 44% 36%;
  transform: rotate(5deg);
}

@media (hover: hover) {
  .name-reveal:not(.is-revealed):hover .name-reveal__name {
    opacity: 0.82;
    filter: blur(0.08rem);
    transform: scale(1.01);
  }

  .video-frame {
    transition: transform 260ms var(--ease-out-quint), box-shadow 260ms var(--ease-out-quint);
  }

  .video-frame:hover {
    box-shadow: 0 1.1rem 2.5rem oklch(42% 0.06 340 / 0.16);
  }

  .video-frame--landscape:hover {
    transform: rotate(-0.2deg) translateY(-0.2rem);
  }

  .video-frame--short:hover {
    transform: rotate(0.3deg) translateY(-0.2rem);
  }
}

@media (min-width: 48rem) {
  .chapter--hello {
    min-height: 100svh;
  }

  .chapter--tutorials {
    grid-template-columns: minmax(0, 1.35fr) minmax(15rem, 0.65fr);
    align-items: center;
    gap: clamp(3rem, 7vw, 7rem);
    padding-block: clamp(9rem, 14vw, 13rem);
  }

  .tutorial--short {
    width: min(100%, 23rem);
    margin: clamp(6rem, 10vw, 11rem) auto 0;
  }

  .tutorial--short .tutorial__label {
    margin-left: 0;
  }
}

@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;
  }
}
