/* Для тебя — ночная тёплая палитра: вино, розовый, золото свечи. Одна тема (ночь) — задумано так. */
:root {
  --bg: #fff6f3; --bg2: #ffe3ea; --ink: #4a2433; --soft: #8a5566; --muted: #b48a96;
  --rose: #e8577a; --rose2: #f497ab; --gold: #cf9850; --paper: #ffffff; --paper-ink: #4a2433;
  --glass: #ffffffb8; --line: #f3cbd5; --shade: #b0476a40;
  --hero-bg: radial-gradient(120% 80% at 50% 0%, #ffdfe7 0%, #fff6f3 55%);
  --gift-bg: radial-gradient(90% 65% at 50% 40%, #ffd8e1, #fff3f0);
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  color-scheme: light;
}
/* ночная пасхалка (22:00–6:00): тёмное небо со звёздами */
body.night {
  --bg: #1a0d14; --ink: #fff3f1; --soft: #f7cfd8; --muted: #c99aa7; --glass: #ffffff12; --line: #ffffff22; --shade: #000c;
  --hero-bg: radial-gradient(120% 80% at 50% 0%, #3a1426 0%, #1a0d14 55%);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { overflow-x: clip; }
body { margin: 0; min-height: 100%; background: var(--hero-bg) fixed, var(--bg); transition: background 2s;
  color: var(--ink); font: 16px/1.55 var(--text); overflow-x: clip; }
body.locked { overflow: hidden; height: 100dvh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2 { font-family: var(--display); font-weight: 600; font-style: normal; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(34px, 9vw, 52px); text-align: center; line-height: 1.05; }
.sub { text-align: center; color: var(--muted); margin: 6px 0 22px; font-size: 14px; }
.kicker { text-align: center; color: var(--gold); letter-spacing: .18em; text-transform: uppercase; font-size: 12px; margin: 0; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

/* звёзды ночью */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0; transition: opacity 2s; }
body.night .sky { opacity: 1; background-image:
  radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 27% 62%, #fff 50%, transparent 51%),
  radial-gradient(1.2px 1.2px at 48% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 66% 40%, #fff 50%, transparent 51%),
  radial-gradient(1.6px 1.6px at 83% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 91% 70%, #fff 50%, transparent 51%),
  radial-gradient(1.3px 1.3px at 7% 84%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 38% 90%, #fff 50%, transparent 51%),
  radial-gradient(1.4px 1.4px at 58% 78%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 76% 92%, #fff 50%, transparent 51%);
  animation: twinkle 4s ease-in-out infinite alternate; }
@keyframes twinkle { from { filter: brightness(.6); } to { filter: brightness(1.3); } }

/* подарок: пудровая коробка, атласный бант цвета шампанского, искорки */
.gift { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center;
  background: var(--gift-bg); transition: opacity 1.6s cubic-bezier(.22,.61,.36,1), visibility 1.6s; padding: 24px; overflow: hidden; }
.gift.gone { opacity: 0; visibility: hidden; }
.gift-hi { font: 400 clamp(56px, 17vw, 84px)/1 "Great Vibes", "Caveat", cursive; margin: 0; color: var(--rose);
  background: linear-gradient(180deg, var(--rose2), var(--rose) 60%, #b8365c); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 .1em .1em; animation: ink 2.4s cubic-bezier(.22,.61,.36,1) both; }
.gift-sub { margin: -4px 0 18px; font: 500 15px var(--text); letter-spacing: .32em; text-transform: uppercase; color: var(--gold); animation: rise 1.6s .8s cubic-bezier(.22,.61,.36,1) both; }
.gift-tap { margin: 18px 0 0; color: var(--muted); letter-spacing: .12em; font-size: 13px; text-transform: uppercase; animation: pulse 2.8s ease-in-out infinite, rise 1.6s 1.2s both; }
.box { position: relative; width: min(64vw, 250px); aspect-ratio: 220 / 230; animation: float 4s ease-in-out infinite, rise 1.6s .4s cubic-bezier(.22,.61,.36,1) both; }
.box svg { width: 100%; height: 100%; overflow: visible; display: block; }
.box .lid { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 1.6s cubic-bezier(.22,.61,.36,1) .5s, opacity 1.2s ease .9s; }
.box .bow { transform-box: fill-box; transform-origin: 50% 70%; transition: transform .9s cubic-bezier(.22,.61,.36,1), opacity .8s ease; }
.box .light { position: absolute; left: 50%; top: 40%; width: 10px; height: 10px; border-radius: 50%; translate: -50% -50%; opacity: 0;
  background: radial-gradient(closest-side, #fff8e7, #ffe1b366 45%, transparent 70%); transition: width 1.8s ease .7s, height 1.8s ease .7s, opacity 1.2s ease .7s; pointer-events: none; }
.box.open { animation: none; }
.box.open .bow { transform: scale(1.25) translateY(-6px); opacity: 0; }
.box.open .lid { transform: translateY(-70%) rotate(-14deg); opacity: 0; }
.box.open .light { width: 520px; height: 520px; opacity: 1; }
.glints i { position: absolute; width: 14px; height: 14px; opacity: 0; animation: glint 3.2s ease-in-out infinite;
  background: conic-gradient(from 45deg, transparent 0 20%, #f6d9a6 20% 30%, transparent 30% 45%, #f6d9a6 45% 55%, transparent 55% 70%, #f6d9a6 70% 80%, transparent 80%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.glints i:nth-child(1) { left: 18%; top: 30%; } .glints i:nth-child(2) { left: 78%; top: 26%; animation-delay: .6s; }
.glints i:nth-child(3) { left: 12%; top: 62%; animation-delay: 1.2s; } .glints i:nth-child(4) { left: 84%; top: 58%; animation-delay: 1.8s; }
.glints i:nth-child(5) { left: 30%; top: 18%; animation-delay: 2.4s; width: 10px; height: 10px; } .glints i:nth-child(6) { left: 66%; top: 74%; animation-delay: .9s; }
.glints i:nth-child(7) { left: 50%; top: 12%; animation-delay: 1.5s; width: 18px; height: 18px; } .glints i:nth-child(8) { left: 24%; top: 80%; animation-delay: 2.1s; }
.glints i:nth-child(9) { left: 72%; top: 40%; animation-delay: 2.7s; width: 9px; height: 9px; }
@keyframes glint { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }

main { position: relative; z-index: 1; padding-inline: 18px; padding-bottom: 80px; }
section { max-width: 760px; margin: 0 auto; padding-block: 60px; }

/* первый экран */
.hero { min-height: 92dvh; display: grid; align-content: center; justify-items: center; gap: 18px; text-align: center; }
.hero h1 { display: flex; align-items: center; gap: 14px; font-size: clamp(64px, 20vw, 120px); line-height: 1; }
.hero .you, .hero .me { font: 400 clamp(84px, 26vw, 150px)/1.1 "Great Vibes", "Caveat", cursive; color: var(--rose);
  background: linear-gradient(180deg, var(--rose2), var(--rose) 55%, #b8365c); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 .12em .08em; animation: ink 2.4s cubic-bezier(.22,.61,.36,1) both; }
.hero .me { animation-delay: .7s; }
@keyframes ink { from { opacity: 0; filter: blur(8px); clip-path: inset(0 100% 0 0); } to { opacity: 1; filter: blur(0); clip-path: inset(0 -10% 0 0); } }
.beat svg { width: clamp(54px, 15vw, 84px); fill: var(--rose); filter: drop-shadow(0 6px 16px #e8577a66); animation: lub 1.8s ease-in-out infinite; display: block; }
.beat:active svg { transform: scale(.9); }
@keyframes lub { 0%, 100% { transform: scale(1); } 18% { transform: scale(1.08); } 34% { transform: scale(1); } 50% { transform: scale(1.05); } }
.days b { display: block; font: 700 clamp(84px, 26vw, 150px)/.95 var(--display); background: linear-gradient(180deg, var(--rose2), var(--rose) 60%, #b8365c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.days span { font-size: 18px; color: var(--soft); letter-spacing: .04em; }
.clock { display: grid; justify-items: center; gap: 2px; margin-top: 2px; }
.clock p { margin: 0; }
.ymd { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 12px; font: 600 clamp(26px, 7.4vw, 34px)/1.15 var(--display); color: var(--ink); }
.ymd b { font-weight: 700; color: var(--rose); font-variant-numeric: lining-nums; }
.ymd em { font-style: normal; }
.ymd i { font-style: normal; color: var(--rose2); }
.ymd .exact { font: 400 clamp(30px, 8.5vw, 40px)/1 "Great Vibes", "Caveat", cursive; color: var(--rose); }
.hms { display: flex; align-items: baseline; gap: 6px; margin-top: 10px; font: 600 clamp(38px, 11vw, 52px)/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums lining-nums; }
.hms b { display: inline-block; min-width: 1.15em; text-align: center; }
.hms b.tick { animation: tick .6s cubic-bezier(.22,.61,.36,1); }
.hms i { font-style: normal; color: var(--rose2); animation: blink 2s ease-in-out infinite; }
@keyframes tick { from { opacity: .25; transform: translateY(-4px); filter: blur(2px); } }
@keyframes blink { 50% { opacity: .25; } }
.hmsl { display: flex; gap: 22px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.hmsl span { min-width: 4.6em; text-align: center; }
.heartbeats { max-width: 30ch; color: var(--soft); margin: 4px 0 0; }
.heartbeats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.monthly { background: linear-gradient(90deg, #f497ab, #f2a678); color: #fff; padding: 8px 16px; border-radius: 99px; font-weight: 700; animation: rise 1s .6s ease both; }
.scroll-hint { color: var(--muted); font-size: 13px; margin-top: 18px; animation: pulse 2s infinite; }
.kicker[title] { cursor: pointer; }

/* история — полароиды */
.timeline { display: grid; gap: 34px; margin-top: 34px; }
.pol { justify-self: center; width: min(86%, 380px); background: var(--paper); color: var(--paper-ink); padding: 12px 12px 14px; border-radius: 4px;
  box-shadow: 0 22px 46px -20px var(--shade), 0 0 0 1px #f6dde3; transform: rotate(var(--r, 0deg)); cursor: zoom-in;
  opacity: 0; translate: 0 26px; filter: blur(6px); transition: opacity 1.6s cubic-bezier(.22,.61,.36,1), translate 1.6s cubic-bezier(.22,.61,.36,1), filter 1.6s ease, transform 1.6s cubic-bezier(.22,.61,.36,1); }
.pol.in { opacity: 1; translate: 0 0; filter: none; }
.pol:nth-child(odd) { --r: -2.5deg; justify-self: start; margin-left: 2%; } .pol:nth-child(even) { --r: 2.2deg; justify-self: end; margin-right: 2%; }
.pol img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; background: #f3dde3 center / cover no-repeat; }
.pol figcaption { font: 600 26px/1.1 var(--hand); padding-top: 8px; text-align: center; }
.pol small { display: block; font: 13px var(--text); color: #b48a96; text-align: center; letter-spacing: .06em; }
.pol .tape { position: absolute; left: 50%; top: -10px; width: 90px; height: 24px; margin-left: -45px; background: #f9c9d4aa; transform: rotate(-3deg); }
.pol { position: relative; }

/* моменты — видео */
.reel { display: grid; grid-auto-flow: column; grid-auto-columns: min(70%, 280px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 4px 18px; scrollbar-width: none; }
.reel::-webkit-scrollbar { display: none; }
.clip { position: relative; scroll-snap-align: center; border-radius: 22px; overflow: hidden; aspect-ratio: 3 / 4; background: #2a1520; box-shadow: 0 18px 40px -18px var(--shade); border: 4px solid #fff; }
.clip video { width: 100%; height: 100%; object-fit: cover; display: block; }
.clip .snd { position: absolute; right: 10px; bottom: 10px; background: #ffffffd9; color: var(--paper-ink); border-radius: 99px; padding: 6px 11px; font-size: 13px; }

/* причины — конверты с сургучом */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 14px; padding-top: 56px; }
.env { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; perspective: 700px; }
.env .back { position: absolute; inset: 0; border-radius: 10px; background: linear-gradient(160deg, #fbd3dc, #f3b2c2); box-shadow: 0 14px 28px -18px var(--shade); }
.env .note { position: absolute; left: 7%; right: 7%; top: 10%; bottom: 8%; background: #fff; border-radius: 6px; padding: 10px 10px 8px; z-index: 1;
  display: grid; place-content: center; text-align: center; font: 600 clamp(18px, 5vw, 22px)/1.1 var(--hand); color: var(--paper-ink);
  box-shadow: 0 6px 16px -10px var(--shade); transition: transform 1.1s cubic-bezier(.22,.61,.36,1) .35s; }
.env .front { position: absolute; inset: 0; border-radius: 10px; z-index: 2; pointer-events: none;
  background: linear-gradient(160deg, #fde3e9, #f7c4d0); clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%); }
.env .flap { position: absolute; left: 0; right: 0; top: 0; height: 58%; z-index: 3; transform-origin: 50% 0; transform-style: preserve-3d;
  background: linear-gradient(180deg, #f9c5d1, #f0a6b8); clip-path: polygon(0 0, 100% 0, 50% 100%); transition: transform .9s cubic-bezier(.22,.61,.36,1), z-index 0s .45s; }
.env .seal { position: absolute; left: 50%; top: 52%; width: 34px; height: 34px; margin: -17px 0 0 -17px; z-index: 4; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f07c97, #c43a5f 70%); box-shadow: 0 3px 8px -2px #8e223f88; display: grid; place-items: center; transition: opacity .5s, transform .5s; }
.env .seal svg { width: 16px; fill: #ffe3ea; }
.env.open .seal { opacity: 0; transform: scale(.6); }
.env.open .flap { transform: rotateX(180deg); z-index: 0; }
.env.open .note { transform: translateY(-46%); z-index: 3; }
.env:not(.open) { cursor: pointer; animation: nudge 5s ease-in-out infinite; }
.env:nth-child(3n+1) { animation-delay: .8s; } .env:nth-child(3n+2) { animation-delay: 2.1s; }
@keyframes nudge { 0%, 88%, 100% { transform: rotate(0); } 92% { transform: rotate(-1.5deg); } 96% { transform: rotate(1.2deg); } }

/* финал */
.final { text-align: center; display: grid; justify-items: center; gap: 12px; min-height: 70dvh; align-content: center; }
.love { font: 700 clamp(80px, 26vw, 160px)/1 var(--display); background: linear-gradient(180deg, var(--rose2) 10%, #b8365c 90%); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: lub 3s ease-in-out infinite; padding: 0 10px; }
.sign { font: 600 30px var(--hand); color: var(--gold); margin: 0; }

/* секреты, тосты, модалки */
.secrets { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; z-index: 30; background: var(--glass); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 99px; font-size: 13px; color: var(--soft); backdrop-filter: blur(8px); box-shadow: 0 8px 20px -12px var(--shade); }
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); translate: -50% -140%; z-index: 60; max-width: min(92vw, 420px); text-align: center;
  background: var(--paper); color: var(--paper-ink); padding: 12px 18px; border-radius: 16px; box-shadow: 0 16px 40px -14px var(--shade), 0 0 0 1px #f6dde3; font-weight: 600; opacity: 0; visibility: hidden;
  transition: translate .8s cubic-bezier(.22,.61,.36,1), opacity .8s, visibility .8s; }
.toast.show { translate: -50% 0; opacity: 1; visibility: visible; }
.modal, .lightbox { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: #4a24339e; backdrop-filter: blur(6px); animation: fade .7s ease; }
@keyframes fade { from { opacity: 0; } }
.paper { position: relative; width: min(100%, 460px); max-height: 86dvh; overflow: auto; background: var(--paper); color: var(--paper-ink); border-radius: 10px; padding: 34px 26px 26px;
  font: 600 25px/1.3 var(--hand); box-shadow: 0 30px 70px -24px #4a2433aa; animation: rise .9s cubic-bezier(.22,.61,.36,1); }
.paper .dear { font-size: 30px; margin-top: 0; }
.paper .sign { color: var(--rose); text-align: right; }
.x { position: absolute; right: 10px; top: 6px; font-size: 32px; line-height: 1; color: inherit; padding: 6px 10px; }
.lightbox img { max-width: 100%; max-height: 78dvh; border-radius: 6px; box-shadow: 0 20px 60px #000; }
.lightbox p { font: 600 28px var(--hand); margin: 12px 0 0; text-align: center; color: #fff; }
.lightbox .x { color: #fff; }

@media (min-width: 720px) { .timeline { grid-template-columns: 1fr 1fr; } .pol:nth-child(even) { margin-top: 90px; } .pol { justify-self: center !important; margin: 0 !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .pol { opacity: 1; translate: 0 0; } }

.paper .ltitle { margin: 0 0 10px; font: 400 34px/1.15 "Great Vibes", "Caveat", cursive; color: var(--rose); text-align: center; }
.days { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pol { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wife { margin: 4px 0 2px; font: 400 clamp(34px, 10vw, 50px)/1.15 "Great Vibes", "Caveat", cursive; color: var(--rose); text-wrap: balance; max-width: 14em;
  opacity: 0; filter: blur(8px); transform: translateY(12px); transition: opacity 2.2s cubic-bezier(.22,.61,.36,1), filter 2.2s, transform 2.2s; }
.wife.in { opacity: 1; filter: none; transform: none; }
