/* styles/main.css — soft fairy theme: pastel, cozy, phone-first */

:root {
  --pink: #e98aa8;
  --pink-deep: #bd587b;
  --blush: #f8dce6;
  --cream: #fff8fa;
  --ink: #563c48;
  --muted: #987783;
  --mint: #d6efe4;
  --lilac: #e9ddf7;
  --gold: #d9a85c;
  --night: #3b1c34;
  --night-2: #6b2f57;
  --wine: var(--pink-deep);
  --shadow: 0 22px 65px rgba(177, 99, 127, .13);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--cream); }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 210, 225, .6), transparent 26rem),
    radial-gradient(circle at 92% 40%, rgba(233, 221, 247, .75), transparent 24rem),
    radial-gradient(circle at 8% 88%, rgba(214, 239, 228, .65), transparent 24rem),
    var(--cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--pink-deep); outline-offset: 3px; }
main, .site-footer { position: relative; z-index: 1; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; }
h1 { font-size: clamp(2.5rem, 10vw, 4.2rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.8rem, 7vw, 2.8rem); letter-spacing: -.02em; }
h3 { font-size: 1.5rem; }
em { font-family: var(--serif); font-style: italic; color: var(--pink-deep); }

.eyebrow { color: var(--pink-deep); text-transform: uppercase; letter-spacing: .16em; font-size: .68rem; font-weight: 700; }
.eyebrow span { padding: 0 6px; color: var(--pink); }
.small-script { font-family: var(--serif); font-style: italic; color: var(--muted); margin: 14px 0 4px; }
.lead { color: var(--muted); line-height: 1.8; max-width: 460px; margin-inline: auto; }
.text-center { text-align: center; }
.gold-rule { width: 44px; height: 1px; border: 0; background: var(--pink); margin: 1.2rem auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 13px 24px;
  border-radius: 999px; border: 1px solid #e8a9bd;
  background: #fff; color: var(--pink-deep);
  font-size: .9rem; font-weight: 700;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(189, 88, 123, .18); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn--primary, .btn--rose { background: var(--pink-deep); border-color: var(--pink-deep); color: #fff; }
.btn--heart::after { content: "♡"; font-size: 1.05rem; }

/* ---------- Header / footer ---------- */
.site-header {
  position: relative; z-index: 5;
  width: min(1120px, calc(100% - 36px)); margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 0 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.brand { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.brand span { color: var(--pink-deep); margin-right: 7px; }
.site-nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(12px, 3.6vw, 30px); font-size: .82rem; color: var(--muted); }
.site-nav a { display: block; padding: 6px 0; transition: color .2s; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--pink-deep); box-shadow: 0 1px 0 var(--pink); }
.site-footer { text-align: center; color: #bd9eaa; font-size: .74rem; letter-spacing: .05em; padding: 22px 16px calc(30px + env(safe-area-inset-bottom, 0px)); }

/* ---------- Floating fairy dust ---------- */
[data-petals], .petal-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.floating-dust[data-petals] { position: fixed; z-index: 0; }
.petal { position: absolute; top: -8%; font-size: var(--size, 14px); line-height: 1; color: var(--pink); opacity: .55; will-change: transform; }

/* ---------- Hero ---------- */
.hero-page { min-height: calc(100svh - 110px); display: grid; place-items: center; padding: 10px 16px 44px; }
.hero-card {
  width: min(560px, 100%); text-align: center; padding: 36px 22px 32px;
  border: 1px solid rgba(234, 177, 195, .45); border-radius: 34px;
  background: rgba(255, 255, 255, .78); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.arch-wrap { position: relative; width: 190px; height: 220px; margin: 22px auto 16px; padding: 7px; background: #fff; border-radius: 100px 100px 24px 24px; box-shadow: 0 10px 28px rgba(180, 98, 128, .18); rotate: -3deg; }
.arch { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; border-radius: 94px 94px 18px 18px; background: var(--blush); }
.sparkle { position: absolute; color: var(--pink-deep); font-size: 1.9rem; line-height: 1; }
.sparkle.one { right: -22px; top: 16px; }
.sparkle.two { left: -22px; bottom: 12px; color: var(--gold); }
.hero-card h1 { margin: 6px 0 14px; }
.hero-copy { max-width: 400px; margin: 0 auto 24px; color: var(--muted); line-height: 1.8; font-size: .96rem; }

/* ---------- Content pages ---------- */
.content-page { width: min(1000px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 26px; }
.page-heading { text-align: center; margin-bottom: 34px; }
.page-heading h1, .page-heading h2 { margin: 10px 0 12px; }
.center-note { text-align: center; padding: 34px 16px 44px; }
.center-note .tiny-flower { color: var(--pink); font-size: 1.8rem; display: block; }
.center-note h2 { max-width: 520px; margin: 6px auto 20px; }

/* ---------- Story chapters ---------- */
.chapter { display: grid; gap: 20px; padding: 26px 16px 22px; margin-bottom: 24px; border: 1px solid rgba(234, 177, 195, .45); border-radius: 28px; background: rgba(255, 255, 255, .8); box-shadow: var(--shadow); }
.chapter__num { display: block; font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--pink-deep); font-weight: 700; }
.chapter__date { display: block; font-family: var(--serif); font-style: italic; color: var(--muted); margin: 2px 0 8px; }
.chapter h2 { font-size: clamp(1.7rem, 7vw, 2.4rem); margin-bottom: 10px; }
.chapter p { color: #806672; }
.chapter__media { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chapter__item { background: #fff; padding: 8px; box-shadow: 0 12px 30px rgba(177, 99, 127, .15); }
.chapter__item img, .chapter__item video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--blush); }
.chapter__item:first-child { grid-column: 1 / -1; }
.chapter__item:first-child img, .chapter__item:first-child video { aspect-ratio: 4 / 3; }
.chapter__item:nth-child(odd) { rotate: -1.2deg; }
.chapter__item:nth-child(even) { rotate: 1.2deg; }
.chapter__item figcaption { font-family: var(--serif); font-style: italic; color: var(--muted); text-align: center; padding: 8px 4px 2px; font-size: .92rem; }

/* ---------- Nicknames ---------- */
.nicknames { display: grid; gap: 14px; margin-top: 26px; }
.nickname-card { padding: 22px 20px; border-radius: 24px; text-align: center; background: #fff; border: 1px solid rgba(234, 177, 195, .4); box-shadow: var(--shadow); }
.nickname-card::before { content: "✿"; display: block; color: var(--pink); font-size: 1.3rem; }
.nickname-card:nth-child(4n+1) { background: var(--blush); }
.nickname-card:nth-child(4n+2) { background: var(--lilac); }
.nickname-card:nth-child(4n+3) { background: var(--mint); }
.nickname-card h3 { font-size: 1.7rem; color: var(--pink-deep); margin-bottom: 4px; }
.nickname-card p { color: #806672; font-size: .95rem; }

/* ---------- Gallery (polaroids) ---------- */
.gallery { width: min(1000px, calc(100% - 28px)); margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 46vw; grid-auto-flow: dense; gap: 16px; padding: 6px 0 20px; }
.gallery__item { position: relative; display: flex; flex-direction: column; background: #fff; padding: 8px; box-shadow: 0 15px 38px rgba(177, 99, 127, .14); }
.gallery__item:nth-child(3n+1) { rotate: -1.4deg; }
.gallery__item:nth-child(3n+2) { rotate: 1.1deg; }
.gallery__item:nth-child(3n) { rotate: -.4deg; }
.gallery__item--large { grid-column: span 2; grid-row: span 2; }
.gallery__item--tall { grid-row: span 2; }
.gallery__item--wide { grid-column: span 2; }
.gallery__open { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; padding: 0; border: 0; background: var(--blush); overflow: hidden; }
.gallery__open img, .gallery__open video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.gallery__item figcaption { padding: 8px 4px 2px; text-align: center; font-family: var(--serif); font-style: italic; font-size: .9rem; color: var(--muted); }
.gallery__badge { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .6rem; color: var(--pink-deep); background: rgba(255, 255, 255, .9); pointer-events: none; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(58, 31, 43, .92); opacity: 0; transition: opacity .3s var(--ease); touch-action: pan-y; }
.lightbox.is-open { opacity: 1; }
.lightbox__stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 70px 10px 90px; }
.lightbox__media { max-width: 100%; max-height: 100%; object-fit: contain; border: 8px solid #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.lightbox__close, .lightbox__nav { position: absolute; z-index: 2; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .5); color: #fff; font-size: 1.8rem; line-height: 1; padding: 0 0 4px; }
.lightbox__close { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: 8px; }
.lightbox__nav--next { right: 8px; }
.lightbox__caption { position: absolute; left: 0; right: 0; bottom: calc(32px + env(safe-area-inset-bottom, 0px)); text-align: center; padding: 0 4.5rem; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--blush); }
.lightbox__count { position: absolute; left: 16px; top: calc(24px + env(safe-area-inset-top, 0px)); font-size: .72rem; letter-spacing: .2em; color: #fff; }

/* ---------- Fairy page ---------- */
.feature { display: grid; gap: 28px; align-items: center; padding: 26px 18px; border-radius: 30px; background: rgba(255, 255, 255, .8); border: 1px solid rgba(234, 177, 195, .45); box-shadow: var(--shadow); }
.feature__photo { width: min(300px, 82%); margin: 0 auto; padding: 8px; background: #fff; border-radius: 150px 150px 22px 22px; box-shadow: 0 14px 34px rgba(180, 98, 128, .2); rotate: 2deg; }
.feature__photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 142px 142px 16px 16px; background: var(--blush); }
.feature__text { text-align: center; }
.feature__text p { color: #806672; }
.line-art { width: 84px; height: auto; margin: 0 auto 12px; color: var(--pink-deep); display: block; }
.language-grid { display: grid; gap: 14px; margin-top: 22px; }
.meaning { padding: 22px 20px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.meaning:nth-child(4n+1) { background: var(--blush); }
.meaning:nth-child(4n+2) { background: var(--lilac); }
.meaning:nth-child(4n+3) { background: var(--mint); }
.meaning h3 { color: var(--pink-deep); margin-bottom: 4px; }
.meaning p { color: #806672; font-size: .95rem; }

/* ---------- Letter ---------- */
.letter-stage { min-height: calc(100svh - 110px); padding: 10px 16px 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; text-align: center; }
.envelope { --rise: 19rem; position: relative; width: min(88vw, 400px); aspect-ratio: 3 / 2; filter: drop-shadow(0 18px 22px rgba(183, 100, 129, .22)); transition: margin-top 1.1s var(--ease); cursor: pointer; }
.envelope.is-letter-out { margin-top: calc(var(--rise) - 2rem); }
.envelope__back, .envelope__front, .envelope__flap, .envelope__paper { position: absolute; }
.envelope__back { inset: 0; background: #f4b8cb; border-radius: 8px; z-index: 1; }
.envelope__front { inset: 0; z-index: 4; background: #f8cbd8; border-radius: 8px; clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%); }
.envelope__flap { inset: 0 0 auto 0; height: 58%; z-index: 6; background: #f3b3c8; clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; }
.envelope__seal { position: absolute; z-index: 7; left: 50%; top: 58%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: #c85f83; box-shadow: 0 3px 8px rgba(0, 0, 0, .25); display: grid; place-items: center; }
.envelope__seal::before { content: "♡"; color: #fff; font-size: 1.1rem; }
.envelope__paper { left: 5%; right: 5%; top: 8%; z-index: 3; min-height: 78%; padding: 26px 20px 28px; text-align: left; color: var(--ink); background: #fffdfb; border: 1px solid #f4dce4; border-radius: 6px; box-shadow: 0 6px 22px rgba(177, 99, 127, .2); }
.letter__greeting { font-family: var(--serif); font-size: 1.45rem; font-style: italic; color: var(--pink-deep); margin-bottom: 12px; }
.letter__para { font-size: .98rem; line-height: 1.85; color: #806672; margin-bottom: 10px; }
.letter__sign { font-family: var(--serif); font-style: italic; margin-top: 18px; color: var(--pink-deep); }
.letter__name { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); }
.letter-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 52px; }

/* ---------- Proposal: a dusk-lit fairy forest (dark, so the diamond shines) ---------- */
.proposal-page { background: var(--night); color: #fff3f6; }
.scene { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.3rem; padding: 3rem 1.5rem calc(3rem + env(safe-area-inset-bottom, 0px)); text-align: center; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, #7a3562 0%, var(--night) 55%, #24102a 100%); }
.spotlight { position: absolute; left: 50%; top: 38%; width: 140vmax; height: 140vmax; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(247, 217, 168, .26) 0%, rgba(233, 138, 168, .14) 18%, transparent 42%); pointer-events: none; }
.lights { position: absolute; inset: 0; pointer-events: none; }
.light { position: absolute; width: var(--s, 3px); height: var(--s, 3px); border-radius: 50%; background: #f7d9a8; box-shadow: 0 0 6px #f7d9a8; }
.scene .petal { color: #f7d9a8; }
.ring { position: relative; z-index: 3; width: min(58vw, 250px); aspect-ratio: 1; }
.ring img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain; }
.ring__glow { position: absolute; inset: -30%; border-radius: 50%; z-index: 1; background: radial-gradient(circle, rgba(247, 217, 168, .5), transparent 62%); }
.ring__sparkles { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.glint { position: absolute; width: var(--g, 16px); height: var(--g, 16px); margin: calc(var(--g, 16px) / -2) 0 0 calc(var(--g, 16px) / -2); background: #fff; clip-path: polygon(50% 0, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0 50%, 44% 44%); filter: drop-shadow(0 0 4px rgba(255, 255, 255, .9)); }
.glint--strong { filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 14px #f7d9a8); }
.proposal__question { position: relative; z-index: 3; font-size: clamp(2.1rem, 9.5vw, 3.8rem); color: #fff3f6; }
.proposal__subtitle { position: relative; z-index: 3; font-family: var(--serif); font-style: italic; font-size: clamp(1.1rem, 4.6vw, 1.5rem); color: #f6c9d8; max-width: 28rem; }
.proposal__actions { position: relative; z-index: 3; display: flex; flex-direction: column; gap: .9rem; width: min(100%, 320px); margin-top: .6rem; }
.proposal__actions .btn { width: 100%; }
.proposal-page .btn:not(.btn--rose):not(.btn--primary) { background: transparent; color: #fff3f6; border-color: rgba(255, 255, 255, .5); }
.panel { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6rem; padding: 2rem 1.75rem; text-align: center; background: rgba(36, 16, 42, .92); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.panel p:first-child { font-family: var(--serif); font-size: clamp(1.7rem, 7vw, 2.7rem); line-height: 1.25; max-width: 30rem; }
.panel__sign { font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: #f7d9a8; }
.confetti { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
