/* One continuous night: distant sky, a quiet letter, then the stars we keep. */
:root {
  --bg: #080e19;
  --cream: #f2eee4;
  --gold: #debf89;
  --muted: #a6b2c5;
  --line: #debf8924;
  --ease-arrive: cubic-bezier(.16,1,.3,1);
}
body { background: var(--bg); }
.section { width: min(1160px, calc(100% - 112px)); }
.sky-atmosphere { position: absolute; inset: 0 0 auto; height: min(1220px, 150svh); overflow: hidden; z-index: -3; pointer-events: none; }
.sky-atmosphere img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 25%; opacity: .82; }
.sky-atmosphere::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #080e1900 45%, #080e19 98%), linear-gradient(90deg, #080e19bb, #080e1944 48%, #080e1900 85%); }
#starfield { z-index: -2; }
.nebula { display: none; }
.site-header { width: min(1320px, calc(100% - 112px)); height: 90px; border: 0; }
.brand { font-size: 19px; letter-spacing: .08em; }
.brand-star { flex-basis: 23px; }
.brand-star svg { width: 23px; height: 23px; }
.brand small { display: none; }
.site-header nav { gap: 32px; font-size: 13px; color: #c1c9d4; }
.sound-button { color: #c1c9d4; }
.hero { display: block; min-height: min(840px, calc(100svh - 90px)); padding-block: clamp(60px, 11svh, 120px) 110px; }
.hero-copy { max-width: 620px; }
.hero h1 { font-size: clamp(48px, 5vw, 72px); line-height: 1.44; letter-spacing: .025em; text-shadow: 0 5px 30px #02060daa; }
.hero-title-line { display: block; }
.hero .gold { color: #e5c997; }
.letter-intro { margin-top: 25px; color: #e1c89e; letter-spacing: .15em; font-size: 14px; }
.hero-description { color: #c0cad8; font-size: 16px; line-height: 2.15; margin-top: 20px; }
.recipient { gap: 16px; margin: 30px 0 26px; color: #b1bccd; }
.recipient-name { color: var(--cream); font-size: 21px; }
.hero .primary-button { background: transparent; border-bottom: 1px solid #debf8980; color: #f0dfbd; padding: 15px 0; min-width: 286px; border-radius: 0; }
.hero .primary-button:hover:not(:disabled) { background: transparent; transform: none; color: #fff2d7; }
.hero .primary-button > span:last-child { transition: transform .4s var(--ease-arrive); }
.hero .primary-button:hover > span:last-child { transform: translate(3px,-3px); }
.entry-note { color: #a9b6c9; margin-top: 12px; }
.celestial { position: absolute; inset: 18% 5% auto auto; width: 200px; height: 200px; margin: 0; pointer-events: none; }
.celestial .chart-label { inset: auto -60px -40px; font-size: 13px; color: #d5c5a9; letter-spacing: .12em; text-shadow: 0 2px 12px #02050a; }
.guiding-star { display: block; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: #fff3d7; transform: translate(-50%,-50%); }
.guiding-star::before, .guiding-star::after { content: ''; position: absolute; background: #f1d7a5; opacity: .7; }
.guiding-star::before { width: 1px; height: 36px; left: 2px; top: -15px; }
.guiding-star::after { width: 28px; height: 1px; left: -11px; top: 2px; }
.entered .guiding-star { animation: star-greeting .85s var(--ease-arrive) both; }
@keyframes star-greeting { 40% { transform: translate(-50%,-50%) scale(1.65); } }
.hero-side-note { display: none; }
.scroll-cue { bottom: 30px; color: #b9c2d0; }
.scroll-cue span { height: 42px; background: linear-gradient(#e1c48d, #e1c48d00); opacity: .65; }
main h2 { font-size: clamp(30px,3vw,42px); line-height: 1.6; }
.section-description { color: #bac5d4; }
main .section-caption { display: none; }

/* The reminder is a small practical stop, before the spacious countdown. */
.calendar-section { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 56px; padding-block: 52px; text-align: left; border-top: 1px solid var(--line); }
.calendar-copy h2 { font-size: 28px; }
.calendar-copy .section-description { font-size: 15px; margin-top: 10px; }
.calendar-reminder { width: 100%; margin: 0; max-width: 410px; justify-self: end; }
.calendar-reminder .primary-button { min-height: 50px; padding: 12px 22px; border: 1px solid #debf8966; background: #182331; color: #f0d6a7; }
.calendar-reminder .primary-button:hover { background: #233142; transform: none; }
.calendar-time { font-size: 12px; color: #b6c2d2; margin-top: 15px; line-height: 1.9; }
.calendar-hint { color: #aab8cb; font-size: 12px; }
.calendar-help { color: #b6c2d2; font-size: 12px; }
.calendar-help summary { margin-left: 0; padding-left: 0; }
.calendar-help p { margin-left: 0; }
.countdown-section { padding-block: 104px 102px; border-bottom: 0; }
.countdown-section h2 { max-width: 17em; margin-inline: auto; }
.countdown-section .section-description { font-size: 15px; }
.countdown { max-width: 720px; margin-block: 48px 32px; gap: 22px; }
.countdown strong { color: #eee1c8; font-size: clamp(50px,6.2vw,84px); font-weight: 400; }
.countdown i { color: #b5a486; opacity: .6; }
.countdown div > span { margin-top: 16px; color: #b0bdd0; font-size: 12px; letter-spacing: .05em; }
.countdown div > span small { display: none; }
.date-stamp { color: #b7bcc5; }
.date-stamp > span { opacity: .65; }
.countdown-section .arm-hint { color: #aebbcf; }

/* Read memories leave a luminous trace; the scene remains usable without JS. */
.memory-section { padding-block: 64px 88px; }
.section-heading { align-items: center; gap: 56px; }
.section-heading > p { max-width: 26em; color: #c1cbd8; line-height: 2.1; }
.section-heading .muted { color: #aebacb; }
.memory-map { height: 490px; margin-top: 58px; isolation: isolate; }
.memory-map::before { content: ''; position: absolute; inset: -20px -4%; z-index: -1; pointer-events: none; background: url('assets/atmosphere/midnight-sky.webp') center 65% / cover; opacity: .13; mask-image: radial-gradient(ellipse, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse, #000 20%, transparent 70%); }
.constellation-lines path { stroke: #9eaebf; opacity: .28; stroke-width: .8; stroke-dasharray: 2 8; }
.constellation-lines .constellation-lit { stroke: #e5c388; opacity: .8; stroke-width: 1.1; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s var(--ease-arrive); }
.has-memory-0 .constellation-lit.line-0, .has-memory-1 .constellation-lit.line-1, .has-memory-2 .constellation-lit.line-2 { stroke-dashoffset: 0; }
.memory-star { width: 200px; }
.star-node { position: relative; width: 44px; height: 44px; color: #e4c794; }
.star-node::before { content: ''; position: absolute; inset: -11px; border-radius: 50%; background: radial-gradient(circle, #e7c99330, #e7c99300 67%); opacity: .55; transition: opacity .35s ease, transform .5s var(--ease-arrive); }
.star-node svg { width: 22px; height: 22px; }
.memory-star:hover .star-node, .memory-star:focus-visible .star-node { transform: scale(1.1); }
.memory-star:hover .star-node::before, .memory-star:focus-visible .star-node::before, .memory-star.visited .star-node::before { opacity: 1; transform: scale(1.35); }
.memory-star.visited .star-node { color: #fff0cc; }
/* The light breathes; labels, photographs and hit areas stay perfectly still. */
.memory-star { --twinkle-period: 6.8s; --twinkle-delay: -2.4s; --star-dim: .62; --star-soft: .82; }
.memory-two { --twinkle-period: 8.3s; --twinkle-delay: -5.7s; }
.memory-three { --twinkle-period: 7.4s; --twinkle-delay: -1.1s; }
.memory-star.visited { --star-dim: .86; --star-soft: .94; }
.memory-star .star-node svg { animation: memory-glimmer var(--twinkle-period) ease-in-out var(--twinkle-delay) infinite; animation-play-state: paused; }
.memory-star .star-node::after { content: ''; position: absolute; inset: -6px; pointer-events: none; background: radial-gradient(circle, #f0d59c35, #e7c99300 64%); opacity: 0; animation: memory-corona var(--twinkle-period) ease-in-out var(--twinkle-delay) infinite; animation-play-state: paused; }
.sky-motion-active .stars-in-view .star-node svg,
.sky-motion-active .stars-in-view .star-node::after { animation-play-state: running; }
.memory-star:hover .star-node svg,
.memory-star:focus-visible .star-node svg { animation: none; opacity: 1; }
@keyframes memory-glimmer {
  0%, 100% { opacity: var(--star-soft); }
  24% { opacity: var(--star-dim); }
  48% { opacity: 1; }
  61% { opacity: var(--star-soft); }
  72% { opacity: .97; }
}
@keyframes memory-corona {
  0%, 24%, 100% { opacity: .08; transform: scale(.9); }
  48% { opacity: .7; transform: scale(1.18); }
  61% { opacity: .18; transform: scale(1); }
  72% { opacity: .45; transform: scale(1.08); }
}
.memory-index { display: none; }
.memory-star strong { font-size: 22px; margin-top: 12px; letter-spacing: .06em; }
.memory-hint { color: #b3bfd0; margin-top: 7px; font-size: 12px; }
.memory-keepsake { display: block; position: absolute; left: 2px; top: -25px; width: 61px; height: 66px; padding: 3px 3px 8px; background: #e9e1d2; transform: rotate(-9deg); box-shadow: 0 10px 24px #01050b99; transition: transform .45s var(--ease-arrive); }
.memory-keepsake img { width: 100%; height: 100%; object-fit: cover; display: block; }
.memory-one:hover .memory-keepsake, .memory-one:focus-visible .memory-keepsake { transform: rotate(-5deg) translateY(-3px); }
.map-caption { color: #b4bfd0; font-size: 12px; }
.map-caption > span { margin-right: 9px; }

/* A closer, quieter object at the end of the journey. */
.gift-section { gap: 70px; border: 0; padding-block: 64px 100px; }
.gift-art { height: 340px; }
.gift-orbit { border-color: #cdb38620; width: 300px; height: 300px; background: none; }
.gift-orbit::after { inset: -18px; border-style: solid; border-color: #cdb3860c; }
.envelope { width: 270px; height: 172px; transform: rotate(-7deg); border-color: #bda67a70; background: linear-gradient(150deg,#293341,#15202e 75%); box-shadow: 0 30px 58px #01050b80; transition: transform .6s var(--ease-arrive); }
.gift-art:hover .envelope { transform: rotate(-4deg) translateY(-5px); }
.wax-seal { background: linear-gradient(135deg,#c8ab79,#80613e); }
.floating-star { opacity: .65; }
.gift-copy h2 { font-size: clamp(29px,2.8vw,38px); }
.gift-copy .section-description { line-height: 2.1; }
.gift-button { border-color: #debf8970; transition: color .25s ease, background .25s ease; }
.closing { padding-block: 70px 100px; }
.closing p { font-size: 30px; line-height: 2; letter-spacing: .055em; }
.closing-star { margin-bottom: 18px; }
.closing > span { color: #aebbd0; }
footer { border-color: #debf891a; color: #aeb9c9; }
footer > span:last-child { display: none; }

/* The photograph stays whole, framed like something worth keeping. */
dialog:not(.cinema-dialog) { background: #101c2a; border: 1px solid #d3bc8e45; box-shadow: 0 30px 90px #0009; border-radius: 3px; }
dialog:not(.cinema-dialog)::backdrop { background: #020712d9; }
dialog:not(.cinema-dialog)[open] { animation: letter-arrival .35s var(--ease-arrive) both; }
@keyframes letter-arrival { from { opacity: .2; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.story-dialog { text-align: left; }
#storyImageWrap { padding: 7px; background: #e9e1d3; box-shadow: 0 12px 30px #02060d55; margin-bottom: 25px; }
#storyImage { max-height: 45svh; }
.story-dialog h2 { font-size: 30px; }
.story-text { color: #ced5df; line-height: 2.1; }
.story-dialog .section-caption { display: none; }
.story-dialog .text-button { margin-top: 24px; }
.cinema-dialog .close-button { opacity: .8; background: #050c1880; border-radius: 50%; }
body:has(dialog[open]) .sky-atmosphere, body:has(dialog[open]) .guiding-star { animation-play-state: paused; }

@media (min-width: 701px) and (max-width: 1050px) {
  .section, .site-header, footer { width: calc(100% - 80px); }
  .hero h1 { font-size: 55px; }
  .celestial { right: 0; top: 12%; }
  .calendar-section { gap: 32px; }
}
@media (max-width: 700px) {
  .section, .site-header, footer { width: calc(100% - 48px); }
  .site-header { height: 74px; }
  .brand { font-size: 17px; gap: 9px; }
  .brand-star, .brand-star svg { width: 22px; height: 22px; flex-basis: 22px; }
  .sound-button { font-size: 12px; }
  .sky-atmosphere { height: 1000px; max-height: 135svh; }
  .sky-atmosphere img { object-position: 66% top; opacity: .66; }
  .sky-atmosphere::after { background: linear-gradient(180deg,#080e1922 5%,#080e1944 55%,#080e19 100%),linear-gradient(90deg,#080e1988,#080e1900); }
  .hero { display: block; min-height: min(780px,calc(100svh - 74px)); padding-block: 54px 94px; }
  .hero-copy { max-width: 100%; }
  .hero h1 { font-size: clamp(39px,11.2vw,51px); line-height: 1.48; letter-spacing: .015em; }
  .letter-intro { margin-top: 23px; font-size: 13px; letter-spacing: .13em; }
  .hero-description { font-size: 15px; line-height: 2.1; margin-top: 18px; }
  .recipient { margin: 24px 0 20px; gap: 13px; font-size: 12px; }
  .recipient-name { font-size: 19px; }
  .hero .primary-button { min-width: 0; width: min(290px,100%); padding-block: 15px; font-size: 14px; }
  .entry-note { font-size: 12px; margin-top: 12px; }
  .celestial { width: 70px; height: 70px; top: 18px; right: 6px; }
  .celestial .chart-label { display: none; }
  .guiding-star { width: 4px; height: 4px; opacity: .8; }
  .guiding-star::before { left: 1.5px; height: 28px; top: -12px; }
  .guiding-star::after { top: 1.5px; width: 22px; left: -9px; }
  .scroll-cue { bottom: 24px; font-size: 12px; }
  .scroll-cue span { height: 28px; }
  .calendar-section { display: block; padding-block: 38px 42px; }
  .calendar-copy h2 { font-size: 25px; }
  .calendar-copy .section-description { font-size: 14px; margin-top: 10px; }
  .calendar-reminder { margin-top: 23px; max-width: 100%; }
  .calendar-reminder .primary-button { font-size: 14px; min-height: 50px; padding-inline: 20px; }
  .calendar-time { margin-top: 17px; font-size: 12px; }
  .calendar-hint { font-size: 12px; }
  .calendar-help { font-size: 12px; margin-top: 4px; }
  .countdown-section { padding-block: 68px 64px; }
  .countdown-section h2 { max-width: 12em; font-size: 27px; }
  .countdown-section .section-description { font-size: 14px; max-width: 22em; margin-inline: auto; }
  .countdown { gap: 7px; margin-block: 35px 29px; }
  .countdown strong { font-size: clamp(39px,11vw,54px); }
  .countdown div > span { margin-top: 12px; font-size: 12px; }
  .countdown i { font-size: 20px; line-height: 2; }
  .date-stamp { font-size: 12px; }
  .countdown-section .arm-hint { font-size: 12px; }
  .memory-section { padding-block: 46px 52px; }
  .section-heading { display: block; }
  .section-heading h2 { font-size: 30px; line-height: 1.6; }
  .section-heading > p { font-size: 15px; margin-top: 24px; line-height: 2.05; }
  .section-heading .muted { font-size: 12px; margin-top: 15px; }
  .memory-map { height: 550px; margin-top: 50px; margin-inline: -10px; }
  .memory-star { width: 170px; }
  .memory-star strong { font-size: 22px; margin-top: 10px; }
  .memory-hint { max-width: 164px; font-size: 12px; }
  .memory-keepsake { width: 51px; height: 56px; left: -1px; top: -20px; }
  .map-caption { max-width: 25em; margin-inline: auto; font-size: 12px; }
  .gift-section { display: flex; gap: 0; padding-block: 24px 64px; }
  .gift-art { height: 294px; transform: none; margin: 0; width: 100%; }
  .gift-orbit { width: 252px; height: 252px; }
  .envelope { transform: rotate(-7deg) scale(.91); }
  .gift-art:hover .envelope { transform: rotate(-4deg) scale(.91); }
  .gift-copy h2 { font-size: 29px; }
  .gift-copy .section-description { font-size: 15px; }
  .closing { padding-block: 40px 80px; }
  .closing p { font-size: 27px; letter-spacing: .04em; }
  .closing > span { font-size: 13px; }
  footer { padding-block: 24px 30px; gap: 20px; justify-content: space-between; }
  .footer-brand { font-size: 15px; }
  footer > span { font-size: 12px; }
  dialog:not(.cinema-dialog) { padding: 54px 25px 28px; border-radius: 3px; }
  #storyImageWrap { padding: 5px; margin-top: 0; margin-bottom: 23px; }
  #storyImage { max-height: 42svh; }
  .story-dialog h2 { font-size: 27px; }
  .story-text { font-size: 15px; margin-top: 17px; }
}
@media (max-width: 360px) {
  .hero { padding-top: 44px; }
  .hero h1 { font-size: 39px; }
  .hero-description { font-size: 14px; }
  .calendar-time { font-size: 12px; }
  .countdown-section h2 { font-size: 25px; }
  .countdown strong { font-size: 37px; }
  .memory-star { width: 156px; }
  .memory-star strong { font-size: 20px; }
  .memory-keepsake { width: 46px; height: 51px; left: 0; }
  .closing p { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .entered .guiding-star, dialog:not(.cinema-dialog)[open], .memory-star .star-node svg, .memory-star .star-node::after { animation: none; }
  .constellation-lit, .memory-keepsake { transition: none; }
}
