/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { max-width: 100%; height: auto; display: block; }

:root {
  --bg: #FBF7F2;
  --bg-soft: #F4EEE5;
  --bg-card: #FFFDFA;
  --ink: #4A3F35;
  --ink-soft: #7A6C5E;
  --ink-mute: #A99A88;
  --accent: #C9A57B;
  --accent-deep: #A9835A;
  --line: #E4D9C9;
  --line-soft: #EFE6D7;
  --shadow: 0 10px 30px rgba(74, 63, 53, 0.08);
  --shadow-lg: 0 20px 50px rgba(74, 63, 53, 0.14);
  --font-serif: "Noto Serif KR", "Nanum Myeongjo", "Georgia", serif;
  --font-latin: "Cormorant Garamond", "Noto Serif KR", serif;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Layout ---------- */
.invite {
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 40px rgba(74, 63, 53, 0.06);
  position: relative;
  overflow: hidden;
}

section {
  padding: 88px 28px;
  position: relative;
}
section + section { border-top: 1px solid var(--line-soft); }

.section-eyebrow {
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin: 0 0 10px;
  font-weight: 400;
}
.section-title {
  text-align: center;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin: 0 0 22px;
  color: var(--ink);
}
.rule {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 0 auto 40px;
  opacity: 0.7;
}

/* ---------- Hero ---------- */
.hero {
  padding: 0;
  border-top: none !important;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  color: #fff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(1200px 600px at 30% 20%, rgba(255,236,214,0.55), transparent 60%),
    radial-gradient(900px 500px at 70% 80%, rgba(201,165,123,0.35), transparent 60%),
    linear-gradient(180deg, #d9c7ae 0%, #b18e6a 55%, #6d5540 100%);
  filter: saturate(1.05);
}
.hero-bg::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(2px 2px at 12% 30%, rgba(255,255,255,0.5), transparent 50%),
    radial-gradient(1.5px 1.5px at 82% 22%, rgba(255,255,255,0.4), transparent 50%),
    radial-gradient(2px 2px at 60% 78%, rgba(255,255,255,0.45), transparent 50%),
    radial-gradient(1.5px 1.5px at 25% 82%, rgba(255,255,255,0.35), transparent 50%);
  opacity: 0.6;
  animation: sparkle 8s ease-in-out infinite alternate;
}
@keyframes sparkle {
  from { opacity: 0.35; transform: translateY(0); }
  to { opacity: 0.75; transform: translateY(-6px); }
}
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(74,63,53,0.15) 0%, rgba(74,63,53,0.05) 40%, rgba(74,63,53,0.35) 100%);
}

.hero-inner {
  text-align: center;
  padding: 40px 24px;
  animation: heroIn 1.4s ease both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-eyebrow {
  font-family: var(--font-latin);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.9;
  margin: 0;
}
.hero-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin: 22px auto 26px;
}
.hero-divider span {
  display: block; width: 46px; height: 1px; background: rgba(255,255,255,0.7);
}
.hero-divider .dot {
  width: 6px; height: 6px; background: #fff; border-radius: 50%;
}
.hero-title {
  margin: 0 0 34px;
  font-weight: 400;
  font-size: 44px;
  letter-spacing: 0.06em;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 2px 20px rgba(74,63,53,0.25);
}
.hero-title .name { display: block; }
.hero-title .amp {
  display: block;
  font-family: var(--font-latin);
  font-style: italic;
  font-weight: 300;
  font-size: 34px;
  color: #f5e2c8;
  margin: 6px 0;
}
.hero-date {
  margin: 0 0 6px;
  font-size: 16px;
  letter-spacing: 0.1em;
  opacity: 0.95;
}
.hero-venue {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.1em;
  opacity: 0.9;
}

.hero-scroll {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.85);
}
.scroll-text {
  font-family: var(--font-latin);
  letter-spacing: 0.4em;
  font-size: 11px;
}
.scroll-line {
  width: 1px; height: 40px; background: rgba(255,255,255,0.7);
  animation: scrollHint 2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes scrollHint {
  0% { transform: scaleY(0.2); opacity: 0.3; }
  50% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0.2); opacity: 0.3; }
}

/* ---------- Greeting ---------- */
.greeting { text-align: center; }
.greeting-body {
  font-size: 15.5px;
  color: var(--ink-soft);
  line-height: 2.0;
  margin: 0 auto 32px;
  max-width: 380px;
}
.greeting-parents {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 2.1;
  margin: 0;
}
.greeting-parents span { color: var(--ink); font-weight: 500; }
.greeting-parents b { color: var(--accent-deep); font-weight: 600; margin-left: 4px; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-soft);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}
.gallery-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.gallery-item .ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.gallery-item .ph::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.0) 55%, rgba(74,63,53,0.15) 100%);
}
.gallery-item .ph svg {
  width: 42px; height: 42px; opacity: 0.55; position: relative; z-index: 1;
}

/* six unique warm-toned gradient placeholders */
.g1 { background: linear-gradient(135deg, #efd9be 0%, #c9a57b 100%); }
.g2 { background: linear-gradient(135deg, #f6e7d1 0%, #b48f6e 100%); }
.g3 { background: linear-gradient(135deg, #e8d3b6 0%, #8a6a4f 100%); }
.g4 { background: linear-gradient(135deg, #f1dfc3 0%, #a98461 100%); }
.g5 { background: linear-gradient(135deg, #ecd6ba 0%, #96755a 100%); }
.g6 { background: linear-gradient(135deg, #f4e4cc 0%, #bc9670 100%); }

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 400px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 6px; bottom: 6px;
  left: 78px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line), transparent);
}
.tl-item {
  display: grid;
  grid-template-columns: 68px 20px 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 14px 0;
  position: relative;
}
.tl-time {
  font-family: var(--font-latin);
  font-size: 20px;
  color: var(--accent-deep);
  text-align: right;
  letter-spacing: 0.04em;
  padding-top: 2px;
}
.tl-marker {
  position: relative;
  height: 100%;
}
.tl-marker::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 9px; height: 9px;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  z-index: 1;
}
.tl-title {
  font-size: 15.5px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.tl-title small {
  display: block;
  font-size: 12.5px;
  color: var(--ink-mute);
  margin-top: 2px;
  letter-spacing: 0;
}

/* ---------- Location ---------- */
.map-card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.map-image {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(180deg, #f5ecdc 0%, #e6d6bc 100%);
  position: relative;
  overflow: hidden;
}
/* fake map grid */
.map-image::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(169,131,90,0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169,131,90,0.14) 1px, transparent 1px);
  background-size: 32px 32px;
}
/* fake road */
.map-image::after {
  content: "";
  position: absolute;
  top: 40%; left: -10%; right: -10%;
  height: 22px;
  background: linear-gradient(180deg, #f9f1e3 0%, #e9d6b8 100%);
  transform: rotate(-6deg);
  border-top: 1px solid #d7bf9f;
  border-bottom: 1px solid #d7bf9f;
}
.map-pin {
  position: absolute;
  left: 50%; top: 44%;
  transform: translate(-50%, -100%);
  z-index: 2;
  color: var(--accent-deep);
  filter: drop-shadow(0 4px 6px rgba(74,63,53,0.25));
}
.map-pin svg { width: 34px; height: 34px; }
.map-body { padding: 20px 22px 22px; text-align: center; }
.venue-name {
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 6px;
  letter-spacing: 0.04em;
}
.venue-addr { margin: 0 0 4px; color: var(--ink-soft); font-size: 14.5px; }
.venue-tel { margin: 0; color: var(--ink-mute); font-size: 13.5px; font-family: var(--font-latin); letter-spacing: 0.08em; }

.info-blocks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.info-block {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
}
.info-block h4 {
  margin: 0 0 8px;
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-latin);
}
.info-block p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.85;
}

/* ---------- Guestbook ---------- */
.guestbook-lead {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: -12px 0 28px;
}

.gb-form {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}
.field { display: grid; gap: 6px; }
.field label {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-family: var(--font-latin);
  font-weight: 500;
}
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 15px;
  padding: 12px 14px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { min-height: 96px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,165,123,0.18);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-mute); }

.gb-submit {
  appearance: none;
  border: none;
  cursor: pointer;
  background: var(--ink);
  color: #FBF7F2;
  padding: 14px 18px;
  border-radius: 10px;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.16em;
  transition: background 0.2s ease, transform 0.1s ease;
}
.gb-submit:hover { background: var(--accent-deep); }
.gb-submit:active { transform: translateY(1px); }
.gb-submit[disabled] { opacity: 0.6; cursor: not-allowed; }

.gb-list-header {
  margin: 28px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-mute);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-align: right;
  font-family: var(--font-latin);
}

.gb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.gb-item {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 16px 18px;
  position: relative;
  animation: gbIn 0.5s ease both;
}
@keyframes gbIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.gb-item .top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.gb-item .name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.gb-item .name::before {
  content: "";
  display: inline-block;
  width: 14px; height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 8px;
  opacity: 0.7;
}
.gb-item .time {
  font-size: 12px;
  color: var(--ink-mute);
  font-family: var(--font-latin);
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}
.gb-item .msg {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}

.gb-empty {
  text-align: center;
  color: var(--ink-mute);
  padding: 32px 12px;
  font-size: 14.5px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--bg-card);
}

/* ---------- Footer ---------- */
.foot {
  text-align: center;
  padding: 70px 28px 90px;
  background: var(--bg-soft);
}
.foot-divider {
  width: 1px; height: 44px;
  background: var(--accent);
  margin: 0 auto 26px;
  opacity: 0.5;
}
.foot-thanks {
  font-family: var(--font-latin);
  font-style: italic;
  color: var(--accent-deep);
  font-size: 30px;
  margin: 0 0 12px;
  letter-spacing: 0.06em;
}
.foot-line {
  margin: 0 0 26px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 2;
}
.foot-copy {
  margin: 0;
  color: var(--ink-mute);
  font-size: 12px;
  letter-spacing: 0.2em;
  font-family: var(--font-latin);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 40px);
  background: var(--ink);
  color: #FBF7F2;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 999;
  max-width: 90%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.error { background: #7a3b2d; }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.hero.reveal { opacity: 1; transform: none; } /* hero always visible on load */

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-inner { animation: none; }
  .scroll-line { animation: none; }
  .hero-bg::before { animation: none; }
}

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
  section { padding: 72px 22px; }
  .hero-title { font-size: 38px; }
  .section-title { font-size: 23px; }
  .timeline::before { left: 68px; }
  .tl-item { grid-template-columns: 58px 18px 1fr; }
  .tl-time { font-size: 18px; }
}
