/* One chapter per screen. The original palette and illustration styles live in style.css. */
:root {
  --header-height: calc(76px + env(safe-area-inset-top, 0px));
  --navigation-height: calc(108px + env(safe-area-inset-bottom, 0px));
  --scene-direction: 1;
}
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  height: 100dvh;
}
.topbar {
  position: fixed;
  inset: 0 0 auto;
  height: var(--header-height);
  padding: env(safe-area-inset-top, 0px) 6% 0;
}
main {
  position: fixed;
  inset: var(--header-height) 0 0;
  overflow: hidden;
  container-type: size;
  container-name: birthday-stage;
}
body.story-started main {
  bottom: var(--navigation-height);
}
#birthday-story {
  position: absolute;
  inset: 0;
}
.invitation {
  height: 100%;
  min-height: 0;
  padding: 20px 64px 60px;
  overflow: hidden;
}
.invite-copy {
  padding-bottom: 0;
}
.invite-copy h1 {
  font-size: clamp(48px, 9dvh, 86px);
  margin: 20px 0;
}
.invite-art {
  height: min(515px, 66dvh);
}
.invitation-footer {
  bottom: 18px;
}
.story-section {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2dvh, 20px);
  overflow: hidden;
}
.story-section:focus {
  outline: none;
}
.section-heading {
  margin: 0;
  flex-shrink: 0;
}
.section-heading h2 {
  font-size: clamp(38px, 7.5dvh, 65px);
}
.section-heading > .handwritten {
  font-size: 24px;
  margin-bottom: 5px;
}
.section-heading p {
  margin-top: 12px;
  font-size: 12px;
}
.section-marker {
  flex-shrink: 0;
}
.birthday-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  max-width: 1060px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  padding: 20px 60px;
}
.birthday-heading h1 {
  font-size: clamp(54px, 9dvh, 86px);
}
.birthday-portrait {
  height: min(430px, 55dvh);
  width: min(345px, 35vw);
}
.cake-scene {
  margin: 0 auto;
  flex: 0 0 275px;
  height: 275px;
  transform: scale(0.92);
  transform-origin: center;
}
.wish-action {
  flex-shrink: 0;
}
.wish-action .small-note {
  margin-top: 8px;
}
.wish-completed .section-heading,
.wish-completed .wish-action {
  display: none;
}
.wish-result {
  margin-top: 0;
  flex-shrink: 0;
}
.wish-result h3 {
  font-size: clamp(34px, 6dvh, 52px);
  margin: 5px 0 12px;
}
.wish-result > .handwritten {
  font-size: 24px;
}
.memories-section {
  padding-left: 0;
  padding-right: 0;
  gap: 8px;
}
.memories-section .section-heading {
  margin-bottom: 0;
}
.memories-section .section-heading h2 {
  font-size: clamp(36px, 6.6dvh, 58px);
}
.memories-section .section-heading p {
  margin-top: 8px;
}
.memory-film {
  position: relative;
  width: 100%;
  flex: 0 1 auto;
  min-height: 0;
  padding: 15px calc((100% - var(--photo-width)) / 2) 20px;
  gap: 25px;
  --photo-width: clamp(175px, 29dvh, 270px);
}
.memory-card {
  flex-basis: var(--photo-width);
  padding: 9px 9px 10px;
}
.memory-card img {
  height: clamp(180px, 33dvh, 320px);
}
.memory-caption {
  margin-top: 10px;
}
.memory-caption > span {
  font-size: 19px;
}
.gallery-controls {
  width: 100%;
  max-width: 680px;
  padding: 0 24px;
  flex-shrink: 0;
}
.gallery-controls > .handwritten {
  font-size: 23px;
}
.gallery-hint {
  margin-top: 0;
  font-size: 9px;
}
.video-section {
  background: radial-gradient(ellipse, #f4d4e164, transparent 70%);
}
.our-film-frame {
  position: relative;
  flex: 0 1 auto;
  min-height: 0;
  max-width: 680px;
  max-height: min(48dvh, 500px);
  padding: 8px;
  background: #fffcf7;
  border: 1px solid #f0d6d7;
  border-radius: 18px;
  box-shadow: 0 18px 50px #7946501c;
  transform: rotate(-1deg);
  overflow: hidden;
  display: flex;
}
.our-film-frame video {
  display: block;
  max-width: 100%;
  max-height: calc(48dvh - 16px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 11px;
  background: #302029;
  pointer-events: none;
}
.film-touch-target {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  border-radius: inherit;
}
.film-touch-target:focus-visible {
  outline-offset: -4px;
}
.film-play-hint {
  display: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff5f2d9;
  color: var(--rose);
  box-shadow: 0 4px 20px #5e2e4933;
  font: 37px/54px var(--serif);
}
.film-paused .film-play-hint {
  display: block;
}
.film-caption {
  font-size: 25px;
  text-align: center;
}
.film-note {
  font-size: 9px;
  text-align: center;
}
.film-note a {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.envelope {
  margin: 24px auto 5px;
  flex-shrink: 0;
}
.letter-opened .section-heading > .handwritten {
  display: none;
}
.letter-opened .section-heading h2 {
  font-size: clamp(28px, 5dvh, 42px);
}
.letter-opened .section-heading h2 br {
  display: none;
}
.love-letter {
  margin: 0;
  width: min(100%, 530px);
  padding: 28px 38px 40px;
  flex-shrink: 0;
  transition:
    opacity 0.22s,
    transform 0.35s;
}
.love-letter h3 {
  margin: 14px 0 12px;
  font-size: 31px;
}
.love-letter p {
  font-size: 13px;
  line-height: 1.95;
  margin-bottom: 14px;
}
.love-letter p:last-child {
  margin-bottom: 0;
}
.letter-page {
  animation: soft-in 0.6s both;
}
.letter-page:focus {
  outline: none;
}
.letter-page-count {
  position: absolute;
  bottom: 17px;
  left: 38px;
  color: #b5949e;
  font-size: 8px;
  letter-spacing: 2px;
}
.letter-bottom-heart {
  right: 24px;
  bottom: 12px;
  font-size: 20px;
}
.letter-ending {
  margin-top: 10px;
}
.page-turning {
  opacity: 0;
  transform: translateX(-12px) rotate(-1deg);
}
.forever-section {
  gap: 14px;
}
.forever-heart {
  font-size: clamp(50px, 10dvh, 95px);
  margin: 0;
  line-height: 1;
}
.forever-section h2 {
  font-size: clamp(40px, 7.6dvh, 70px);
  margin: 5px 0;
}
.forever-section .primary-button {
  margin-top: 10px;
}
.final-note {
  margin: 0;
  font-size: 25px;
  min-height: 38px;
}
.scene-navigation {
  position: fixed;
  inset: auto 0 0;
  z-index: 25;
  height: var(--navigation-height);
  padding: 10px max(25px, calc((100vw - 950px) / 2))
    calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(#fff6f200, var(--paper) 20%);
}
.scene-progress {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-bottom: 15px;
}
.scene-progress i {
  height: 3px;
  width: 20px;
  border-radius: 5px;
  background: #e8cfd3;
  transition:
    background 0.5s,
    width 0.5s;
}
.scene-progress i.complete {
  background: #d58da2;
}
.scene-progress i.current {
  width: 33px;
  background: var(--rose);
}
.scene-navigation-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.scene-back {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid #ddbdc5;
  border-radius: 50%;
  background: transparent;
  font-size: 23px;
  transition:
    opacity 0.3s,
    background 0.3s;
}
.scene-back:hover {
  background: #f9e3e8;
}
.scene-back:disabled {
  opacity: 0.25;
}
.scene-status {
  flex: 1;
  font-size: 8px;
  color: #aa7c8a;
  letter-spacing: 1.4px;
  line-height: 1.8;
  min-width: 0;
}
.scene-status > span {
  display: block;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.1px;
}
.scene-next {
  min-height: 46px;
  padding: 13px 19px;
  font-size: 11px;
  gap: 15px;
  box-shadow: none;
  white-space: nowrap;
}
.scene-next:disabled {
  opacity: 0.45;
  transform: none;
}
.scene-next svg {
  width: 17px;
  height: 17px;
}
.scene-enter {
  animation: scene-appear 0.65s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.scene-enter .reveal {
  animation: content-appear 0.85s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.scene-enter .reveal:nth-child(2) {
  animation-delay: 0.09s;
}
.scene-enter .reveal:nth-child(3) {
  animation-delay: 0.16s;
}
.scene-enter .reveal:nth-child(4) {
  animation-delay: 0.22s;
}
.scene-leave {
  animation: scene-disappear 0.32s ease-in both;
  pointer-events: none;
}
@keyframes scene-appear {
  from {
    opacity: 0;
    filter: blur(5px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}
@keyframes content-appear {
  from {
    opacity: 0;
    translate: calc(var(--scene-direction) * 26px) 12px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@keyframes scene-disappear {
  to {
    opacity: 0;
    filter: blur(4px);
    translate: calc(var(--scene-direction) * -22px) -6px;
  }
}
@media (min-width: 701px) {
  .wish-section {
    display: grid;
    grid-template-columns: minmax(300px, 450px) minmax(300px, 400px);
    grid-template-rows: auto auto auto;
    align-content: center;
    justify-content: center;
    gap: 18px 35px;
  }
  .wish-section .section-marker {
    grid-column: 1 / -1;
  }
  .wish-section .section-heading {
    grid-column: 1;
    grid-row: 2;
  }
  .wish-section .cake-scene {
    grid-column: 2;
    grid-row: 2 / 4;
  }
  .wish-action {
    grid-column: 1;
    grid-row: 3;
  }
  .wish-result {
    grid-column: 1;
    grid-row: 2 / 4;
  }
  .memories-section {
    display: grid;
    grid-template-columns: minmax(280px, 400px) minmax(320px, 600px);
    grid-template-rows: auto auto auto auto;
    justify-content: center;
    align-content: center;
    gap: 18px 15px;
    padding: 15px 30px;
  }
  .memories-section .section-marker {
    grid-column: 1;
    grid-row: 1;
  }
  .memories-section .section-heading {
    grid-column: 1;
    grid-row: 2;
  }
  .memories-section .memory-film {
    grid-column: 2;
    grid-row: 1 / 5;
  }
  .memories-section .gallery-controls {
    grid-column: 1;
    grid-row: 3;
    flex-direction: column;
    gap: 16px;
  }
  .memories-section .gallery-hint {
    grid-column: 1;
    grid-row: 4;
  }
  .video-section {
    display: grid;
    grid-template-columns: minmax(300px, 460px) minmax(240px, 380px);
    grid-template-rows: auto auto auto auto;
    align-content: center;
    justify-content: center;
    gap: 18px 40px;
  }
  .video-section .section-marker {
    grid-column: 1;
    grid-row: 1;
  }
  .video-section .section-heading {
    grid-column: 1;
    grid-row: 2;
  }
  .video-section .our-film-frame {
    grid-column: 2;
    grid-row: 1 / 5;
    max-height: min(62dvh, 520px);
    justify-self: center;
  }
  .video-section video {
    max-height: min(calc(62dvh - 18px), 502px);
  }
  .film-caption {
    grid-column: 1;
    grid-row: 3;
  }
  .film-note {
    grid-column: 1;
    grid-row: 4;
  }
}
@media (max-width: 700px) {
  :root {
    --header-height: calc(70px + env(safe-area-inset-top, 0px));
    --navigation-height: calc(102px + env(safe-area-inset-bottom, 0px));
  }
  .topbar {
    padding-left: 25px;
    padding-right: 25px;
  }
  .invitation {
    padding: 8px 22px 44px;
    gap: 12px;
    justify-content: center;
  }
  .invite-copy h1 {
    font-size: clamp(40px, 7dvh, 62px);
    margin: 15px 0 12px;
    line-height: 1.01;
  }
  .invite-copy .primary-button {
    margin-top: 18px;
    padding: 14px 21px;
    min-height: 48px;
  }
  .invite-copy .small-note {
    margin-top: 8px;
  }
  .invite-art {
    height: clamp(190px, 29dvh, 260px);
    width: 255px;
    margin: 8px auto 0;
    transform: none;
  }
  .polaroid {
    width: 135px;
    padding: 7px 7px 5px;
  }
  .polaroid img {
    height: clamp(132px, 19dvh, 164px);
  }
  .polaroid figcaption {
    font-size: 14px;
    padding-top: 7px;
  }
  .polaroid-back {
    top: 12px;
    left: 12px;
  }
  .polaroid-front {
    top: 40px;
    right: 9px;
  }
  .art-note {
    top: -8px;
    right: 6px;
    font-size: 17px;
  }
  .art-signature {
    bottom: 0;
    left: 4px;
    font-size: 17px;
  }
  .photo-tape {
    left: 40px;
    width: 50px;
    height: 16px;
  }
  .love-stamp {
    width: 51px;
    height: 51px;
    left: 15px;
    bottom: 28px;
  }
  .love-stamp svg {
    width: 14px;
    height: 14px;
  }
  .love-stamp span {
    font-size: 5px;
  }
  .star-one {
    top: -8px;
    font-size: 23px;
  }
  .star-two {
    bottom: 3px;
    font-size: 22px;
    right: -1px;
  }
  .invitation-footer {
    bottom: 12px;
    left: 24px;
    right: 24px;
    padding-top: 10px;
  }
  .story-section {
    gap: clamp(10px, 2dvh, 17px);
    padding: 12px 22px;
  }
  .birthday-hero {
    display: flex;
    max-width: none;
    left: 0;
    right: 0;
    transform: none;
    text-align: center;
  }
  .birthday-heading h1 {
    font-size: clamp(44px, 7.5dvh, 65px);
    margin: 15px 0 12px;
  }
  .birthday-heading p {
    font-size: 11px;
  }
  .birthday-portrait {
    height: clamp(190px, 32dvh, 310px);
    width: clamp(162px, 27dvh, 255px);
    margin: 4px auto 0;
  }
  .age-badge {
    width: 100px;
    height: 100px;
    right: -26px;
    bottom: 25px;
  }
  .age-badge strong {
    font-size: 58px;
  }
  .age-badge > span {
    font-size: 5px;
  }
  .portrait-label {
    font-size: 17px;
    bottom: 15px;
    left: 12px;
  }
  .section-heading h2 {
    font-size: clamp(36px, 6.8dvh, 58px);
  }
  .section-heading > .handwritten {
    font-size: 21px;
  }
  .section-heading p {
    font-size: 11px;
    margin-top: 10px;
  }
  .cake-scene {
    flex-basis: 255px;
    height: 255px;
    transform: scale(0.85);
    margin-top: -5px;
    margin-bottom: -5px;
  }
  .wish-result h3 {
    font-size: clamp(35px, 5.8dvh, 47px);
  }
  .wish-result p {
    font-size: 10px;
  }
  .wish-result > .handwritten {
    font-size: 22px;
  }
  .wish-button {
    min-width: min(275px, calc(100vw - 44px));
    padding: 15px 18px;
    min-height: 48px;
  }
  .wish-action .small-note {
    font-size: 8px;
  }
  .memories-section {
    padding: 10px 0;
    gap: 8px;
  }
  .memory-film {
    padding-top: 12px;
    padding-bottom: 17px;
    --photo-width: clamp(165px, 27dvh, 245px);
  }
  .memory-card img {
    height: clamp(170px, 30dvh, 290px);
  }
  .memory-caption > span {
    font-size: 17px;
  }
  .gallery-controls {
    gap: 10px;
  }
  .gallery-controls > .handwritten {
    font-size: 20px;
  }
  .gallery-controls > div {
    gap: 20px;
  }
  .circle-button {
    width: 36px;
    height: 36px;
  }
  .gallery-hint {
    font-size: 8px;
  }
  .our-film-frame {
    max-width: 100%;
    max-height: 35dvh;
    padding: 6px;
    border-radius: 14px;
  }
  .our-film-frame video {
    max-height: calc(35dvh - 14px);
    border-radius: 8px;
  }
  .film-caption {
    font-size: 21px;
  }
  .video-section {
    gap: 10px;
  }
  .video-section .section-heading h2 {
    font-size: clamp(32px, 5.5dvh, 48px);
  }
  .film-note {
    font-size: 8px;
  }
  .envelope {
    margin: 18px auto 0;
    width: min(310px, 100%);
    height: 205px;
  }
  .letter-opened .section-heading h2 {
    font-size: 32px;
  }
  .love-letter {
    padding: 24px 25px 35px;
  }
  .love-letter h3 {
    font-size: 29px;
    margin: 12px 0;
  }
  .love-letter p {
    font-size: 12px;
    line-height: 1.9;
    margin-bottom: 12px;
  }
  .letter-page-count {
    left: 25px;
    bottom: 13px;
    font-size: 7px;
  }
  .letter-ending .handwritten {
    font-size: 28px;
    margin-top: 10px;
  }
  .forever-section h2 {
    font-size: clamp(38px, 6.4dvh, 54px);
  }
  .forever-section .primary-button {
    margin-top: 6px;
  }
  .final-note {
    font-size: 22px;
    max-width: 320px;
    line-height: 1.5;
    min-height: 38px;
  }
  .scene-navigation {
    padding-left: 22px;
    padding-right: 22px;
  }
  .scene-navigation-row {
    gap: 12px;
  }
  .scene-next {
    padding: 13px 16px;
    gap: 10px;
    font-size: 10px;
    max-width: 175px;
  }
  .scene-status {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .scene-status > span {
    font-size: 8px;
    max-width: 95px;
    line-height: 1.5;
  }
}
@media (max-height: 740px) and (max-width: 700px) {
  :root {
    --header-height: calc(62px + env(safe-area-inset-top, 0px));
    --navigation-height: calc(90px + env(safe-area-inset-bottom, 0px));
  }
  .story-section {
    gap: 9px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .scene-navigation {
    padding-top: 6px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .scene-progress {
    margin-bottom: 11px;
  }
  .scene-next {
    min-height: 43px;
  }
  .invitation {
    gap: 7px;
    padding-top: 4px;
    padding-bottom: 38px;
  }
  .invite-copy h1 {
    margin: 11px 0;
  }
  .invite-copy .primary-button {
    margin-top: 12px;
    min-height: 45px;
  }
  .intro-description {
    font-size: 10px;
  }
  .invite-art {
    margin-top: 4px;
    height: 180px;
  }
  .invite-art .polaroid img {
    height: 112px;
  }
  .invite-art .polaroid-front {
    top: 28px;
  }
  .invite-art .polaroid-back {
    top: 8px;
  }
  .invite-art .art-signature {
    bottom: -6px;
  }
  .section-heading > .handwritten {
    display: none;
  }
  .section-heading h2 {
    font-size: clamp(34px, 6.8dvh, 46px);
  }
  .wish-section:not(.wish-completed) .section-heading p {
    display: none;
  }
  .cake-scene {
    flex-basis: 205px;
    height: 205px;
    transform: scale(0.7);
    transform-origin: center top;
    margin: 0 auto;
  }
  .wish-result h3 {
    font-size: 36px;
  }
  .wish-result > .handwritten {
    font-size: 20px;
  }
  .birthday-heading h1 {
    margin: 10px 0;
  }
  .birthday-portrait {
    height: clamp(160px, 29dvh, 215px);
    width: clamp(145px, 25dvh, 180px);
  }
  .age-badge {
    width: 85px;
    height: 85px;
  }
  .age-badge strong {
    font-size: 49px;
  }
  .portrait-label {
    font-size: 14px;
  }
  .gallery-controls > .handwritten {
    display: none;
  }
  .memory-film {
    --photo-width: clamp(155px, 27dvh, 190px);
  }
  .memory-card img {
    height: clamp(155px, 29dvh, 210px);
  }
  .memory-caption > span {
    font-size: 15px;
  }
  .memories-section .section-heading h2 {
    font-size: 36px;
  }
  .memories-section .section-heading p {
    margin-top: 4px;
    font-size: 10px;
  }
  .letter-opened .section-marker {
    display: none;
  }
  .our-film-frame {
    max-height: 32dvh;
  }
  .our-film-frame video {
    max-height: calc(32dvh - 14px);
  }
  .letter-opened .section-heading h2 {
    font-size: 27px;
  }
  .love-letter {
    padding: 19px 22px 31px;
  }
  .love-letter h3 {
    font-size: 26px;
    margin: 8px 0;
  }
  .love-letter p {
    font-size: 11px;
    line-height: 1.8;
    margin-bottom: 10px;
  }
  .forever-section {
    gap: 10px;
  }
  .forever-section h2 {
    font-size: clamp(34px, 6.2dvh, 44px);
  }
  .forever-heart {
    font-size: 52px;
  }
  .final-note {
    font-size: 19px;
  }
}
@media (max-height: 800px) and (max-width: 700px) {
  .film-caption {
    display: none;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  :root {
    --header-height: 54px;
    --navigation-height: 78px;
  }
  .topbar {
    padding-left: 28px;
    padding-right: 28px;
  }
  .brand {
    font-size: 20px;
  }
  .brand span {
    font-size: 6px;
  }
  .invitation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px 45px 28px;
    gap: 20px;
    text-align: left;
  }
  .invite-copy h1 {
    font-size: 35px;
    margin: 8px 0;
    letter-spacing: -1px;
  }
  .intro-description {
    font-size: 9px;
  }
  .invite-copy .primary-button {
    min-height: 37px;
    padding: 10px 15px;
    margin-top: 10px;
    font-size: 9px;
  }
  .invite-copy .small-note {
    font-size: 7px;
    margin-top: 5px;
  }
  .invite-art {
    transform: scale(0.75);
    transform-origin: center;
    width: 255px;
    height: 250px;
    margin: 0 auto;
  }
  .invitation-footer {
    font-size: 5px;
    padding-top: 5px;
    bottom: 5px;
  }
  .birthday-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 8px 60px;
    text-align: center;
  }
  .birthday-heading h1 {
    font-size: 40px;
    margin: 8px 0;
  }
  .birthday-heading p {
    font-size: 9px;
  }
  .birthday-heading .eyebrow {
    font-size: 6px;
  }
  .birthday-portrait {
    height: min(58dvh, 230px);
    width: min(40dvh, 180px);
  }
  .age-badge {
    height: 75px;
    width: 75px;
    right: -18px;
  }
  .age-badge strong {
    font-size: 42px;
  }
  .portrait-label {
    font-size: 13px;
  }
  .section-marker {
    display: none;
  }
  .section-heading > .handwritten,
  .section-heading p {
    display: none;
  }
  .section-heading h2 {
    font-size: 34px;
  }
  .wish-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
    padding: 10px 45px;
    gap: 4px 25px;
  }
  .wish-section .section-heading {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
  }
  .cake-scene {
    grid-column: 2;
    grid-row: 1 / 3;
    transform: scale(0.65);
    height: 195px;
    width: 300px;
    margin: 0;
    justify-self: center;
    transform-origin: center top;
  }
  .wish-action {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    padding-top: 14px;
  }
  .wish-button {
    min-width: 0;
    font-size: 9px;
    min-height: 40px;
  }
  .wish-action .small-note {
    font-size: 7px;
    margin-top: 4px;
  }
  .wish-result {
    grid-column: 1;
    grid-row: 1 / 3;
  }
  .wish-result h3 {
    font-size: 33px;
  }
  .wish-result > .handwritten {
    font-size: 19px;
  }
  .memories-section {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    grid-template-rows: 1fr auto;
    padding: 0 30px;
    gap: 0;
  }
  .memories-section .section-heading {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    padding-bottom: 15px;
  }
  .memory-film {
    grid-column: 2;
    grid-row: 1 / 3;
    --photo-width: 150px;
  }
  .memory-card img {
    height: clamp(100px, 38dvh, 170px);
  }
  .memory-card {
    padding: 6px;
  }
  .memory-caption {
    margin-top: 5px;
  }
  .memory-caption > span {
    font-size: 14px;
  }
  .gallery-controls {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    padding: 0;
  }
  .gallery-controls > .handwritten,
  .gallery-hint {
    display: none;
  }
  .video-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 25px;
    padding: 8px 35px;
  }
  .video-section .section-heading {
    grid-column: 1;
    align-self: end;
  }
  .our-film-frame {
    grid-column: 2;
    grid-row: 1 / 3;
    max-height: 60dvh;
    justify-self: center;
  }
  .our-film-frame video {
    max-height: calc(60dvh - 14px);
  }
  .film-caption {
    grid-column: 1;
    font-size: 19px;
    align-self: start;
    text-align: center;
  }
  .film-note {
    display: none;
  }
  .letter-section:not(.letter-opened) {
    flex-direction: row;
    gap: 35px;
  }
  .envelope {
    width: 260px;
    height: 175px;
    margin: 0;
  }
  .envelope-address {
    top: 24px;
    font-size: 24px;
  }
  .wax-seal {
    top: 78px;
  }
  .envelope-instruction {
    bottom: 13px;
  }
  .letter-opened {
    flex-direction: row;
    gap: 30px;
  }
  .letter-opened .section-heading {
    max-width: 170px;
  }
  .letter-opened .section-heading h2 {
    font-size: 28px;
  }
  .love-letter {
    width: 410px;
    padding: 13px 25px 27px;
  }
  .love-letter h3 {
    font-size: 24px;
    margin: 6px 0;
  }
  .love-letter p {
    font-size: 10px;
    line-height: 1.6;
    margin-bottom: 8px;
  }
  .forever-section {
    gap: 5px;
  }
  .forever-heart {
    display: none;
  }
  .forever-section h2 {
    font-size: 33px;
    margin: 0;
  }
  .forever-section > p:not(.final-note) {
    display: none;
  }
  .forever-section .primary-button {
    min-height: 37px;
    padding: 8px 20px;
    margin-top: 3px;
  }
  .final-note {
    font-size: 18px;
    line-height: 1.3;
    min-height: 24px;
  }
  .scene-navigation {
    padding: 4px 40px 10px;
  }
  .scene-progress {
    margin-bottom: 7px;
  }
  .scene-next {
    min-height: 40px;
    padding: 10px 16px;
  }
  .scene-back {
    height: 36px;
    width: 36px;
  }
}
@media (max-width: 700px) and (orientation: portrait) {
  .video-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    align-content: stretch;
    justify-content: stretch;
    padding: 12px 22px;
    gap: 12px;
  }
  .video-section .section-marker {
    grid-row: 1;
  }
  .video-section .section-heading {
    grid-row: 2;
  }
  .video-section .section-heading h2 {
    font-size: clamp(28px, 5.2dvh, 42px);
    letter-spacing: -1px;
  }
  .video-section .section-heading > .handwritten,
  .video-section .film-caption {
    display: none;
  }
  .video-section .our-film-frame {
    grid-row: 3;
    justify-self: center;
    height: min(100%, 510px);
    width: auto;
    max-height: 100%;
    max-width: min(82vw, 320px);
    aspect-ratio: 490 / 862;
    padding: 5px;
    flex: none;
  }
  .video-section .our-film-frame video {
    width: 100%;
    height: 100%;
    max-height: 100%;
  }
  .video-section .film-note {
    grid-row: 4;
    line-height: 1.5;
    font-size: 9px;
    min-height: 14px;
  }
  .scene-navigation-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
  }
  .scene-back {
    width: 40px;
    height: 40px;
  }

  @container birthday-stage (max-height: 480px) {
    .invitation {
      padding: 4px 22px 32px;
      gap: 6px;
    }
    .invite-copy h1 {
      font-size: clamp(30px, 8cqh, 40px);
      margin: 8px 0;
    }
    .invite-copy .eyebrow {
      font-size: 7px;
      letter-spacing: 1.1px;
    }
    .invite-copy .primary-button {
      min-height: 43px;
      margin-top: 10px;
      padding: 12px 18px;
    }
    .intro-description {
      font-size: 9px;
    }
    .invite-copy .small-note {
      margin-top: 6px;
      font-size: 7px;
    }
    .invite-art {
      height: 160px;
      margin-top: 4px;
    }
    .invite-art .polaroid img {
      height: 90px;
    }
    .invite-art .art-note {
      font-size: 15px;
    }
    .invite-art .art-signature {
      font-size: 15px;
      bottom: -4px;
    }
    .love-stamp {
      width: 43px;
      height: 43px;
      bottom: 17px;
    }
  }
  @container birthday-stage (max-height: 430px) {
    .story-section {
      padding: 6px 20px;
      gap: 8px;
    }
    .section-marker {
      font-size: 8px;
      gap: 9px;
    }
    .section-marker span {
      font-size: 6px;
      letter-spacing: 1px;
    }
    .section-heading > .handwritten {
      display: none;
    }
    .section-heading h2 {
      font-size: clamp(26px, 8cqh, 34px);
    }
    .birthday-heading h1 {
      font-size: clamp(30px, 10cqh, 44px);
      margin: 8px 0;
    }
    .birthday-heading .eyebrow {
      font-size: 6px;
      letter-spacing: 1px;
    }
    .birthday-heading p {
      font-size: 10px;
      line-height: 1.6;
    }
    .birthday-portrait {
      height: 46cqh;
      width: auto;
      aspect-ratio: 345 / 430;
      margin: 0 auto;
      flex-shrink: 0;
    }
    .age-badge {
      width: 72px;
      height: 72px;
      right: -21px;
      bottom: 14px;
    }
    .age-badge strong {
      font-size: 41px;
    }
    .age-badge > span {
      font-size: 4px;
    }
    .portrait-label {
      font-size: 12px;
      bottom: 10px;
    }
    .portrait-heart {
      font-size: 38px;
      top: 18px;
    }
    .heading-sparkle {
      font-size: 23px;
    }
    .wish-section:not(.wish-completed) .section-heading p {
      display: none;
    }
    .cake-scene {
      flex-basis: 135px;
      height: 135px;
      transform: scale(0.48);
      transform-origin: center top;
      margin: 0 auto;
    }
    .wish-button {
      min-height: 42px;
      padding: 11px 16px;
      font-size: 10px;
    }
    .wish-action .small-note {
      margin-top: 5px;
      font-size: 7px;
    }
    .wish-result h3 {
      font-size: 30px;
      margin: 4px 0 8px;
    }
    .wish-result > .handwritten {
      font-size: 18px;
    }
    .wish-result p {
      font-size: 9px;
    }
    .memories-section {
      padding: 6px 0;
      gap: 6px;
    }
    .memories-section .section-heading h2 {
      font-size: 30px;
    }
    .memories-section .section-heading h2 br {
      display: none;
    }
    .memories-section .section-heading p {
      font-size: 9px;
      margin-top: 3px;
    }
    .memory-film {
      --photo-width: clamp(130px, 40cqh, 190px);
      padding-top: 10px;
      padding-bottom: 13px;
    }
    .memory-card img {
      height: clamp(125px, 42cqh, 205px);
    }
    .memory-caption {
      margin-top: 6px;
    }
    .memory-caption > span {
      font-size: 14px;
    }
    .gallery-hint,
    .gallery-controls > .handwritten {
      display: none;
    }
    .circle-button {
      width: 32px;
      height: 32px;
    }
    .video-section {
      padding: 6px 20px;
      gap: 8px;
    }
    .video-section .section-heading h2 {
      font-size: 28px;
    }
    .video-section .film-note {
      font-size: 8px;
    }
    .letter-opened .section-heading h2 {
      font-size: 25px;
    }
    .love-letter {
      padding: 15px 22px 29px;
    }
    .love-letter h3 {
      font-size: 24px;
      margin: 7px 0;
    }
    .love-letter p {
      font-size: 11px;
      line-height: 1.7;
      margin-bottom: 9px;
    }
    .envelope {
      height: 180px;
      margin-top: 6px;
    }
    .envelope-address {
      top: 23px;
    }
    .wax-seal {
      top: 80px;
    }
    .envelope-instruction {
      bottom: 15px;
    }
    .forever-heart {
      font-size: 44px;
    }
    .forever-section h2 {
      font-size: clamp(29px, 9cqh, 38px);
    }
    .forever-section > p:not(.final-note) {
      font-size: 9px;
    }
    .forever-section .primary-button {
      min-height: 42px;
      margin-top: 2px;
      padding: 11px 20px;
    }
    .final-note {
      font-size: 18px;
      line-height: 1.4;
      min-height: 28px;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .scene-enter,
  .scene-leave,
  .scene-enter .reveal,
  .letter-page {
    animation: none;
  }
  .love-letter {
    transition: none;
  }
}
