:root {
  --rose: #e8899b;
  --rose-deep: #c96a80;
  --blush: #fbe9ee;
  --cream: #fff8f4;
  --ink: #4a3840;
  --ink-soft: #7d6870;
  --gold: #d9a86c;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(201, 106, 128, 0.18);
  --radius: 22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans KR", "Gowun Batang", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #ffe6ee 0%, transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, #fff1e6 0%, transparent 55%),
    linear-gradient(180deg, var(--cream) 0%, var(--blush) 100%);
  background-attachment: fixed;
  line-height: 1.75;
  overflow-x: hidden;
}

/* ---------- 떠다니는 하트 ---------- */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.petal {
  position: absolute;
  top: -8vh;
  font-size: 1.2rem;
  opacity: 0;
  animation: fall linear infinite;
  will-change: transform, opacity;
}
@keyframes fall {
  0%   { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.7; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6vh 1.5rem;
}
.hero-inner { max-width: 720px; }
.hero-eyebrow {
  font-family: "Playfair Display", serif;
  font-style: italic;
  letter-spacing: 0.08em;
  color: var(--rose-deep);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  margin-bottom: 1.2rem;
}
.hero-title {
  font-family: "Gowun Batang", serif;
  font-weight: 700;
  font-size: clamp(3rem, 11vw, 6rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 24px rgba(201, 106, 128, 0.15);
}
.accent {
  background: linear-gradient(120deg, var(--rose-deep), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin-top: 1.4rem;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  font-weight: 300;
}

.counter {
  margin-top: 3rem;
  display: flex;
  gap: clamp(0.6rem, 3vw, 1.4rem);
  justify-content: center;
  flex-wrap: wrap;
}
.counter-box {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(232, 137, 155, 0.25);
  border-radius: 18px;
  padding: 1.1rem 1.5rem;
  min-width: 110px;
  box-shadow: var(--shadow);
}
.counter-num {
  display: block;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--rose-deep);
  font-variant-numeric: tabular-nums;
}
.counter-label {
  font-size: 0.8rem;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}
.hero-milestone {
  margin-top: 1.8rem;
  display: inline-block;
  padding: 0.5rem 1.3rem;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(232, 137, 155, 0.16), rgba(217, 168, 108, 0.16));
  border: 1px solid rgba(201, 106, 128, 0.3);
  color: var(--rose-deep);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-size: clamp(0.9rem, 2.4vw, 1.05rem);
  box-shadow: 0 8px 24px rgba(201, 106, 128, 0.12);
}
.hero-date {
  margin-top: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.scroll-hint {
  position: absolute;
  bottom: 3vh;
  left: 50%;
  transform: translateX(-50%);
}
.scroll-hint span {
  display: block;
  width: 24px;
  height: 40px;
  border: 2px solid var(--rose);
  border-radius: 14px;
  position: relative;
}
.scroll-hint span::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: var(--rose-deep);
  border-radius: 50%;
  animation: scrolldot 1.6s ease-in-out infinite;
}
@keyframes scrolldot {
  0% { top: 7px; opacity: 1; }
  100% { top: 24px; opacity: 0; }
}

/* ---------- 공통 섹션 ---------- */
.section {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 7rem) 1.5rem;
}
.section-title {
  font-family: "Gowun Batang", serif;
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  text-align: center;
  color: var(--ink);
}
.section-title::after {
  content: "";
  display: block;
  width: 54px;
  height: 3px;
  margin: 1rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--rose), var(--gold));
}
.section-lead {
  text-align: center;
  color: var(--ink-soft);
  margin-top: 1rem;
  font-weight: 300;
}
.section-lead code {
  background: rgba(232, 137, 155, 0.15);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  font-size: 0.85em;
}

/* ---------- 타임라인 ---------- */
.timeline {
  margin-top: 3.5rem;
  position: relative;
  padding-left: 1rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--rose), var(--gold));
}
.tl-item {
  position: relative;
  padding: 0 0 2.4rem 2.2rem;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 4px;
  width: 16px;
  height: 16px;
  background: var(--white);
  border: 3px solid var(--rose-deep);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--blush);
}
.tl-date {
  font-family: "Playfair Display", serif;
  color: var(--rose-deep);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}
.tl-title { font-weight: 700; margin-top: 0.2rem; }
.tl-desc { color: var(--ink-soft); font-weight: 300; }

/* ---------- 갤러리 ---------- */
.gallery-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.g-item {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #ffe0e9, #ffe9d6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.g-item:hover { transform: translateY(-6px) scale(1.02); }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-item .g-placeholder {
  font-size: 2.4rem;
  opacity: 0.55;
}

/* ---------- 편지 ---------- */
.letter { max-width: 820px; }
.letter-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(232, 137, 155, 0.25);
  border-radius: var(--radius);
  padding: clamp(2rem, 6vw, 3.5rem);
  box-shadow: var(--shadow);
  text-align: center;
}
.letter-body {
  margin-top: 1.6rem;
  font-family: "Gowun Batang", serif;
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  color: var(--ink);
  white-space: pre-line;
  line-height: 2.1;
}
.letter-sign {
  margin-top: 2rem;
  font-family: "Playfair Display", serif;
  font-style: italic;
  color: var(--rose-deep);
}

/* ---------- 이유 리스트 ---------- */
.reasons-list {
  margin-top: 3rem;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.reasons-list li {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(232, 137, 155, 0.22);
  border-radius: 16px;
  padding: 1.3rem 1.5rem;
  box-shadow: 0 10px 30px rgba(201, 106, 128, 0.1);
  position: relative;
  padding-left: 2.8rem;
  font-weight: 300;
}
.reasons-list li::before {
  content: "💗";
  position: absolute;
  left: 1rem;
  top: 1.2rem;
}

/* ---------- 이벤트별 사진 퍼레이드 ---------- */
.events { position: relative; z-index: 1; }
.event {
  padding: clamp(3rem, 8vw, 5rem) 0;
}
.event-head {
  max-width: 720px;
  margin: 0 auto clamp(1.6rem, 4vw, 2.4rem);
  padding: 0 1.5rem;
  text-align: center;
}
.event-date {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--rose-deep);
  font-size: 0.95rem;
}
.event-title {
  font-family: "Gowun Batang", serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  margin-top: 0.35rem;
  color: var(--ink);
}
.event-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 0.9rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--rose), var(--gold));
}
.event-desc {
  margin-top: 1rem;
  color: var(--ink-soft);
  font-weight: 300;
}

.parade {
  position: relative;
  overflow: hidden;
  padding: 0.5rem 0;
  /* 양 끝을 부드럽게 페이드 */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.parade-track {
  display: flex;
  gap: 1.1rem;
  width: max-content;
  padding: 0 0.55rem;
  animation: marquee 40s linear infinite;
  will-change: transform;
}
.parade.reverse .parade-track { animation-direction: reverse; }
.parade:hover .parade-track,
.parade.touched .parade-track { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.p-item {
  flex: 0 0 auto;
  width: clamp(180px, 46vw, 250px);
  height: clamp(240px, 60vw, 330px);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #ffe0e9, #ffe9d6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s ease;
}
.p-item:hover { transform: translateY(-6px) scale(1.02); }
.p-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-holder { font-size: 2.6rem; opacity: 0.55; }

/* ---------- 푸터 ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 1.5rem 5rem;
  color: var(--ink-soft);
}
.footer-heart { font-size: 2rem; animation: beat 1.6s ease-in-out infinite; }
@keyframes beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.25); }
  30% { transform: scale(1); }
  45% { transform: scale(1.18); }
}
.footer-small { margin-top: 0.6rem; font-size: 0.8rem; opacity: 0.7; letter-spacing: 0.05em; }

/* ---------- 스크롤 등장 애니메이션 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- PWA 설치 버튼 / iOS 안내 ---------- */
.install-btn {
  position: fixed;
  z-index: 50;
  right: 1.2rem;
  bottom: 1.4rem;
  padding: 0.85rem 1.4rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--rose-deep), var(--gold));
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(201, 106, 128, 0.4);
  animation: beat 2.4s ease-in-out infinite;
}
.install-btn:hover { filter: brightness(1.05); }
.install-btn[hidden] { display: none; }

.ios-hint {
  position: fixed;
  z-index: 50;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(232, 137, 155, 0.3);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.92rem;
}
.ios-hint[hidden] { display: none; }
.ios-hint b { color: var(--rose-deep); }
.ios-hint button {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1rem;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .petal, .footer-heart, .scroll-hint span::after, .install-btn { animation: none; }
}
