:root {
  color-scheme: dark;
  --night: #090817;
  --ink: #f8f1f6;
  --muted: #c8bdcb;
  --gold: #f1cf91;
  --rose: #e8a6b7;
  --line: rgba(242, 207, 145, .3);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
  --script: "Parisienne", cursive;
}

* { box-sizing: border-box; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--night); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--night); color: var(--ink); font-family: var(--sans); }
button, a { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.starfield { position: fixed; inset: 0; pointer-events: none; opacity: .6; z-index: 0; background-image: radial-gradient(1px 1px at 7% 13%, #fff 98%, transparent), radial-gradient(1px 1px at 22% 78%, #f7d6a2 98%, transparent), radial-gradient(1.5px 1.5px at 42% 18%, #fff 98%, transparent), radial-gradient(1px 1px at 67% 67%, #fff 98%, transparent), radial-gradient(1px 1px at 86% 31%, #f4c6d1 98%, transparent), radial-gradient(1px 1px at 93% 84%, #fff 98%, transparent); background-size: 420px 330px; animation: star-drift 42s linear infinite; }
.ambient { position: fixed; width: 45vw; height: 45vw; max-width: 620px; max-height: 620px; border-radius: 50%; filter: blur(100px); pointer-events: none; opacity: .18; z-index: 0; }
.ambient-one { top: -24vw; left: -12vw; background: #624278; }
.ambient-two { right: -25vw; bottom: -25vw; background: #ad596e; opacity: .12; }
main { position: relative; z-index: 1; }
.countdown-screen { min-height: 100vh; min-height: 100svh; position: relative; display: flex; flex-direction: column; padding: 25px clamp(22px, 6vw, 88px) 22px; isolation: isolate; }
.countdown-screen::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, rgba(10, 9, 28, .98) 0%, rgba(15, 12, 34, .94) 48%, rgba(27, 15, 39, .78) 100%); }
.countdown-screen::after { content: ""; position: absolute; inset: 0; z-index: -2; background: url("assets/portrait-03.webp") center 32% / cover no-repeat; filter: blur(2px); opacity: .18; }
.topbar, .birthday-topbar { height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: #f8e6c8; text-decoration: none; font-family: var(--script); font-size: 31px; line-height: 1; letter-spacing: .01em; white-space: nowrap; }
.brand-crown { color: var(--gold); font-family: var(--serif); font-size: 22px; transform: translateY(-2px); }
.topbar-note, .birthday-badge { white-space: nowrap; color: rgba(245, 224, 203, .7); font-size: 9px; letter-spacing: .28em; font-weight: 600; }
.tiny-star { color: var(--gold); margin: 0 8px; }
.countdown-layout { width: min(1180px, 100%); flex: 1; min-height: 0; margin: 0 auto; display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: clamp(32px, 7vw, 100px); padding: 35px 0 25px; }
.countdown-copy { text-align: center; position: relative; z-index: 2; }
.eyebrow { display: flex; justify-content: center; align-items: center; gap: 13px; color: var(--gold); font-size: 9px; letter-spacing: .3em; font-weight: 600; }
.eyebrow-line { display: inline-block; width: 35px; height: 1px; background: linear-gradient(90deg, transparent, rgba(241, 207, 145, .8)); }
.eyebrow-line:last-child { transform: rotate(180deg); }
.little-crown { margin: 20px 0 5px; color: var(--gold); font-size: 28px; text-shadow: 0 0 22px rgba(241, 207, 145, .45); }
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -.045em; }
h1 { font-size: clamp(40px, 5.4vw, 72px); line-height: 1.06; }
h1 em, h2 em { color: var(--gold); font-style: italic; }
.countdown-intro { max-width: 480px; margin: 20px auto 30px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.countdown-intro span { color: #f5d6d8; font-family: var(--serif); font-style: italic; font-size: 16px; }
.timer { display: flex; justify-content: center; align-items: center; gap: clamp(7px, 1.4vw, 20px); }
.time-tile { width: clamp(65px, 8vw, 96px); min-height: 98px; padding: 13px 4px 10px; border: 1px solid rgba(241, 207, 145, .35); border-radius: 8px; background: linear-gradient(145deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .018)); box-shadow: inset 0 0 20px rgba(255,255,255,.018), 0 7px 30px rgba(0,0,0,.16); backdrop-filter: blur(10px); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.time-number { font-family: var(--serif); font-size: clamp(29px, 4vw, 45px); line-height: 1; color: #fff6e9; font-variant-numeric: tabular-nums; }
.time-label { margin-top: 9px; color: #d5c1bb; font-size: 8px; letter-spacing: .19em; }
.time-separator { color: var(--gold); font-family: var(--serif); font-size: 24px; opacity: .8; transform: translateY(-7px); }
.date-rule { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 29px; color: #e8d8cc; font-size: 10px; letter-spacing: .24em; }
.date-rule span:first-child, .date-rule span:last-child { color: var(--gold); font-size: 15px; }
.timezone-note { color: #a99cac; font-size: 11px; letter-spacing: .08em; margin: 8px 0 0; }
.timezone-note strong { color: #f3d7b2; font-weight: 500; }
.countdown-footnote { margin: 29px 0 0; color: #c1b2c4; font-family: var(--serif); font-size: 14px; font-style: italic; }
.countdown-footnote span { color: var(--gold); padding-left: 4px; }
.countdown-art { position: relative; width: min(100%, 470px); aspect-ratio: .82; margin: 0 auto; display: grid; place-items: center; }
.portrait-glow { position: absolute; inset: 12% 7%; border-radius: 48% 48% 42% 42%; background: radial-gradient(ellipse, rgba(238, 179, 164, .35), rgba(181, 110, 126, .09) 48%, transparent 72%); filter: blur(32px); }
.portrait-frame { position: relative; z-index: 1; height: 88%; width: 76%; padding: 10px 10px 49px; border: 1px solid rgba(246, 214, 176, .65); border-radius: 230px 230px 13px 13px; background: linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.035)); box-shadow: 0 24px 90px rgba(0,0,0,.5), 0 0 65px rgba(231, 172, 180, .12); transform: rotate(1deg); }
.portrait-frame::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(246, 214, 176, .25); border-radius: 224px 224px 9px 9px; pointer-events: none; z-index: 2; }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 23%; border-radius: 220px 220px 6px 6px; display: block; filter: saturate(.9); }
.portrait-caption { white-space: nowrap; position: absolute; bottom: 13px; left: 12px; right: 12px; display: flex; justify-content: center; gap: 12px; align-items: center; color: #f0d6c8; font-family: var(--script); font-size: 21px; }
.caption-sparkle { color: var(--gold); font-size: 13px; }
.floating-star { position: absolute; z-index: 2; color: var(--gold); text-shadow: 0 0 15px rgba(241,207,145,.7); animation: float 5s ease-in-out infinite; }
.star-a { top: 10%; left: 9%; font-size: 29px; }
.star-b { top: 25%; right: 4%; font-size: 18px; animation-delay: -1.6s; }
.star-c { bottom: 15%; left: 4%; font-size: 22px; animation-delay: -3s; }
.orbit { position: absolute; width: 100%; height: 65%; border: 1px solid rgba(241,207,145,.14); border-radius: 50%; transform: rotate(-21deg); }
.orbit-two { width: 108%; height: 54%; transform: rotate(24deg); border-color: rgba(232,166,183,.12); }
.countdown-footer, .birthday-footer { display: flex; flex-wrap: wrap; text-align: center; row-gap: 6px; align-items: center; justify-content: center; gap: 17px; color: rgba(219, 199, 201, .55); font-size: 8px; letter-spacing: .25em; }
.footer-heart { color: var(--rose); font-size: 15px; }

/* Birthday slideshow state */
.birthday-screen { min-height: 100vh; min-height: 100svh; position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; padding: 20px clamp(18px, 5vw, 74px) 18px; background: #0a0918; }
.slideshow-backdrop, .birthday-vignette { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.slideshow-backdrop img { width: 100%; height: 100%; object-fit: cover; filter: blur(25px) brightness(.32) saturate(.8); transform: scale(1.12); opacity: .64; transition: opacity 1s ease; }
.birthday-vignette { z-index: -1; background: radial-gradient(ellipse at 50% 47%, rgba(12, 9, 23, .1), rgba(8, 7, 19, .78) 78%), linear-gradient(180deg, rgba(8,7,19,.48), transparent 22%, transparent 78%, rgba(8,7,19,.5)); }
.birthday-topbar { flex: 0 0 auto; }
.birthday-badge { padding: 10px 14px; border: 1px solid rgba(241,207,145,.25); border-radius: 30px; background: rgba(255,255,255,.035); backdrop-filter: blur(12px); }
.badge-spark { color: var(--gold); padding: 0 6px; }
.birthday-content { position: relative; width: min(100%, 1120px); flex: 1; min-height: 0; margin: 0 auto; display: grid; grid-template-columns: .9fr 1.1fr; grid-template-rows: auto 1fr auto; column-gap: clamp(26px, 7vw, 100px); align-items: center; padding: 18px 0 10px; }
.birthday-heading { align-self: end; grid-column: 1; grid-row: 1 / 3; position: relative; z-index: 3; padding-bottom: 30px; }
.birthday-eyebrow { color: var(--gold); font-size: 9px; letter-spacing: .34em; margin: 0 0 18px; }
h2 { font-size: clamp(40px, 5.4vw, 77px); line-height: 1.04; }
.title-heart { color: var(--rose); font-family: var(--sans); font-size: .55em; padding-left: 8px; vertical-align: 14%; }
.birthday-subtitle { max-width: 380px; color: #d8cbd4; font-family: var(--serif); font-size: clamp(14px, 1.5vw, 18px); line-height: 1.7; margin: 23px 0 0; }
.slideshow-stage { grid-column: 2; grid-row: 1 / 3; justify-self: center; align-self: center; position: relative; width: min(100%, 510px); height: min(64vh, 640px); min-height: 340px; display: grid; place-items: center; }
.photo-halo { position: absolute; width: 90%; height: 88%; background: radial-gradient(ellipse, rgba(238,188,174,.22), rgba(186,123,142,.11) 50%, transparent 72%); filter: blur(35px); }
.photo-card { position: relative; z-index: 2; width: auto; height: 100%; max-width: 86%; margin: 0; padding: 10px 10px 45px; border: 1px solid rgba(245,214,175,.68); border-radius: 5px; background: linear-gradient(145deg, rgba(255,250,242,.98), rgba(235,220,212,.94)); box-shadow: 0 26px 80px rgba(0,0,0,.45), 0 0 75px rgba(238,188,174,.12); transform: rotate(-1.4deg); transition: opacity .55s ease, transform .75s cubic-bezier(.2,.75,.25,1); }
.photo-card.is-changing { opacity: 0; transform: translateY(16px) rotate(1deg) scale(.985); }
.photo-card img { display: block; height: 100%; max-width: 100%; width: auto; aspect-ratio: auto; object-fit: contain; background: #261a2d; }
.photo-tag { position: absolute; bottom: 13px; left: 0; right: 0; display: flex; justify-content: center; gap: 9px; color: #826c6c; font-size: 7px; letter-spacing: .2em; }
.photo-tag span { color: #b18b56; font-size: 11px; }
.photo-spark { position: absolute; z-index: 3; color: var(--gold); text-shadow: 0 0 18px rgba(241,207,145,.7); animation: float 4.6s ease-in-out infinite; }
.spark-one { top: 9%; right: 5%; font-size: 21px; }
.spark-two { bottom: 17%; left: 3%; font-size: 28px; animation-delay: -1s; }
.spark-three { top: 25%; left: 0; font-size: 14px; animation-delay: -2.5s; }
.slideshow-controls { grid-column: 2; grid-row: 3; align-self: start; justify-self: center; display: flex; align-items: center; justify-content: center; gap: 17px; margin-top: 6px; }
.nav-button, .pause-button { display: grid; place-items: center; border: 1px solid rgba(241,207,145,.45); background: rgba(10,8,24,.36); backdrop-filter: blur(8px); color: #f7e4c7; cursor: pointer; transition: background .2s ease, transform .2s ease; }
.nav-button { width: 36px; height: 36px; border-radius: 50%; font-family: var(--serif); font-size: 25px; line-height: 1; }
.pause-button { width: 32px; height: 32px; border-radius: 50%; font-size: 12px; margin-left: 4px; }
.nav-button:hover, .pause-button:hover { background: rgba(241,207,145,.18); transform: translateY(-2px); }
.nav-button:focus-visible, .pause-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.slide-indicators { display: flex; align-items: center; gap: 8px; }
.slide-dot { position: relative; flex: 0 0 auto; width: 6px; height: 6px; border: 0; border-radius: 50%; background: rgba(247,228,199,.42); padding: 0; cursor: pointer; transition: width .25s ease, background .25s ease; }
.slide-dot::before { content: ""; position: absolute; inset: -11px -5px; } /* larger tap target */
.slide-dot.active { width: 21px; border-radius: 10px; background: var(--gold); }
.birthday-wish { grid-column: 1; grid-row: 3; align-self: start; max-width: 430px; margin: 0; color: #d5c3d0; font-family: var(--script); font-size: clamp(20px, 2.2vw, 27px); line-height: 1.28; }
.birthday-footer { flex: 0 0 auto; margin-top: 9px; }
.noscript-message { position: fixed; inset: auto 12px 12px; padding: 12px 16px; border-radius: 8px; background: #3d2038; color: white; text-align: center; z-index: 10; }

@keyframes float { 0%,100% { transform: translateY(0) rotate(0); opacity: .8; } 50% { transform: translateY(-12px) rotate(8deg); opacity: 1; } }
@keyframes star-drift { from { background-position: 0 0; } to { background-position: 420px 330px; } }

@media (max-width: 800px) {
  .countdown-screen { padding: 17px 20px 18px; }
  .topbar-note { display: none; }
  .countdown-layout { grid-template-columns: 1fr; gap: 6px; padding: 42px 0 30px; }
  .countdown-copy { order: 1; }
  .countdown-art { order: 2; width: min(74vw, 330px); margin-top: 20px; }
  .little-crown { margin-top: 15px; }
  .countdown-intro { max-width: 430px; margin-top: 15px; margin-bottom: 23px; font-size: 13px; }
  .time-tile { width: clamp(61px, 17vw, 85px); min-height: 82px; }
  .time-number { font-size: clamp(27px, 7vw, 37px); }
  .time-label { font-size: 8px; }
  .countdown-footnote { margin-top: 20px; }
  .countdown-art { aspect-ratio: .88; }
  .portrait-frame { height: 90%; width: 70%; }
  .countdown-footer { font-size: 8px; gap: 9px; }
  .portrait-caption { font-size: clamp(15px, 4.6vw, 21px); gap: 8px; }
  .birthday-screen { padding: 15px 18px; }
  .birthday-content { grid-template-columns: 1fr; grid-template-rows: auto minmax(260px, 1fr) auto auto; gap: 8px; padding: 25px 0 14px; }
  .birthday-heading { grid-column: 1; grid-row: 1; text-align: center; align-self: center; padding: 0; }
  .birthday-eyebrow { margin-bottom: 8px; }
  h2 { font-size: clamp(37px, 9vw, 60px); }
  .birthday-subtitle { max-width: 460px; margin: 10px auto 0; font-size: 14px; }
  .slideshow-stage { grid-column: 1; grid-row: 2; width: min(100%, 400px); height: min(49vh, 440px); min-height: 250px; margin-top: 7px; }
  .photo-card { max-width: min(84%, 340px); padding: 7px 7px 36px; }
  .photo-tag { bottom: 10px; font-size: 6px; }
  .slideshow-controls { grid-column: 1; grid-row: 3; margin-top: 3px; }
  .birthday-wish { grid-column: 1; grid-row: 4; align-self: center; text-align: center; margin: 7px auto 0; max-width: 480px; font-size: 23px; }
  .birthday-footer { margin-top: 5px; font-size: 7px; }
}

@media (max-width: 420px) {
  .countdown-screen { padding-left: 16px; padding-right: 16px; }
  .brand { font-size: 27px; }
  .countdown-layout { padding-top: 34px; }
  h1 { font-size: clamp(34px, 11vw, 43px); }
  .eyebrow { gap: 9px; letter-spacing: .22em; }
  .eyebrow-line { width: 22px; }
  .timer { gap: 4px; width: 100%; }
  .time-tile { flex: 1 1 0; min-width: 0; max-width: 72px; width: auto; min-height: 74px; padding-left: 2px; padding-right: 2px; }
  .time-label { letter-spacing: .1em; font-size: 7.5px; }
  .time-separator { font-size: 18px; }
  .date-rule { font-size: 8px; gap: 9px; }
  .countdown-footer { flex-direction: column; gap: 5px; }
  .countdown-footer .footer-heart { order: -1; }
  .birthday-badge { font-size: 7px; letter-spacing: .18em; padding: 8px 9px; }
  .birthday-content { padding-top: 18px; }
  .slideshow-stage { height: min(46vh, 390px); }
  .birthday-wish { font-size: 21px; }
  .birthday-footer { letter-spacing: .15em; gap: 9px; }
}

@media (max-width: 330px) {
  .brand { font-size: 24px; }
  .eyebrow-line { display: none; }
  .countdown-intro { font-size: 12.5px; }
  .time-number { font-size: 24px; }
  .time-label { font-size: 7px; letter-spacing: .06em; }
}

@media (max-height: 720px) and (min-width: 801px) {
  .countdown-screen { padding-top: 15px; padding-bottom: 14px; }
  .countdown-layout { padding-top: 14px; padding-bottom: 12px; gap: 36px; }
  .countdown-art { width: min(100%, 360px); }
  .little-crown { margin-top: 10px; }
  .countdown-intro { margin-top: 12px; margin-bottom: 19px; }
  .time-tile { min-height: 82px; }
  .countdown-footnote { margin-top: 17px; }
  .birthday-content { padding-top: 5px; }
  .slideshow-stage { height: min(59vh, 500px); min-height: 280px; }
  .birthday-heading { padding-bottom: 15px; }
}

/* Phones in landscape: keep text and portrait side by side instead of one long column */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 560px) {
  .countdown-screen { padding: max(10px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 10px max(24px, env(safe-area-inset-left)); }
  .topbar { height: 38px; }
  .brand { font-size: 25px; }
  .topbar-note { display: inline; font-size: 8px; }
  .countdown-layout { grid-template-columns: 1.25fr .75fr; gap: clamp(16px, 4vw, 48px); padding: 6px 0; }
  .countdown-copy { order: 0; }
  .countdown-art { order: 0; width: min(100%, 250px, 62vh); margin-top: 0; aspect-ratio: .82; }
  .little-crown { display: none; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: clamp(26px, min(4.4vw, 9vh), 44px); margin-top: 8px; }
  .countdown-intro { margin: 8px auto 12px; font-size: 12px; line-height: 1.55; }
  .timer { gap: 6px; }
  .time-tile { width: clamp(54px, 8vw, 72px); min-height: 60px; padding: 8px 2px 7px; }
  .time-number { font-size: clamp(22px, 3.4vw, 30px); }
  .time-label { margin-top: 6px; font-size: 7px; }
  .time-separator { font-size: 16px; }
  .date-rule { margin-top: 12px; font-size: 8px; }
  .timezone-note { font-size: 10px; margin-top: 4px; }
  .countdown-footnote { margin-top: 8px; font-size: 12px; }
  .portrait-frame { height: 90%; width: 78%; padding: 7px 7px 34px; }
  .portrait-caption { font-size: 15px; bottom: 9px; }
  .floating-star { font-size: 16px; }
  .countdown-footer { font-size: 7px; }
}

/* Large and ultra-wide displays: scale the countdown up so it fills the screen nicely */
@media (min-width: 1800px) and (min-height: 950px) {
  .countdown-screen { padding: 40px clamp(60px, 5vw, 140px) 34px; }
  .topbar { height: 64px; }
  .brand { font-size: 44px; }
  .brand-crown { font-size: 30px; }
  .topbar-note { font-size: 12px; }
  .countdown-layout { width: min(1680px, 100%); }
  .eyebrow { font-size: 13px; }
  .eyebrow-line { width: 56px; }
  .little-crown { font-size: 40px; margin-top: 28px; }
  h1 { font-size: clamp(72px, 4.6vw, 112px); }
  .countdown-intro { max-width: 680px; font-size: 19px; margin: 30px auto 42px; }
  .countdown-intro span { font-size: 22px; }
  .timer { gap: 26px; }
  .time-tile { width: 132px; min-height: 136px; border-radius: 12px; }
  .time-number { font-size: 62px; }
  .time-label { font-size: 11px; margin-top: 12px; }
  .time-separator { font-size: 34px; }
  .date-rule { font-size: 14px; margin-top: 40px; }
  .date-rule span:first-child, .date-rule span:last-child { font-size: 20px; }
  .timezone-note { font-size: 15px; margin-top: 12px; }
  .countdown-footnote { font-size: 20px; margin-top: 38px; }
  .countdown-art { width: min(100%, 660px); }
  .portrait-frame { padding: 14px 14px 66px; border-radius: 330px 330px 18px 18px; }
  .portrait-frame::before { border-radius: 322px 322px 13px 13px; }
  .portrait-frame img { border-radius: 316px 316px 8px 8px; }
  .portrait-caption { font-size: 30px; bottom: 16px; }
  .floating-star { font-size: 36px; }
  .countdown-footer { font-size: 11px; }
  .footer-heart { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Full-screen birthday photo mode: every portrait becomes the entire viewport. */
body.birthday-mode { height: 100%; min-height: 100vh; min-height: 100svh; overflow: hidden; }
body.birthday-mode .starfield,
body.birthday-mode .ambient { display: none; }
body.birthday-mode main { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; z-index: 10; }
body.birthday-mode .birthday-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  overflow: hidden;
  padding: 0;
  background: #080713;
  isolation: isolate;
}
body.birthday-mode .slideshow-backdrop { display: none; }
body.birthday-mode .birthday-vignette {
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 5, 18, .34) 0%, rgba(6, 5, 18, .03) 24%, rgba(6, 5, 18, .02) 55%, rgba(6, 5, 18, .72) 100%),
    linear-gradient(90deg, rgba(6, 5, 18, .12), transparent 55%, rgba(6, 5, 18, .08));
}
body.birthday-mode .birthday-topbar {
  position: absolute;
  z-index: 6;
  top: max(15px, env(safe-area-inset-top));
  left: clamp(16px, 3.5vw, 54px);
  right: clamp(16px, 3.5vw, 54px);
  height: 48px;
  pointer-events: none;
}
body.birthday-mode .birthday-topbar a,
body.birthday-mode .birthday-badge,
body.birthday-mode .music-toggle { pointer-events: auto; }
body.birthday-mode .brand { font-size: clamp(25px, 2.4vw, 34px); text-shadow: 0 2px 18px rgba(0,0,0,.5); }
.music-toggle {
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(255, 230, 194, .38);
  border-radius: 999px;
  background: rgba(12, 8, 23, .34);
  color: #fff4e5;
  box-shadow: 0 4px 24px rgba(0,0,0,.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.music-toggle:hover { background: rgba(241, 207, 145, .16); border-color: rgba(255, 230, 194, .68); }
.music-toggle:active { transform: scale(.96); }
.music-toggle:focus-visible { outline: 2px solid #ffe0ac; outline-offset: 3px; }
.music-toggle.is-playing { background: rgba(241, 207, 145, .18); border-color: rgba(255, 224, 172, .72); }
.music-toggle-icon { display: inline-block; min-width: 14px; color: #ffe0ac; font-size: 17px; line-height: 1; }
.music-toggle-label { color: rgba(255, 245, 232, .94); font-size: 8px; font-weight: 600; letter-spacing: .13em; white-space: nowrap; }
body.birthday-mode .birthday-badge {
  padding: 9px 13px;
  background: rgba(12, 8, 23, .30);
  border-color: rgba(255, 230, 194, .38);
  color: rgba(255, 245, 230, .9);
  box-shadow: 0 4px 24px rgba(0,0,0,.14);
}
body.birthday-mode .birthday-content {
  /* One bottom-anchored column so heading, wish and controls can never overlap. */
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(max(15px, env(safe-area-inset-top)) + 60px) max(16px, env(safe-area-inset-right)) max(17px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
body.birthday-mode .slideshow-stage {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  display: block;
}
body.birthday-mode .photo-halo,
body.birthday-mode .photo-spark { display: none; }
body.birthday-mode .photo-card {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  overflow: hidden;
  transition: opacity .55s ease;
}
body.birthday-mode .photo-card.is-changing { opacity: 0; transform: none; }
body.birthday-mode .photo-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center 16%;
  background: #080713;
  filter: saturate(.98) brightness(.96);
}
body.birthday-mode .photo-tag,
body.birthday-mode .birthday-footer { display: none; }
body.birthday-mode .birthday-heading {
  position: relative;
  z-index: 4;
  order: 1;
  width: min(100%, 780px);
  padding: 0;
  margin: auto 0 0;
  text-align: center;
  align-self: auto;
  text-shadow: 0 3px 24px rgba(0,0,0,.62);
}
body.birthday-mode .birthday-eyebrow {
  margin: 0 0 10px;
  color: #ffe0ac;
  font-size: 10px;
  letter-spacing: .36em;
  text-shadow: 0 2px 14px rgba(0,0,0,.7);
}
body.birthday-mode h2 {
  font-size: clamp(34px, min(5.7vw, 9vh), 76px);
  line-height: .99;
  letter-spacing: -.04em;
  color: #fff8f0;
  text-shadow: 0 4px 28px rgba(0,0,0,.65), 0 0 34px rgba(10,7,20,.28);
}
body.birthday-mode h2 em { color: #ffe0b2; }
body.birthday-mode .title-heart { color: #ffd3d9; }
body.birthday-mode .birthday-subtitle {
  max-width: 560px;
  margin: 12px auto 0;
  color: rgba(255,245,235,.94);
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.45;
  text-shadow: 0 2px 14px rgba(0,0,0,.75);
}
body.birthday-mode .birthday-wish {
  position: relative;
  z-index: 4;
  order: 2;
  align-self: center;
  width: min(100%, 760px);
  max-width: none;
  min-height: 2.4em; /* reserve two lines so the heading barely moves between slides */
  margin: clamp(10px, 2vh, 18px) 0 0;
  color: rgba(255,239,229,.96);
  text-align: center;
  font-family: var(--script);
  font-size: clamp(19px, 2.3vw, 29px);
  line-height: 1.2;
  text-shadow: 0 2px 18px rgba(0,0,0,.85);
}
body.birthday-mode .slideshow-controls {
  position: relative;
  z-index: 7;
  order: 3;
  align-self: center;
  justify-self: auto;
  width: min(100%, 340px);
  margin: clamp(12px, 3vh, 26px) 0 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  pointer-events: auto;
}
body.birthday-mode .nav-button,
body.birthday-mode .pause-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-color: rgba(255, 235, 209, .60);
  background: rgba(8, 6, 20, .35);
  color: #fff6e8;
  box-shadow: 0 3px 18px rgba(0,0,0,.2);
  backdrop-filter: blur(10px);
}
body.birthday-mode .pause-button { margin-left: 2px; }
body.birthday-mode .slide-indicators { gap: 9px; }
body.birthday-mode .slide-dot { width: 7px; height: 7px; background: rgba(255,245,231,.65); }
body.birthday-mode .slide-dot.active { width: 23px; background: #ffe0ac; }

@media (max-width: 700px) {
  body.birthday-mode .birthday-topbar { top: max(10px, env(safe-area-inset-top)); left: 14px; right: 14px; height: 42px; gap: 10px; }
  body.birthday-mode .brand { font-size: 25px; }
  body.birthday-mode .birthday-badge { padding: 7px 9px; font-size: 8px; letter-spacing: .14em; }
  body.birthday-mode .music-toggle { min-width: 38px; min-height: 38px; width: 38px; padding: 0; }
  body.birthday-mode .music-toggle-label { display: none; }
  body.birthday-mode .music-toggle-icon { font-size: 16px; }
  body.birthday-mode .birthday-content { padding: calc(max(10px, env(safe-area-inset-top)) + 54px) 15px max(12px, env(safe-area-inset-bottom)); }
  body.birthday-mode .birthday-eyebrow { font-size: 9px; letter-spacing: .25em; margin-bottom: 8px; }
  body.birthday-mode h2 { font-size: clamp(32px, min(10vw, 7vh), 56px); }
  body.birthday-mode .birthday-subtitle { max-width: 330px; margin-top: 9px; font-size: 13px; }
  body.birthday-mode .birthday-wish { min-height: 3.6em; font-size: clamp(18px, 5.4vw, 21px); }
  body.birthday-mode .slideshow-controls { gap: 12px; }
  body.birthday-mode .nav-button,
  body.birthday-mode .pause-button { width: 40px; height: 40px; }
}

@media (max-width: 360px) {
  body.birthday-mode .brand { font-size: 22px; gap: 6px; }
  body.birthday-mode .birthday-badge { padding-inline: 8px; }
  body.birthday-mode .music-toggle { min-width: 35px; min-height: 35px; width: 35px; }
  body.birthday-mode .birthday-badge .badge-spark { display: none; }
  body.birthday-mode .birthday-wish { min-height: 4.8em; }
  body.birthday-mode .slideshow-controls { gap: 9px; }
  body.birthday-mode .slide-indicators { gap: 7px; }
}

/* Phones held sideways and other very short windows */
@media (max-height: 560px) and (orientation: landscape) {
  body.birthday-mode .birthday-topbar { top: max(8px, env(safe-area-inset-top)); height: 38px; }
  body.birthday-mode .brand { font-size: 23px; }
  body.birthday-mode .birthday-content { padding-top: calc(max(8px, env(safe-area-inset-top)) + 44px); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  body.birthday-mode h2 { font-size: clamp(26px, 9vh, 50px); }
  body.birthday-mode .birthday-eyebrow { margin-bottom: 4px; }
  body.birthday-mode .birthday-subtitle { margin-top: 5px; font-size: 12px; max-width: 560px; }
  body.birthday-mode .birthday-wish { min-height: 2.4em; margin-top: 8px; font-size: clamp(16px, 4.2vh, 21px); width: min(100%, 700px); }
  body.birthday-mode .slideshow-controls { margin-top: 10px; }
  body.birthday-mode .nav-button,
  body.birthday-mode .pause-button { width: 36px; height: 36px; }
}
@media (max-height: 380px) and (orientation: landscape) {
  body.birthday-mode .birthday-subtitle { display: none; }
}

/* Large and ultra-wide displays: scale the overlay up so it isn't lost on big screens */
@media (min-width: 1800px) and (min-height: 950px) {
  body.birthday-mode .birthday-topbar { height: 64px; }
  body.birthday-mode .brand { font-size: 44px; }
  body.birthday-mode .brand-crown { font-size: 30px; }
  body.birthday-mode .birthday-badge { font-size: 12px; padding: 13px 20px; }
  body.birthday-mode .birthday-content { padding-bottom: 36px; }
  body.birthday-mode .birthday-heading { width: min(100%, 1100px); }
  body.birthday-mode .birthday-eyebrow { font-size: 13px; margin-bottom: 16px; }
  body.birthday-mode h2 { font-size: clamp(76px, min(4.6vw, 9vh), 120px); }
  body.birthday-mode .birthday-subtitle { max-width: 780px; font-size: clamp(18px, 1.15vw, 26px); }
  body.birthday-mode .birthday-wish { width: min(100%, 1060px); font-size: clamp(29px, 1.7vw, 42px); }
  body.birthday-mode .nav-button,
  body.birthday-mode .pause-button { width: 52px; height: 52px; }
  body.birthday-mode .nav-button { font-size: 32px; }
  body.birthday-mode .pause-button { font-size: 15px; }
  body.birthday-mode .slide-dot { width: 9px; height: 9px; }
  body.birthday-mode .slide-dot.active { width: 30px; }
}
