:root {
  color-scheme: dark;
  --night: #050307;
  --ink: #d8bdc8;
  --quiet: #846d79;
  --rose: #d7839b;
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@font-face { font-family: "Gift Serif"; src: url("./gift-serif.woff2") format("woff2"); font-style: normal; font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Gift Serif"; src: url("./gift-serif-italic.woff2") format("woff2"); font-style: italic; font-weight: 300 700; font-display: swap; }

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--night); }
body { overflow: hidden; overscroll-behavior: none; }
button { font: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; }
button:focus-visible { outline: 1px solid #e9a9bc; outline-offset: 5px; }
button:disabled { opacity: .25; cursor: default; }

.experience {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--night);
}

/* The invitation keeps the rose's measured layout in place while it waits. */
.is-awaiting-gift > #rose-canvas,
.is-awaiting-gift > .masthead,
.is-awaiting-gift > .bottom-composition,
.is-awaiting-gift > #scene-notice { visibility: hidden; pointer-events: none; }
.gift-intro {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(64px + var(--safe-area-inset-top)) calc(24px + var(--safe-area-inset-right)) calc(52px + var(--safe-area-inset-bottom)) calc(24px + var(--safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 47%, #34203250 0%, #160d1b47 37%, #050307 76%);
  text-align: center;
  user-select: none;
}
.gift-intro[hidden] { display: none; }
.gift-intro::before { content: ""; position: absolute; inset: 15% -35% 10%; background: radial-gradient(ellipse at 50% 50%, #9f6b9b0b, transparent 65%); transform: rotate(-25deg); pointer-events: none; }
.gift-wordmark { position: absolute; top: calc(26px + var(--safe-area-inset-top)); left: 50%; transform: translateX(-50%); color: #ba97a780; font: 23px/1 "Gift Serif", Georgia, serif; letter-spacing: -.8px; }
.gift-wordmark > span { color: #d28ca3; }
.gift-content { position: relative; z-index: 1; width: min(100%, 360px); }
.gift-eyebrow { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0; color: #d9b59d; font: 8px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 3px; text-transform: uppercase; }
.gift-eyebrow > span { display: block; width: 26px; height: 1px; background: linear-gradient(90deg, transparent, #c294855c); }
.gift-eyebrow > span:last-child { transform: rotate(180deg); }
.gift-title { margin: 15px -4px 10px; color: #eddae0; font: 400 clamp(34px, 9.2vw, 40px)/1.08 "Gift Serif", Georgia, "Times New Roman", serif; letter-spacing: -.7px; text-wrap: balance; }
.gift-title em { color: #dfa6be; font-weight: 400; }
.gift-description { margin: 0; color: #b59aa9; font: italic 15px/1.5 "Gift Serif", Georgia, "Times New Roman", serif; letter-spacing: .2px; }
.gift-open { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; margin: 10px 0 0; padding: 0; border: 0; background: transparent; cursor: pointer; color: inherit; border-radius: 22px; }
.gift-open:focus-visible { outline-color: #d9adbc99; outline-offset: 7px; }
.gift-open:disabled { opacity: 1; cursor: default; }
.gift-art { position: relative; display: block; width: min(250px, 68vw); aspect-ratio: 320 / 290; }
.gift-illustration { position: relative; z-index: 1; display: block; width: 100%; height: auto; overflow: visible; }
.gift-aura { position: absolute; inset: 17% -22% -8%; background: radial-gradient(ellipse at 50% 53%, #d097bc18 0%, #9e7cbd0c 39%, transparent 69%); animation: gift-breath 5s ease-in-out infinite; }
.gift-release-light { position: absolute; z-index: 2; width: 42%; aspect-ratio: 1; left: 29%; top: 33%; border-radius: 50%; opacity: 0; background: radial-gradient(circle, #fff0d8 0%, #f1bfd6a6 16%, #caa3e552 35%, transparent 70%); pointer-events: none; }
.gift-box { transform-origin: 50% 75%; animation: gift-float 4.8s ease-in-out infinite; }
.gift-lid { transform-box: fill-box; transform-origin: 50% 85%; }
.gift-shadow { transform-origin: 50% 94%; animation: gift-shadow-breath 4.8s ease-in-out infinite; }
.gift-sparkles { animation: gift-twinkle 3.6s ease-in-out infinite; }
.gift-cta { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-width: 218px; min-height: 52px; padding: 12px 24px; border: 1px solid #f2d4d457; border-radius: 40px; background: linear-gradient(115deg, #ddbaac 0%, #ebcad0 49%, #cbaecb 100%); box-shadow: inset 0 1px 0 #ffefdc99, 0 5px 30px #c583a11c; color: #35212c; font: 500 18px/1.2 "Gift Serif", Georgia, "Times New Roman", serif; letter-spacing: .15px; transition: transform .25s ease, box-shadow .25s ease; }
.gift-cta::before { content: ""; position: absolute; inset: -80% 0; width: 42%; background: linear-gradient(90deg, transparent, #fff4e734, transparent); transform: translateX(-240%) rotate(20deg); animation: gift-silk-shine 6.2s ease-in-out infinite; pointer-events: none; }
.gift-cta > span, .gift-cta > svg { position: relative; }
.gift-cta > svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: .9; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.gift-open:hover .gift-cta { box-shadow: inset 0 1px 0 #ffefdc99, 0 7px 36px #c583a12c; transform: translateY(-1px); }
.gift-open:active .gift-cta { transform: scale(.97); }
.gift-signoff { position: absolute; bottom: calc(28px + var(--safe-area-inset-bottom)); left: 20px; right: 20px; margin: 0; color: #8b707f; font: 10px/1.5 "Gift Serif", Georgia, serif; letter-spacing: .6px; }
.gift-stars { position: absolute; inset: 0; pointer-events: none; }
.gift-stars i { position: absolute; width: 2px; height: 2px; background: #d9b4d9; border-radius: 50%; opacity: .35; box-shadow: 0 0 7px #c49ac44d; animation: gift-drift 7s ease-in-out infinite; }
.gift-stars i:nth-child(1) { left: 16%; top: 24%; animation-delay: -1s; }
.gift-stars i:nth-child(2) { left: 82%; top: 19%; width: 1px; height: 1px; animation-delay: -4s; }
.gift-stars i:nth-child(3) { left: 89%; top: 54%; animation-delay: -2s; }
.gift-stars i:nth-child(4) { left: 12%; top: 62%; width: 1px; height: 1px; animation-delay: -5s; }
.gift-stars i:nth-child(5) { left: 74%; top: 77%; background: #dfc3a1; animation-delay: -3s; }
.gift-stars i:nth-child(6) { left: 28%; top: 84%; width: 1px; height: 1px; animation-delay: -6s; }
.gift-stars i:nth-child(7) { left: 53%; top: 14%; width: 1px; height: 1px; animation-delay: -2.5s; }
.gift-stars i:nth-child(8) { left: 30%; top: 43%; width: 1px; height: 1px; animation-delay: -.5s; }
.gift-intro.is-opening { pointer-events: none; animation: gift-scene-away 1.6s ease-in forwards; }
.is-opening .gift-box { animation: none; }
.is-opening .gift-lid { animation: gift-lid-open 1.35s cubic-bezier(.2,.65,.2,1) forwards; }
.is-opening .gift-base { animation: gift-base-away 1.4s ease-in forwards; }
.is-opening .gift-release-light { animation: gift-light-release 1.5s ease-out forwards; }
.is-opening .gift-eyebrow, .is-opening .gift-title, .is-opening .gift-description, .is-opening .gift-wordmark, .is-opening .gift-signoff { animation: gift-copy-away .6s ease-in .15s forwards; }
.is-opening .gift-cta { animation: gift-copy-away .45s ease-in forwards; }
.is-revealed .gift-intro { opacity: 0; pointer-events: none; }
@keyframes gift-float { 0%,100% { transform: translateY(1px) rotate(-.5deg); } 50% { transform: translateY(-6px) rotate(.6deg); } }
@keyframes gift-shadow-breath { 0%,100% { transform: scaleX(1); opacity: .65; } 50% { transform: scaleX(.85); opacity: .38; } }
@keyframes gift-breath { 0%,100% { opacity: .65; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes gift-twinkle { 0%,100% { opacity: .35; } 50% { opacity: .85; } }
@keyframes gift-drift { 0%,100% { transform: translateY(3px); opacity: .2; } 50% { transform: translateY(-7px); opacity: .65; } }
@keyframes gift-silk-shine { 0%,62% { transform: translateX(-240%) rotate(20deg); } 100% { transform: translateX(360%) rotate(20deg); } }
@keyframes gift-lid-open { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 23% { transform: translate(0,-8px) rotate(-3deg); opacity: 1; } 75% { transform: translate(5px,-70px) rotate(-12deg); opacity: .8; } 100% { transform: translate(9px,-92px) rotate(-16deg); opacity: 0; } }
@keyframes gift-light-release { 0% { opacity: 0; transform: scale(.4); } 28% { opacity: .7; } 65% { opacity: .85; transform: scale(3); } 100% { opacity: 0; transform: scale(5.5); } }
@keyframes gift-base-away { 0%,45% { opacity: 1; } 100% { opacity: 0; transform: translateY(8px); } }
@keyframes gift-copy-away { to { opacity: 0; transform: translateY(-5px); } }
@keyframes gift-scene-away { 0%,68% { opacity: 1; } 100% { opacity: 0; } }

#rose-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: pan-y pinch-zoom; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#rose-canvas:focus { outline: none; }
#rose-canvas:focus-visible { outline: 1px solid #b8879d55; outline-offset: -12px; border-radius: inherit; }
#scene-notice { position: absolute; z-index: 2; top: 42%; left: 50%; transform: translate(-50%, -50%); width: min(260px, calc(100% - 64px)); margin: 0; padding: 14px 18px; border: 1px solid #bd82931c; border-radius: 16px; background: #100a11d9; color: #b993a4; text-align: center; font: italic 12px/1.6 Georgia, "Times New Roman", serif; pointer-events: none; }
#scene-notice[hidden] { display: none; }

.masthead {
  position: absolute;
  top: calc(25px + var(--safe-area-inset-top));
  left: calc(26px + var(--safe-area-inset-left));
  right: calc(26px + var(--safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  user-select: none;
}
.signature { display: flex; align-items: center; gap: 7px; color: #c9a7b5; opacity: .83; }
.signature > span { font: 22px/1 Georgia, "Times New Roman", serif; letter-spacing: -.85px; }
.signature-dot { color: #d17b96; }
.signature-mark { width: 21px; height: 28px; stroke: #c98aa0; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.edition { max-width: 56%; text-align: right; font-size: 7px; line-height: 1.6; font-weight: 400; letter-spacing: .3px; color: #69555f; }

.bottom-composition {
  position: absolute;
  bottom: calc(26px + var(--safe-area-inset-bottom));
  left: calc(20px + var(--safe-area-inset-left));
  right: calc(20px + var(--safe-area-inset-right));
  width: auto;
  max-width: 430px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.growth { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 100%; pointer-events: none; }
.growth-track { width: 72px; height: 1px; overflow: hidden; background: #40233160; box-shadow: 0 0 9px #c66f9209; }
#growth-fill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #8d4863, #d596aa); transform: scaleX(0); transform-origin: left; box-shadow: 0 0 5px #c98fa3; }
#growth-label { color: #ad8596; text-align: center; max-width: 100%; min-height: 16px; font: italic 11px/1.4 Georgia, "Times New Roman", serif; letter-spacing: .25px; }
.is-bloomed #growth-label { color: #cfa2b4; }

.code-fragment { position: relative; margin: 10px 0 11px; width: 232px; max-width: 100%; height: 48px; color: #ae8c9a; pointer-events: none; user-select: none; opacity: .42; }
.code-window { width: 100%; height: 48px; overflow: hidden; mask-image: linear-gradient(transparent 0%, #000 15%, #000 85%, transparent 100%); -webkit-mask-image: linear-gradient(transparent 0%, #000 15%, #000 85%, transparent 100%); }
#code-lines { margin: 0; width: 100%; white-space: pre; font: 7px/9.5px Consolas, "Courier New", monospace; letter-spacing: .08px; transform: translateY(0); }
.code-row { display: flex; width: 100%; height: 9.5px; align-items: center; }
.code-number { flex: 0 0 25px; padding-right: 8px; text-align: right; color: #775362; font-size: 6px; }
.code-text { overflow: hidden; white-space: pre; }
.code-keyword { color: #d198b3; }
.code-function { color: #a2b6bb; }
.code-string { color: #b2b68d; }
.code-comment { color: #7e6a76; }
.code-cursor { display: inline-block; flex: 0 0 3px; width: 3px; height: 6px; margin-left: 1px; background: #ce87a2; }
.dedication { margin: 0 0 11px; color: #7f6572; text-align: center; font: 8px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .65px; }

.controls { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 326px; }
.controls button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; border: 0; border-radius: 32px; color: #997b89; background: transparent; cursor: pointer; white-space: nowrap; transition: color .2s ease, background .2s ease, transform .2s ease; }
.controls button:hover { background: rgba(196, 126, 156, .07); color: #eed4df; }
.controls button:active { transform: scale(.95); }
.controls svg { flex: 0 0 13px; width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.replay { flex: 1 1 auto; min-width: 0; padding: 0 5px; font-size: 9px; font-weight: 400; letter-spacing: .1px; }
.scene-button { flex: 1.35 0 auto; padding: 0 10px; font: 11px/1.2 Georgia, "Times New Roman", serif; letter-spacing: .1px; }
.controls .scene-button { color: #d7adbf; border: 1px solid #bd7d9738; background: linear-gradient(145deg, #4b263a59, #301a2c73); box-shadow: inset 0 1px 0 #e2aac00b, 0 3px 18px #190a151c; }
.controls .scene-button:hover { color: #ecd0dc; border-color: #c68aa34d; background: #4a293c6e; }
.scene-sparkle { flex: 0 0 12px; color: #dca1bb; font-size: 12px; line-height: 1; }
#next-scene[hidden] { display: none; }
.experience[data-scene="rose"].is-bloomed #next-scene { animation: swipe-invitation 2.6s ease-in-out infinite; }
@keyframes swipe-invitation {
  0%, 100% { opacity: .78; border-color: #bd7d9738; box-shadow: 0 0 0 0 #c77a9b00; }
  50% { opacity: 1; border-color: #e2a2bd88; box-shadow: 0 0 18px 2px #c77a9b22; }
}
#music-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 112px; max-width: 100%; min-height: 44px; margin-top: 2px; padding: 0 13px; border: 1px solid transparent; border-radius: 26px; background: transparent; color: #846d79; font: 8.5px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .2px; cursor: pointer; transition: color .2s ease, background .2s ease, border-color .2s ease; }
#music-toggle:hover { color: #c39bad; background: #9e59720a; }
#music-toggle[hidden] { display: none; }
#music-toggle svg { flex: 0 0 13px; width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
#music-on-icon { display: none; }
#music-toggle[aria-pressed="true"] #music-off-icon { display: none; }
#music-toggle[aria-pressed="true"] #music-on-icon { display: block; }
#music-toggle.is-playing { color: #bc8ba1; border-color: #b47b9414; background: #83425f09; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.no-script { position: absolute; inset: 45% 20px auto; color: var(--ink); text-align: center; font: 18px/1.6 Georgia, serif; }

/* The artwork fills the browser as well as the Android display; only the
   typography and controls keep a comfortable reading width. */
@media (min-width: 700px) and (min-height: 651px) {
  .masthead {
    top: calc(clamp(28px, 4vh, 44px) + var(--safe-area-inset-top));
    left: calc(clamp(32px, 4.5vw, 88px) + var(--safe-area-inset-left));
    right: calc(clamp(32px, 4.5vw, 88px) + var(--safe-area-inset-right));
  }
  .signature > span { font-size: 23px; }
  .edition { max-width: min(320px, 40%); font-size: 8px; }
  .bottom-composition { bottom: calc(clamp(26px, 4vh, 46px) + var(--safe-area-inset-bottom)); }
  .gift-content { width: min(100%, 440px); }
  .gift-wordmark { top: calc(clamp(26px, 4vh, 44px) + var(--safe-area-inset-top)); font-size: 25px; }
  .gift-eyebrow { font-size: 9px; gap: 14px; }
  .gift-title { font-size: clamp(40px, 5vh, 48px); }
  .gift-description { font-size: 17px; }
  .gift-art { width: clamp(250px, 32vh, 310px); }
  .gift-open { gap: 16px; }
  .gift-cta { min-width: 232px; min-height: 54px; font-size: 19px; }
  .gift-signoff { bottom: calc(clamp(28px, 4vh, 44px) + var(--safe-area-inset-bottom)); font-size: 11px; }
}
.is-native-app body { display: block; background: var(--night); }
.is-native-app .experience { width: 100%; height: 100vh; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
@media (max-height: 650px) {
  .gift-intro { padding-top: calc(50px + var(--safe-area-inset-top)); padding-bottom: calc(40px + var(--safe-area-inset-bottom)); }
  .gift-wordmark { top: calc(18px + var(--safe-area-inset-top)); font-size: 21px; }
  .gift-title { margin-top: 12px; margin-bottom: 8px; font-size: 34px; }
  .gift-art { width: min(210px, 68vw); }
  .gift-open { gap: 8px; margin-top: 6px; }
  .gift-signoff { bottom: calc(19px + var(--safe-area-inset-bottom)); }
  .masthead { top: calc(15px + var(--safe-area-inset-top)); }
  .bottom-composition { bottom: calc(13px + var(--safe-area-inset-bottom)); }
  .code-fragment { margin: 6px 0 7px; height: 44px; }
  .code-window { height: 44px; }
  .dedication { margin-bottom: 7px; }
  .growth { gap: 6px; }
}
@media (max-width: 350px) {
  .masthead { left: calc(20px + var(--safe-area-inset-left)); right: calc(20px + var(--safe-area-inset-right)); }
  .edition { font-size: 6px; letter-spacing: .2px; }
}
@media (max-height: 480px) {
  .gift-intro { padding-top: calc(38px + var(--safe-area-inset-top)); padding-bottom: calc(30px + var(--safe-area-inset-bottom)); }
  .gift-wordmark { top: calc(12px + var(--safe-area-inset-top)); font-size: 18px; }
  .gift-eyebrow { font-size: 7px; letter-spacing: 2.5px; }
  .gift-title { margin-top: 8px; margin-bottom: 5px; font-size: 28px; }
  .gift-description { font-size: 13px; }
  .gift-art { width: min(152px, 43vw); }
  .gift-open { margin-top: 0; gap: 2px; }
  .gift-cta { min-height: 48px; min-width: 206px; padding-block: 10px; font-size: 17px; }
  .gift-signoff { bottom: calc(12px + var(--safe-area-inset-bottom)); font-size: 9px; }
  .masthead { top: calc(10px + var(--safe-area-inset-top)); }
  .signature > span { font-size: 19px; }
  .signature-mark { width: 18px; height: 24px; }
  .bottom-composition { bottom: calc(7px + var(--safe-area-inset-bottom)); }
  .code-fragment { margin: 3px 0 4px; height: 28px; }
  .code-window { height: 28px; }
  .dedication { margin-bottom: 4px; }
  .growth { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
