:root {
  --royal: #17122d;
  --midnight: #121128;
  --gilt: #efd298;
  --gilt-dark: #80603b;
  --silk: #fff2d8;
  --ease-magic: cubic-bezier(.4, 0, .2, 1);
  --ease-arrive: cubic-bezier(0, 0, .2, 1);
}
.symbol-library { position: absolute; width: 0; height: 0; overflow: hidden; }
header { z-index: 12; }
.brand-star { display: inline-flex; vertical-align: middle; }
.brand-star svg { width: 23px; height: 23px; fill: currentColor; }
.hero { isolation: isolate; background: var(--midnight); }
.hero-image { background-position: 70% 34%; }
.hero-shade {
  background: linear-gradient(90deg,#151126f7 0%,#211631d9 21%,#30204185 43%,#2719321c 70%),
  linear-gradient(0deg,#171127ed,transparent 30%,transparent 73%,#17112748);
}
.hero-content { z-index: 2; padding-top: clamp(125px, 19svh, 210px); max-width: min(58vw, 820px); }
.hero h2 { font-size: clamp(64px, 7.1vw, 111px); letter-spacing: -.045em; line-height: .94; margin: 25px 0; text-wrap: balance; }
.hero h2 em { color: var(--gilt); text-shadow: 0 0 34px #f7ce8155; }
.hero-copy { color: #fff2e7; }
.hero-in { animation: magic-rise 650ms var(--ease-arrive) both; }
.hero-in:nth-child(2) { animation-delay: 110ms; }
.hero-in:nth-child(3) { animation-delay: 200ms; }
.hero-in:nth-child(4) { animation-delay: 290ms; }
.hero-in:nth-child(5) { animation-delay: 380ms; }
.hero-frame { position: absolute; inset: 83px 3.6% 28px; pointer-events: none; border: 1px solid #ffe1a331; }
.hero-frame i { position: absolute; width: 19px; height: 19px; border: 1px solid #ffe0a8c0; transform: rotate(45deg); }
.hero-frame i:nth-child(1) { top: -8px; left: -8px; }
.hero-frame i:nth-child(2) { top: -8px; right: -8px; }
.hero-frame i:nth-child(3) { bottom: -8px; left: -8px; }
.hero-frame i:nth-child(4) { bottom: -8px; right: -8px; }
.hero-magic, .hero-motes { position: absolute; inset: 0; pointer-events: none; }
.castle-arc { position: absolute; right: 1%; top: 6%; width: min(64%, 880px); overflow: visible; filter: drop-shadow(0 0 7px #ffcb6caa); }
.castle-arc path { fill: none; stroke: url(#arc-ink); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-arc 1.25s var(--ease-magic) .35s forwards; }
.arc-star { color: #ffedbb; fill: currentColor; transform-box: fill-box; transform-origin: center; animation: arc-glint 3.5s var(--ease-magic) 1.35s infinite both; }
.mote { position: absolute; left: var(--x); top: var(--y); width: var(--size); height: var(--size); background: #ffe4ab; border-radius: 50%; box-shadow: 0 0 9px 2px #ffc47190; animation: mote-drift var(--time) var(--ease-magic) var(--lag) infinite; }
.hero-spark { z-index: 1; pointer-events: none; }
.button { position: relative; isolation: isolate; border-radius: 3px; transition: transform 190ms var(--ease-magic), box-shadow 240ms var(--ease-magic); }
.button::after { content: ''; position: absolute; z-index: -1; inset: 3px; border: 1px solid #51332336; border-radius: 1px; pointer-events: none; }
.button:hover { transform: translateY(-3px) scale(1.035); }
.button:active { transform: scale(1.035,.955); transition-duration: 110ms; }
.button span { transition: transform 250ms var(--ease-magic); }
.button:hover span { transform: rotate(18deg) scale(1.2); }
#begin, #ask, #continue { background: linear-gradient(108deg, #f8dfab, #fdf1d4 52%, #e6bf80); color: #39263c; box-shadow: 0 0 24px #ffd58a40; }
#begin { font-size: 12px; }
.page-turn { position: fixed; z-index: 40; inset: 0; pointer-events: none; visibility: hidden; perspective: 1200px; }
.page-turn.turning { visibility: visible; }
.page-leaf { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at 72% 34%,#f7dfb6,#ba8660 85%); color: #795437; border: 8px double #fff2c37d; transform-origin: left center; opacity: 0; }
.turning .page-leaf { animation: turn-leaf 600ms var(--ease-magic) both; }
.page-leaf span { font: 90px var(--serif); }
.prologue { background: radial-gradient(ellipse at 50% 15%, #f8e6ce 0%, #faf6ef 66%); padding-top: 66px; }
.rose-stage { position: relative; width: 150px; margin: 0 auto 18px; }
.rose-stage svg { display: block; width: 100%; }
.rose-stage>span { position: absolute; right: 7px; top: 15px; color: #ae7649; font-size: 29px; animation: twinkle 3.2s ease-in-out infinite; }
.cloche { fill: #fff6de59; stroke: #ac804a; stroke-width: 1.25; stroke-linecap: round; }
.stem { fill: #557758; stroke: #557758; stroke-width: 1.6; }
.rose-bloom { transform-origin: 79px 64px; animation: bloom 4.3s ease-in-out infinite; }
.falling-petal { animation: fall-petal 5.7s ease-in-out infinite; }
.cork-collection { background: radial-gradient(ellipse at 50% 35%,#fbf5e9,#f3e7d8); border-color: #cbb294; }
.memory { transition: opacity 650ms var(--ease-arrive), translate 650ms var(--ease-arrive), background 260ms var(--ease-magic); }
button.memory:hover, button.memory:focus-visible { background: #fff7e8; }
.memory .orbit { box-shadow: inset 0 0 30px #dbab5833; border-color: #b08a5480; }
.memory .orbit:after { background: transparent; }
.memory .cork { animation: cork-float 4.5s var(--ease-magic) infinite; }
.memory:nth-child(2) .cork { animation-delay: -.9s; }
.memory:nth-child(3) .cork { animation-delay: -1.8s; }
.memory:hover .cork, .memory:focus-visible .cork { transform: translateY(-10px) rotate(0deg); }
.memory-open { color: #735635; }
.future .cork-outline { box-shadow: 0 0 20px #dba95f33; }
.bridge { isolation: isolate; background: radial-gradient(ellipse at 20% 20%,#4c3458,#211937 57%,#151229); color: var(--silk); }
.bridge-photo { border: 1px solid #dcb885; background: #e9cda2; padding: 10px 10px 20px; z-index: 1; }
.bridge-photo>span { color: #53354a; }
.bridge-copy { position: relative; z-index: 1; }
.bridge-copy .eyebrow, .bridge-copy h2 em, .bridge-star { color: var(--gilt); }
.bridge-copy>p:not(.eyebrow) { color: #efdfdf; }
.bridge .text-link { border-color: #ddbc83; }
.lantern-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lantern { position: absolute; bottom: -90px; left: var(--x); width: var(--size); aspect-ratio: .77; opacity: 0; border-radius: 27% 27% 22% 22% / 12% 12% 15% 15%; background: linear-gradient(90deg,#c56343,#ffce79 44%,#ffc46b 69%,#b76141); border: 1px solid #f6bd6d; box-shadow: 0 0 18px #ffb36d88; animation: fly-lantern var(--time) var(--ease-magic) var(--lag) infinite; }
.lantern::after { content: ''; position: absolute; inset: 9% 0 13%; border-block: 1px solid #8c473269; }
.question { isolation: isolate; background: radial-gradient(ellipse at 50% 100%, #573a65,#262245 47%,#14132e 83%); min-height: 690px; }
.question-castle { position: absolute; bottom: 0; width: min(64vw, 750px); height: auto; fill: #110f27; color: #dba56e60; opacity: .77; pointer-events: none; }
.question h2 em { color: var(--gilt); text-shadow: 0 0 42px #ffc86a40; }
.question-reveal { animation: magic-rise 650ms var(--ease-arrive) both; }
.question-heart { filter: drop-shadow(0 0 18px #fbc57e); }
.next-chapter { position: relative; isolation: isolate; overflow: hidden; background: radial-gradient(ellipse at 50% 20%,#513455,#241b39 52%,#141329); color: var(--silk); }
#fireworks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.next-chapter>.eyebrow, .next-chapter .ending, .ticket { position: relative; }
.next-chapter>.eyebrow, .next-chapter .ending em { color: var(--gilt); }
.ticket { background: linear-gradient(130deg,#fff6e3,#f2dec0 51%,#fff4df); border-color: #f4cf8f; outline-color: #a9834b; color: var(--ink); box-shadow: 0 12px 55px #100d2aa0, 0 0 38px #ffc77553; }
.ticket-star svg { width: 42px; height: 42px; fill: #9e744a; }
.ticket-divider::before, .ticket-divider::after { background: #30213e; }
dialog[open] { animation: memory-open 360ms var(--ease-arrive) both; }
@keyframes magic-rise { from { opacity: 0; transform: translateY(25px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes draw-arc { to { stroke-dashoffset: 0; } }
@keyframes arc-glint { 0%,100% { opacity: .3; transform: scale(.55); } 44% { opacity: 1; transform: scale(1.2); } }
@keyframes mote-drift { 0%,100% { opacity: .15; transform: translate(0,0); } 50% { opacity: .88; transform: translate(8px,-15px); } }
@keyframes turn-leaf { 0% { transform: rotateY(79deg) translateX(-34%); opacity: 0; } 43% { transform: rotateY(0deg); opacity: 1; } 100% { transform: rotateY(-73deg) translateX(-38%); opacity: 0; } }
@keyframes bloom { 0%,100% { transform: rotate(-4deg) scale(.98); } 50% { transform: rotate(4deg) scale(1.06); } }
@keyframes fall-petal { 0%,12% { opacity: 0; transform: translate(0,-8px); } 26% { opacity: 1; } 78% { opacity: 1; transform: translate(17px,33px) rotate(9deg); } 100% { opacity: 0; transform: translate(18px,34px) rotate(9deg); } }
@keyframes cork-float { 0%,100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes fly-lantern { 0% { transform: translate(0,0) rotate(-7deg); opacity: 0; } 16% { opacity: .76; } 75% { opacity: .43; } 100% { transform: translate(var(--drift),-860px) rotate(9deg) scale(.65); opacity: 0; } }
@keyframes memory-open { 0% { opacity: 0; transform: perspective(700px) rotateX(7deg) translateY(18px) scale(.97); } 100% { opacity: 1; transform: none; } }
@media (max-width: 1000px) { .hero-content { max-width: 65vw; } }
@media (max-width: 700px) {
  .hero { min-height: 680px; }
  .hero-image { background-position: 57% 0; background-size: auto 103%; }
  .hero-shade { background: linear-gradient(0deg,#161126 0%,#201631f2 23%,#251b3ca3 51%,#2b23431a 76%,#211a3868),linear-gradient(90deg,#22183240,transparent); }
  .hero-frame { inset: 70px 4.2% 21px; }
  .hero-frame i { width: 12px; height: 12px; }
  .hero-frame i:nth-child(1), .hero-frame i:nth-child(2) { top: -5px; }
  .hero-frame i:nth-child(3), .hero-frame i:nth-child(4) { bottom: -5px; }
  .hero-frame i:nth-child(odd) { left: -5px; }
  .hero-frame i:nth-child(even) { right: -5px; }
  .hero-content { max-width: none; bottom: 88px; padding: 0 8%; }
  .hero h2 { font-size: clamp(46px, 13vw, 70px); margin: 0 0 17px; text-wrap: initial; }
  .hero h2 br:nth-child(2) { display: initial; }
  .hero h2 em { display: inline; }
  .hero-copy { margin-bottom: 23px; }
  .castle-arc { top: 10%; right: -1%; width: 97%; }
  .scroll-hint { left: 8%; bottom: 32px; }
  .hero-number { right: 8%; bottom: 38px; }
  .prologue { padding-top: 48px; }
  .rose-stage { width: 122px; }
  .question { min-height: 605px; }
  .question-castle { width: min(99vw,550px); }
}
@media (prefers-reduced-motion: reduce) {
  .castle-arc path { stroke-dashoffset: 0; }
  .hero-motes, .lantern-sky, .page-turn, #fireworks { display: none; }
  .arc-star { opacity: 1; }
}
.arc-traveler { animation: traveler-glow 1.55s ease-in-out .3s both; }
@keyframes traveler-glow { 0%,100% { opacity: 0; } 14%,84% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .arc-traveler { display: none; } }

/* Original illustrations based on the keepsakes. */
.cork-art { position: relative; z-index: 1; display: block; height: auto; object-fit: contain; filter: drop-shadow(4px 9px 6px #593b2938); transition: transform 420ms var(--ease-magic); animation: cork-float 4.5s var(--ease-magic) infinite; }
.cork-art-pazo { width: 73px; transform: rotate(-10deg); }
.cork-art-emendis { width: min(78%, 184px); transform: rotate(8deg); animation-delay: -.9s; }
.cork-art-pariente { width: min(78%, 190px); transform: rotate(-6deg); animation-delay: -1.8s; }
.memory:hover .cork-art, .memory:focus-visible .cork-art { transform: translateY(-8px) rotate(0deg) scale(1.045); }
.dialog-cork-stage { height: 148px; display: grid; place-items: center; margin: 14px auto 18px; background: radial-gradient(ellipse, #efd2a261, transparent 62%); }
.dialog-cork-stage .cork-art-pazo { width: 58px; }
.dialog-cork-stage :is(.cork-art-emendis, .cork-art-pariente) { width: min(74%, 233px); }
#memory-dialog { max-height: calc(100dvh - 28px); overflow-y: auto; }
#memory-dialog:has(.dialog-cork-stage:not([hidden])) { padding-top: 35px; padding-bottom: 35px; }
#memory-dialog:has(.dialog-cork-stage:not([hidden])) h2 { margin-bottom: 16px; }
@media (max-width: 700px) {
  .cork-stage .cork-art-pazo { width: 58px; }
  .cork-stage :is(.cork-art-emendis, .cork-art-pariente) { width: min(91%, 141px); }
  .dialog-cork-stage { height: 127px; margin: 8px auto 14px; }
  .dialog-cork-stage .cork-art-pazo { width: 51px; }
}
