:root {
  --paper: #f3ecdf;
  --paper-light: #faf6ed;
  --ink: #2c2926;
  --muted: #756e65;
  --accent: #b3232d;
  --accent-dark: #7e1720;
  --line: rgba(54, 48, 42, 0.18);
  --serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --sans: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 25%, rgba(126, 23, 32, .035), transparent 28%),
    repeating-linear-gradient(89deg, rgba(64, 48, 30, .018) 0 1px, transparent 1px 5px),
    var(--paper);
  font-family: var(--serif);
  line-height: 1.75;
  overflow-x: clip;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #eee5d7;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(243, 236, 223, .02), rgba(243, 236, 223, .15) 63%, rgba(243, 236, 223, .82));
  pointer-events: none;
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.95) contrast(.98);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(88vw, 620px);
  padding: 7rem 1.5rem 3rem;
  text-align: center;
  align-self: start;
}

.eyebrow, .section-index, .venue-city, footer span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: .68rem;
}

.hero h1 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(.7rem, 4vw, 2rem);
  margin: 1rem 0 .6rem;
  font-size: clamp(2.6rem, 12vw, 6.5rem);
  font-weight: 500;
  letter-spacing: .08em;
}

.hero h1 i, .footer-names i { color: var(--accent); font-weight: 400; }
.hero-date { letter-spacing: .3em; font-size: .9rem; }
.scroll-cue { display: inline-block; margin-top: 1.25rem; font-size: .84rem; text-decoration: none; }

.paper-section {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 9rem) clamp(1.4rem, 7vw, 5rem);
  border-bottom: 1px solid var(--line);
}

.section-index { margin: 0 0 clamp(2.4rem, 7vw, 5rem); color: var(--muted); }
h2 { margin: 0; font-size: clamp(2rem, 7vw, 3.8rem); font-weight: 500; letter-spacing: .04em; }

.invitation { min-height: 80vh; position: relative; }
.invitation-copy { font-size: clamp(1.5rem, 5vw, 2.55rem); line-height: 1.85; letter-spacing: .08em; }
.invitation-copy p { margin: .1em 0; }
.invitation-note { max-width: 35rem; margin-top: 3rem; color: var(--muted); }
.red-thread { width: min(32vw, 230px); height: 3px; margin: 5rem 0 0 auto; background: var(--accent); transform: rotate(-7deg); box-shadow: 0 5px 0 rgba(179, 35, 45, .14); }

.countdown-section { text-align: center; }
.countdown-section .section-index { text-align: left; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; margin: 3rem auto 1.5rem; }
.countdown div { padding: 1.5rem .2rem; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.countdown strong { display: block; font-family: Georgia, serif; font-weight: 400; font-size: clamp(2rem, 8vw, 4.6rem); line-height: 1; }
.countdown span { display: block; margin-top: .8rem; color: var(--muted); font-size: .72rem; }
.countdown-caption { color: var(--muted); letter-spacing: .13em; }

.timeline { margin-top: 3rem; border-top: 1px solid var(--ink); }
.timeline article { display: grid; grid-template-columns: minmax(6rem, 1fr) 3fr; gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.timeline time { color: var(--accent); font-size: 1.1rem; letter-spacing: .08em; }
.timeline h3 { margin: 0 0 .35rem; font-size: 1.3rem; }
.timeline p { margin: 0; color: var(--muted); }
.timeline .pending time { color: var(--muted); font-size: .85rem; }

.venue-card { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: end; padding: clamp(1.5rem, 5vw, 3rem); background: var(--accent); color: #fff8ee; }
.venue-card h2 { margin: .3rem 0 .7rem; }
.venue-card p { margin: 0; opacity: .84; }
.primary-link { display: inline-flex; justify-content: center; padding: .85rem 1.2rem; border: 1px solid rgba(255,255,255,.72); text-decoration: none; white-space: nowrap; }

.rsvp-section { max-width: 820px; }
.rsvp-intro { margin-bottom: 3rem; }
.rsvp-intro p { color: var(--muted); }
#rsvp-form { display: grid; gap: 1.4rem; }
.field { display: grid; gap: .55rem; }
.field > span, .choice-field legend { font-size: .86rem; letter-spacing: .08em; }
.field small { color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input, select, textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: .85rem .15rem;
  color: var(--ink);
  background: transparent;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
textarea { resize: vertical; min-height: 7rem; }
.choice-field { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.choice-field legend { width: 100%; margin-bottom: .55rem; }
.choice-field label { cursor: pointer; }
.choice-field input { position: absolute; opacity: 0; pointer-events: none; }
.choice-field span { display: block; padding: .65rem 1rem; border: 1px solid var(--line); }
.choice-field input:checked + span { color: white; background: var(--accent); border-color: var(--accent); }
.privacy-check { display: flex; gap: .7rem; align-items: flex-start; color: var(--muted); font-size: .78rem; }
.privacy-check input { width: 1rem; height: 1rem; margin-top: .4rem; accent-color: var(--accent); }
.submit-button { border: 0; padding: 1rem 1.4rem; color: white; background: var(--accent); cursor: pointer; letter-spacing: .15em; }
.submit-button:hover { background: var(--accent-dark); }
.submit-button:disabled { opacity: .55; cursor: wait; }
.form-status { min-height: 1.75rem; margin: 0; color: var(--accent-dark); font-size: .85rem; }

.music-button {
  position: fixed;
  z-index: 20;
  right: max(1rem, env(safe-area-inset-right));
  top: max(1rem, env(safe-area-inset-top));
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid rgba(44, 41, 38, .22);
  border-radius: 999px;
  padding: .48rem .75rem .48rem .5rem;
  background: rgba(250, 246, 237, .87);
  color: var(--ink);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: .72rem;
}
.music-disc { width: 1.55rem; height: 1.55rem; border-radius: 50%; background: radial-gradient(circle, var(--paper) 0 14%, var(--accent) 15% 24%, var(--ink) 25%); }
.music-button[aria-pressed="true"] .music-disc { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

footer { padding: 6rem 1.5rem 7rem; text-align: center; }
.footer-names { font-size: 2rem; letter-spacing: .13em; }
footer p:not(.footer-names) { color: var(--muted); }
footer span { display: block; margin-top: 3rem; color: var(--muted); }

@media (max-width: 620px) {
  .hero-copy { padding-top: 6rem; }
  .venue-card { grid-template-columns: 1fr; align-items: start; }
  .primary-link { width: 100%; }
  .timeline article { grid-template-columns: 1fr; gap: .5rem; }
  .field-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .music-button[aria-pressed="true"] .music-disc { animation: none; }
}
