/* ============================================================
   WEDDING INVITATION — DESIGN SYSTEM
   Palette:  ink #1B2420 · forest #24352A · ivory #F7F2E7
             gold #B08D4F · plum #7C5B68
   Type:     Display  — 'Cormorant Garamond'
             Body     — 'Jost'
   ============================================================ */

:root {
  --ink: #1b2420;
  --forest: #24352a;
  --forest-deep: #17231b;
  --ivory: #f7f2e7;
  --ivory-soft: #efe7d6;
  --gold: #b08d4f;
  --gold-soft: #d8c191;
  --plum: #7c5b68;
  --line: rgba(27, 36, 32, 0.14);

  --display: 'Cormorant Garamond', serif;
  --body: 'Jost', sans-serif;

  --gap: clamp(1.5rem, 4vw, 2.5rem);
  --radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--body);
  background: var(--ivory);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Gate (tap to open) ---------- */
#gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--forest-deep);
  color: var(--ivory);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}
#gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#gate .gate-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--gold-soft);
  margin-bottom: 0.75rem;
}
#gate .gate-names {
  font-family: var(--display);
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}
#gate .gate-guest {
  font-size: 0.95rem;
  color: rgba(247, 242, 231, 0.7);
  margin-bottom: 2.25rem;
}
#gate-open {
  border: 1px solid var(--gold-soft);
  color: var(--ivory);
  padding: 0.85rem 2.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  transition: background 0.3s ease, color 0.3s ease;
}
#gate-open:hover { background: var(--gold-soft); color: var(--forest-deep); }

/* ---------- Shell ---------- */
.invite {
  max-width: 560px;
  margin: 0 auto;
  background: var(--ivory);
  position: relative;
}

section {
  padding: 5rem 1.75rem;
  position: relative;
}

.section-inner {
  max-width: 440px;
  margin: 0 auto;
}

.center { text-align: center; }

.divider {
  width: 46px;
  height: 1px;
  background: var(--gold);
  margin: 1.75rem auto;
  opacity: 0.7;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 2.5rem);
  font-weight: 500;
  color: var(--forest);
  margin: 0 0 0.4rem;
}

.section-kicker {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--plum);
  margin: 0 0 0.3rem;
}

.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Cover ---------- */
#cover {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, var(--forest-deep) 0%, var(--forest) 100%);
  color: var(--ivory);
  padding: 3rem 2rem;
  overflow: hidden;
}
#cover .frame-svg {
  position: absolute;
  inset: 1.1rem;
  width: calc(100% - 2.2rem);
  height: calc(100% - 2.2rem);
  pointer-events: none;
}
#cover .frame-svg path {
  fill: none;
  stroke: var(--gold-soft);
  stroke-width: 1;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: draw 2.6s ease forwards 0.3s;
  opacity: 0.55;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.cover-content { position: relative; z-index: 2; }

.cover-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--gold-soft);
  margin-bottom: 1.4rem;
}

.cover-names {
  font-family: var(--display);
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  line-height: 1.12;
  font-weight: 500;
  margin: 0;
}
.cover-amp {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--gold-soft);
  margin: 0.35rem 0;
}

.cover-date {
  margin-top: 2rem;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: rgba(247, 242, 231, 0.85);
}

.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(247, 242, 231, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.scroll-cue span:last-child {
  width: 1px;
  height: 26px;
  background: rgba(247, 242, 231, 0.5);
  animation: pulse-line 1.8s ease-in-out infinite;
}
@keyframes pulse-line {
  0%, 100% { transform: scaleY(0.6); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ---------- Couple ---------- */
#couple { background: var(--ivory); }

.couple-quote {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--forest);
  max-width: 380px;
  margin: 0 auto 3rem;
}

.person {
  margin-bottom: 2.5rem;
}
.person:last-child { margin-bottom: 0; }

.person-photo {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.25rem;
  border: 1px solid var(--gold);
  padding: 6px;
}

.person-name {
  font-family: var(--display);
  font-size: 1.7rem;
  color: var(--forest);
  margin: 0 0 0.35rem;
}

.person-meta {
  font-size: 0.85rem;
  color: var(--ink);
  opacity: 0.65;
  line-height: 1.6;
}

.couple-and {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--gold);
  margin: 0.5rem 0 2rem;
}

/* ---------- Countdown ---------- */
#countdown {
  background: var(--forest);
  color: var(--ivory);
}
#countdown .section-title,
#countdown .section-kicker { color: var(--ivory); }
#countdown .section-kicker { color: var(--gold-soft); }

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-top: 2.25rem;
}

.countdown-cell {
  border: 1px solid rgba(247, 242, 231, 0.25);
  padding: 1.1rem 0.25rem;
  border-radius: var(--radius);
}

.countdown-num {
  font-family: var(--display);
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  font-weight: 600;
  color: var(--gold-soft);
  line-height: 1;
}

.countdown-label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(247, 242, 231, 0.7);
  margin-top: 0.5rem;
}

/* ---------- Event details ---------- */
#event { background: var(--ivory); }

.event-card {
  border: 1px solid var(--line);
  padding: 2rem 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  background: #fffdf8;
}
.event-card:last-child { margin-bottom: 0; }

.event-card-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--plum);
  margin-bottom: 0.6rem;
}

.event-card-main {
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--forest);
  margin: 0 0 0.3rem;
}

.event-card-sub {
  font-size: 0.88rem;
  color: var(--ink);
  opacity: 0.7;
  margin-bottom: 1.1rem;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--gold);
  color: var(--forest);
  padding: 0.65rem 1.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  border-radius: 999px;
  transition: background 0.25s ease, color 0.25s ease;
}
.pill-btn:hover { background: var(--forest); color: var(--ivory); border-color: var(--forest); }

/* ---------- Map ---------- */
#map-section { background: var(--ivory-soft); }

.map-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  margin-bottom: 1.25rem;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* ---------- RSVP ---------- */
#rsvp { background: var(--ivory); }

.form-field { margin-bottom: 1.35rem; text-align: left; }

.form-field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--forest);
  margin-bottom: 0.5rem;
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  background: #fffdf8;
  font-family: var(--body);
  font-size: 0.95rem;
  color: var(--ink);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.attend-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.attend-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.attend-toggle label {
  border: 1px solid var(--line);
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
}
.attend-toggle input:checked + label {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--ivory);
}

.submit-btn {
  width: 100%;
  padding: 0.95rem;
  background: var(--forest);
  color: var(--ivory);
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  border-radius: var(--radius);
  margin-top: 0.5rem;
  transition: background 0.25s ease;
}
.submit-btn:hover { background: var(--forest-deep); }
.submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.form-note {
  font-size: 0.78rem;
  text-align: center;
  margin-top: 1rem;
  min-height: 1.2em;
}
.form-note.ok { color: #3c6b4a; }
.form-note.err { color: #a5453f; }

/* ---------- Wishes ---------- */
#wishes { background: var(--ivory-soft); }

.wishes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.wish-card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  padding: 1.1rem 1.25rem;
  text-align: left;
  border-radius: var(--radius);
}

.wish-name {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--forest);
  margin-bottom: 0.3rem;
}
.wish-status {
  font-size: 0.68rem;
  color: var(--plum);
  letter-spacing: 0.03em;
  margin-left: 0.5rem;
  font-family: var(--body);
}
.wish-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
  opacity: 0.85;
}

.wishes-empty {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.55;
  padding: 2rem 0;
}

.refresh-note {
  text-align: center;
  font-size: 0.72rem;
  opacity: 0.5;
  margin-top: 0.9rem;
}

/* ---------- Gift ---------- */
#gift { background: var(--ivory); }

.gift-card {
  border: 1px solid var(--line);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: #fffdf8;
}
.gift-card-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--plum);
  margin-bottom: 0.6rem;
}
.gift-card-value {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--forest);
  word-break: break-word;
}
.gift-card-sub {
  font-size: 0.82rem;
  opacity: 0.65;
  margin-top: 0.3rem;
}
.copy-btn {
  margin-top: 0.85rem;
  font-size: 0.75rem;
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 1px;
}

/* ---------- Closing ---------- */
#closing {
  background: var(--forest-deep);
  color: var(--ivory);
  text-align: center;
  padding: 6rem 1.75rem 4rem;
}
#closing .section-kicker { color: var(--gold-soft); }
.closing-names {
  font-family: var(--display);
  font-size: clamp(2rem, 8vw, 2.6rem);
  margin: 0.5rem 0 1.5rem;
}
.closing-note {
  font-size: 0.88rem;
  line-height: 1.7;
  color: rgba(247, 242, 231, 0.8);
  max-width: 340px;
  margin: 0 auto;
}
.closing-foot {
  margin-top: 3rem;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: rgba(247, 242, 231, 0.4);
}

/* ---------- Music toggle ---------- */
#music-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 40;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#music-toggle.hidden-btn { opacity: 0; transform: scale(0.8); pointer-events: none; }
#music-toggle svg { width: 20px; height: 20px; }
.disc {
  animation: spin 5s linear infinite;
  animation-play-state: paused;
}
.disc.spinning { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 620px) {
  .invite { box-shadow: 0 0 60px rgba(0,0,0,0.08); }
}
