/* ─────────────────────────────────────────────────────────────────────
   Cyrill turns Thirty — design system
   Warm espresso-brown + gold, Cormorant Garamond + Hanken Grotesk.
   The base of this file is the approved design prototype, reproduced
   verbatim; the marked block at the end adds styles for the new
   named-plus-one inputs and form messaging.
   ───────────────────────────────────────────────────────────────────── */
:root {
  --bg:        #15110b;
  --bg-2:      #1c1710;
  --panel:     #211a11;
  --line:      rgba(201,162,75,0.22);
  --line-soft: rgba(244,235,218,0.08);
  --cream:     #f3ebda;
  --cream-dim: #d8cdb6;
  --muted:     #a2937a;
  --gold:      #c9a24b;
  --gold-lt:   #e3c577;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Hanken Grotesk', -apple-system, system-ui, sans-serif;
  --maxw: 760px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* warm vignette + faint grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(201,162,75,0.10), transparent 55%),
    radial-gradient(100% 60% at 50% 110%, rgba(201,162,75,0.06), transparent 60%);
  pointer-events: none; z-index: 0;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.035; pointer-events: none; z-index: 1; mix-blend-mode: screen;
}

#root { position: relative; z-index: 2; }

/* shared bits */
.eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
}
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

.rule {
  width: 1px; height: 64px;
  background: linear-gradient(var(--gold), transparent);
  margin: 0 auto;
}
.rule.up { background: linear-gradient(transparent, var(--gold)); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── Section scaffolding ── */
.section { padding: 96px 0; position: relative; }
.center { text-align: center; }
.serif-h {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 5.2vw, 3.3rem);
  line-height: 1.08;
  text-align: center;
  color: var(--cream);
  margin: 14px 0 0;
  letter-spacing: 0.005em;
}
.eyebrow.center { display: block; text-align: center; }

/* ── Hero ── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 84px 0 64px;
  position: relative;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-title {
  font-family: var(--serif);
  color: var(--cream);
  margin: 22px 0 0;
  line-height: 0.92;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ht-line { font-weight: 600; font-size: clamp(3.4rem, 13vw, 7rem); letter-spacing: 0.01em; }
.ht-amp {
  font-style: italic; font-weight: 400;
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--muted);
  margin: 6px 0;
  letter-spacing: 0.02em;
}
.ht-thirty { color: var(--gold); }

.portrait-frame {
  position: relative;
  margin: 40px 0 8px;
  width: clamp(220px, 62vw, 300px);
}
.portrait-mat {
  border: 1px solid var(--line);
  padding: 12px;
  background: linear-gradient(160deg, rgba(201,162,75,0.10), rgba(201,162,75,0.02));
  border-radius: 200px 200px 14px 14px;
}
.portrait-mat img {
  display: block; width: 100%;
  aspect-ratio: 3 / 3.4;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 190px 190px 6px 6px;
  filter: saturate(0.92) contrast(1.02);
}
.pf-corner { position: absolute; width: 16px; height: 16px; border: 1px solid var(--gold); opacity: 0.7; }
.pf-corner.tl { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.pf-corner.tr { top: -6px; right: -6px; border-left: 0; border-bottom: 0; }
.pf-corner.bl { bottom: -6px; left: -6px; border-right: 0; border-top: 0; }
.pf-corner.br { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }

/* Hero emblem — celebratory centerpiece in place of the portrait */
.emblem {
  position: relative;
  margin: 30px 0 4px;
  width: clamp(126px, 32vw, 148px);
  height: clamp(126px, 32vw, 148px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 34%, rgba(201,162,75,0.13), rgba(201,162,75,0.02) 72%);
}
.emblem::before {
  content: ""; position: absolute; inset: 9px;
  border: 1px solid rgba(201,162,75,0.26); border-radius: 50%;
  pointer-events: none;
}
.emblem-num {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(3.3rem, 9.5vw, 4rem); line-height: 1;
  color: var(--gold-lt); letter-spacing: 0.01em;
}
.emblem-cap {
  font-size: 0.54rem; letter-spacing: 0.38em; text-transform: uppercase;
  color: var(--muted); margin-top: 3px; padding-left: 0.38em;
}

.hero-meta {
  display: flex; align-items: baseline; gap: 18px;
  margin: 38px 0 0; flex-wrap: wrap; justify-content: center;
}
.hm-item { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hm-k { font-size: 0.64rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); }
.hm-v { font-family: var(--serif); font-size: 1.5rem; color: var(--cream); font-weight: 500; }
.hm-dot { color: var(--gold); font-size: 1.1rem; transform: translateY(6px); }

.hero-cta, .submit-btn {
  font-family: var(--sans); font-weight: 500;
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--bg); background: var(--gold);
  border: 0; cursor: pointer;
  padding: 16px 34px; border-radius: 40px;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none; display: inline-block;
}
.hero-cta { margin-top: 42px; }
.hero-cta:hover, .submit-btn:hover { background: var(--gold-lt); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(201,162,75,0.25); }

.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted);
}
.sc-line { width: 1px; height: 40px; background: linear-gradient(var(--gold), transparent); animation: drop 2.4s ease-in-out infinite; }
@keyframes drop { 0%,100%{ transform: scaleY(0.4); transform-origin: top; opacity:0.4;} 50%{ transform: scaleY(1); opacity:1;} }

/* ── Countdown ── */
/* Tighten the join from the (full-height) hero into the first section. */
.count-sec { padding-top: 52px; }
.count-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin: 44px auto 0; max-width: 620px;
}
.count-cell {
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(201,162,75,0.06), transparent);
  border-radius: 12px;
  padding: 26px 8px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.count-num { font-family: var(--serif); font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 600; color: var(--gold-lt); line-height: 1; font-variant-numeric: tabular-nums; }
.count-lab { font-size: 0.62rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }

/* ── Details ── */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 44px; }
.detail-card {
  border: 1px solid var(--line-soft);
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 12px;
  padding: 30px 24px;
  display: flex; flex-direction: column; gap: 8px; text-align: center;
}
.dc-k { font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); }
.dc-v { font-family: var(--serif); font-size: 1.7rem; color: var(--cream); font-weight: 500; }
.dc-s { font-size: 0.86rem; color: var(--muted); }

/* ── Timeline ── */
.timeline { list-style: none; margin: 48px auto 0; max-width: 580px; position: relative; }
.timeline::before { content:""; position:absolute; left: 78px; top: 8px; bottom: 8px; width:1px; background: var(--line); }
.tl-item { display: grid; grid-template-columns: 64px 16px 1fr; gap: 18px; align-items: start; padding: 0 0 38px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-time { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--gold); text-align: right; padding-top: 1px; }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--gold); margin: 6px auto 0; box-shadow: 0 0 0 4px rgba(201,162,75,0.15); position: relative; z-index: 1; }
.tl-h { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; color: var(--cream); }
.tl-d { font-size: 0.95rem; color: var(--cream-dim); margin-top: 4px; max-width: 38ch; }

/* ── RSVP ── */
.rsvp-sub { text-align: center; color: var(--muted); margin: 14px auto 0; max-width: 40ch; }
.rsvp-form {
  margin: 40px auto 0; max-width: 460px;
  display: flex; flex-direction: column; gap: 20px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 34px 30px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--cream-dim); }
.field label .opt { text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 0.78rem; }
.field input, .field select {
  font-family: var(--sans); font-size: 1rem; color: var(--cream);
  background: var(--bg); border: 1px solid var(--line-soft);
  border-radius: 9px; padding: 13px 15px; width: 100%;
  transition: border-color 0.2s ease;
}
.field input::placeholder { color: #6f6450; }
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); }
.field input.bad { border-color: #c66; }
.field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c9a24b' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg-btn {
  font-family: var(--sans); font-size: 0.9rem; color: var(--cream-dim);
  background: var(--bg); border: 1px solid var(--line-soft);
  border-radius: 9px; padding: 13px 10px; cursor: pointer;
  transition: all 0.2s ease;
}
.seg-btn.on { background: rgba(201,162,75,0.14); border-color: var(--gold); color: var(--gold-lt); }
.seg-btn:hover { border-color: var(--gold); }

.submit-btn { margin-top: 6px; width: 100%; text-align: center; }

/* ── Guests ── */
.guests { margin: 44px auto 0; max-width: 460px; }
.guests-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.guests-count { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1rem; }
.guests-empty { color: var(--muted); font-size: 0.92rem; padding: 18px 0 0; text-align: center; }
.guests-list { list-style: none; margin: 6px 0 0; }
.guest-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.g-name { font-family: var(--serif); font-size: 1.2rem; color: var(--cream); }
.g-plus { color: var(--gold); font-size: 0.9rem; }

/* ── Footer ── */
.footer { padding: 80px 0 70px; text-align: center; }
.foot-serif { font-family: var(--serif); font-style: italic; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--gold); margin-top: 8px; }
.foot-sub { font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); margin-top: 16px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .section { padding: 72px 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .count-grid { gap: 10px; }
  .count-cell { padding: 20px 4px 14px; }
  .hero-meta { gap: 12px; }
  .hm-dot { display: none; }
  .timeline::before { left: 70px; }
  .tl-item { grid-template-columns: 56px 14px 1fr; gap: 14px; }
}

/* ═════════════════════════════════════════════════════════════════════
   ADDITIONS (not in the prototype): named plus-one inputs, form
   messaging, the live region, and loading/disabled states.
   ═════════════════════════════════════════════════════════════════════ */

/* Named plus-one guest inputs, revealed when "extra guests" > 0 */
.guest-names {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 2px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.guest-name-row { display: flex; flex-direction: column; gap: 6px; }
.guest-name-row label {
  font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}

/* Inline note under a field */
.field-note { font-size: 0.76rem; color: var(--muted); margin-top: -2px; }

/* Form-level message (success / error) */
.form-msg {
  font-size: 0.92rem; text-align: center;
  border-radius: 10px; padding: 13px 16px;
  border: 1px solid transparent;
}
.form-msg.ok {
  color: var(--gold-lt);
  background: rgba(201,162,75,0.12);
  border-color: var(--line);
}
.form-msg.error {
  color: #e9b4b4;
  background: rgba(198,102,102,0.10);
  border-color: rgba(198,102,102,0.45);
}
.form-msg[hidden] { display: none; }

/* Submit loading / disabled state */
.submit-btn:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }

/* Guest list loading shimmer text */
.guests-loading { color: var(--muted); font-size: 0.9rem; padding: 18px 0 0; text-align: center; }

/* The "first names only" privacy note on the guest list */
.guests-note { font-size: 0.72rem; color: var(--muted); margin-top: 14px; text-align: center; font-style: italic; }

/* Visually-hidden helper for screen-reader live updates */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
