:root {
  --bg: #fff7fb;
  --bg-alt: #f8efff;
  --text: #251c2f;
  --muted: #756b82;
  --primary: #ff5fa2;
  --primary-dark: #e14f8d;
  --accent: #8a5cff;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(22, 10, 46, 0.12);
  --ring: rgba(138, 92, 255, 0.25);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Noto Sans, Apple SD Gothic Neo, "Malgun Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
}

.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  text-align: center;
  padding: 80px 0 40px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -10% -10% auto -10%; height: 280px;
  background: radial-gradient(closest-side, rgba(255,95,162,0.25), rgba(255,95,162,0));
  transform: translateY(-20px) rotate(-4deg);
  pointer-events: none;
}
.hero h1 { margin: 0 0 8px; font-size: 32px; line-height: 1.25; background: linear-gradient(90deg, #2a2233, #5b4f71); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .emoji {
  display: inline;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  color: initial !important;
  -webkit-text-fill-color: initial !important;
}
.subtitle { color: var(--muted); margin: 0 0 20px; }
.chip { display: inline-block; margin-bottom: 18px; padding: 6px 12px; border-radius: 999px; background: rgba(138,92,255,0.12); color: #5d3aff; font-weight: 600; font-size: 12px; letter-spacing: .02em; }

.cta-row { display: grid; column-gap: 8px; row-gap: 8px; grid-template-columns: repeat(2, auto); justify-content: center; align-items: center; max-width: 440px; margin: 0 auto; }
@media (min-width: 640px) {
  .cta-row { grid-template-columns: repeat(4, auto); max-width: 840px; }
}
/* make buttons size to content, not stretch */
.cta-row .btn { width: auto; display: inline-flex; align-items: center; justify-content: center; }

.btn {
  appearance: none;
  border: 1px solid rgba(0,0,0,0.06);
  background: linear-gradient(180deg, #ffffff, #f8f6ff);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .08s ease, background .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 34px rgba(22,10,46,0.14); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border: none; }
.btn.outline { background: rgba(255,255,255,0.6); border-color: rgba(255,95,162,0.5); color: var(--primary); backdrop-filter: saturate(1.1) blur(6px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 6px var(--ring); }

/* Improve long-press UX on touch/force devices */
#secret-button {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.section { padding: 40px 0; }
.section.alt { background: transparent; }
/* subtle separators instead of background bands */
.section + .section { border-top: 1px solid rgba(22,10,46,0.06); }
.section:last-of-type { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.section h2 { margin: 0 0 10px; font-size: 22px; }
.section-desc { color: var(--muted); margin: 0 0 20px; }

.grid.photos {
  display: grid;
  grid-template-columns: repeat( auto-fit, minmax(220px, 1fr) );
  gap: 16px;
}
.photo { margin: 0; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgba(138,92,255,0.18); transition: transform .2s ease, box-shadow .3s ease; }
.photo:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(22,10,46,0.16); }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; background: none; }
.photo figcaption { padding: 8px 10px; font-size: 13px; color: var(--muted); background: #fff; border-top: 1px solid rgba(138,92,255,0.12); }

/* Carousel */
.carousel { position: relative; width: 100%; max-width: 500px; margin: 0 auto; }
.carousel-viewport { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; border: 1px solid rgba(138,92,255,0.18); }
.carousel-track { display: flex; will-change: transform; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.carousel-slide { min-width: 100%; margin: 0; position: relative; }
.carousel-slide img { display: block; width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.carousel-slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px 16px; font-size: 18px; line-height: 1.4; font-weight: 700; color: #fff;
  text-align: right;
  text-shadow: 0 3px 10px rgba(0,0,0,0.6);
  pointer-events: none; z-index: 1;
}
.carousel-slide figcaption::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; top: -24px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.32) 45%, rgba(0,0,0,0.7) 100%);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  z-index: -1;
}
.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.1); background: rgba(255,255,255,0.85); backdrop-filter: blur(6px); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; color: var(--text); }
.carousel-nav.prev { left: 8px; }
.carousel-nav.next { right: 8px; }
.carousel-dots { display: flex; gap: 4px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.carousel-dots button {
  width: 6px; height: 6px;
  border-radius: 50%; border: none;
  background: rgba(138,92,255,0.28);
  cursor: default; padding: 0; line-height: 0;
  display: inline-block; aspect-ratio: 1 / 1;
  -webkit-appearance: none; appearance: none;
}
.carousel-dots button[aria-selected="true"] { background: var(--accent); }
.carousel-counter { position: absolute; right: 10px; top: 10px; font-size: 12px; color: #fff; background: rgba(0,0,0,0.35); padding: 4px 8px; border-radius: 999px; backdrop-filter: blur(4px); }

/* Secret letter */
.secret-letter { margin-top: 16px; }
.typewriter {
  display: inline-block;
  overflow: hidden;
  white-space: pre-wrap;
  border-right: 2px solid rgba(0,0,0,0.2);
  animation: caret 0.8s step-end infinite;
}
/* tighter lines for secret letter */
.secret-letter .typewriter { line-height: 1; }
@keyframes caret { 50% { border-color: transparent; } }

/* Gift card flip */
.gift-wrap { display: grid; place-items: center; }
.gift-card {
  width: min(100%, 400px);
  height: min(64vh, 480px);
  perspective: 1200px;
  cursor: pointer;
  transition: transform .2s ease;
}
.gift-card .face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.35));
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 10px 30px rgba(22,10,46,0.12);
  display: grid;
  place-items: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform .7s cubic-bezier(.2,.7,.2,1);
}
.gift-card .front .title { font-weight: 700; font-size: 22px; }
.gift-card .front .hint { color: var(--muted); font-size: 13px; margin-top: 0; }
.bow { position: absolute; top: 14px; left: 14px; font-size: 22px; }
.gift-card .back { transform: rotateY(180deg); padding: 24px 20px; text-align: center; }
.gift-card.flipped .front { transform: rotateY(180deg); }
.gift-card.flipped .back { transform: rotateY(360deg); }
.gift .small { color: var(--muted); }
.gift .product { width: 68%; max-width: 360px; height: auto; border-radius: 12px; box-shadow: 0 8px 24px rgba(22,10,46,0.12); margin: 0 auto 24px; display: block; }
.gift { max-height: 100%; overflow: auto; -webkit-overflow-scrolling: touch; line-height: 1; }
/* keep gift compact; rely on default list spacing */
.gift-card:hover { transform: translateY(-3px); }

.footer { text-align: center; color: var(--muted); padding: 32px 0 40px; }

/* Canvas full-screen effects */
#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Small helpers */
[hidden] { display: none !important; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (min-width: 720px) {
  .hero h1 { font-size: 38px; }
}

@media (max-width: 390px) { .hero { padding: 64px 0 32px; } .gift-card { height: min(66vh, 440px); } }
