/* =========================================================
   Tokens
   Monochrome palette after Bliss & Bone's "Rivera":
   white ground, near-black ink, warm grays, hairline rules.
   ========================================================= */
:root {
  --ink: #231f20;
  --ink-soft: #4a4648;
  --gray: #8a8784;
  --gray-light: #b9b6b2;
  --rule: #e4e1dc;
  --paper: #ffffff;
  --paper-warm: #f7f5f1;
  --dark: #1b1819;
  --dark-text: #efece7;
  --dark-rule: #3a3637;

  --serif-display: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --serif-text: "EB Garamond", Garamond, Georgia, serif;

  --measure: 36rem;
  --wide: 72rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --header-h: 3.5rem;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* Small caps / letterspaced labels used throughout */
.caps {
  font-family: var(--serif-text);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.9;
}

.label { margin-bottom: 2rem; color: var(--gray); }
.label-sm { margin-bottom: 0.5rem; color: var(--gray); }

.display {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin-bottom: 1.5rem;
}

.lede, .detail {
  max-width: var(--measure);
  color: var(--ink-soft);
}

.detail { margin-top: 1rem; }

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0 var(--gutter);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-family: var(--serif-text);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.brand-and {
  text-transform: lowercase;
  font-style: italic;
  letter-spacing: 0.05em;
  font-family: var(--serif-display);
  font-size: 0.85rem;
  margin: 0 0.15em;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 1.5rem;
  height: 1px;
  background: var(--ink);
  margin-left: auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Full-screen menu ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--header-h) var(--gutter) 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.menu.open { opacity: 1; visibility: visible; }

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.menu-list a {
  font-family: var(--serif-display);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 400;
  line-height: 1;
  transition: color 0.2s ease;
}

.menu-list a:hover { color: var(--gray); }

.menu-foot {
  position: absolute;
  bottom: 2rem;
  font-family: var(--serif-text);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray);
}

body.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 3rem) var(--gutter) 5rem;
  position: relative;
}

.hero-inner {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
}

.names {
  font-family: var(--serif-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.names .name { font-size: clamp(2.75rem, 9vw, 7rem); }

.names .and {
  font-weight: 400;
  font-style: italic;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  color: var(--ink-soft);
  padding-left: 0.2em;
}

.hero-meta {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  max-width: 24rem;
}

.hero-countdown {
  margin-top: 0.75rem;
  font-style: italic;
  font-size: 1rem;
  color: var(--gray);
}

.scroll-cue {
  position: absolute;
  right: var(--gutter);
  bottom: 2rem;
  writing-mode: vertical-rl;
  color: var(--gray);
}

.scroll-cue .caps { color: inherit; }

@media (max-width: 640px) {
  .scroll-cue { display: none; }
}

/* ---------- Photos ---------- */
.photo { margin: 0; }

.photo-full { width: 100%; }
.photo-full .photo-placeholder, .photo-full img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }

.photo-inset {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter) 6rem;
}
.photo-inset .photo-placeholder, .photo-inset img { aspect-ratio: 3 / 2; width: 100%; object-fit: cover; }

/* Any real photograph is rendered in black and white, as in Rivera. */
.photo img { filter: grayscale(1); }

.photo-placeholder {
  background: var(--paper-warm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-placeholder .caps { color: var(--gray-light); }

/* ---------- Sections ---------- */
.section { padding: clamp(5rem, 12vw, 9rem) var(--gutter); }

.section-inner { max-width: var(--wide); margin: 0 auto; }
.section-inner.narrow { max-width: var(--measure); }

.columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
}

.columns-tight { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--rule); }

@media (min-width: 720px) {
  .columns { grid-template-columns: 1fr 1fr; gap: 4rem; }
}

.col .display { font-size: clamp(1.75rem, 3vw, 2.25rem); margin-bottom: 1rem; }

/* ---------- Dark section (RSVP) ---------- */
.section-dark {
  background: var(--dark);
  color: var(--dark-text);
}

.section-dark .caps,
.section-dark .label,
.section-dark .lede,
.section-dark .detail { color: var(--dark-text); }

.section-dark .label { opacity: 0.6; }

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  padding: 0.9rem 2.25rem;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-family: var(--serif-text);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.button:hover { background: var(--dark-text); color: var(--dark); }
.button:disabled { opacity: 0.5; cursor: default; }

/* ---------- Form ---------- */
.form {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.field.hidden { display: none; }

.field label, .field legend { padding: 0; opacity: 0.75; }

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0;
  font: inherit;
  font-size: 1.125rem;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--dark-rule);
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s ease;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 6px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

select option { color: var(--ink); background: var(--paper); }

input:focus, select:focus, textarea:focus { border-bottom-color: var(--dark-text); }

textarea { resize: vertical; min-height: 3rem; }

.choices { display: flex; flex-direction: column; gap: 0.75rem; }

@media (min-width: 480px) {
  .choices { flex-direction: row; gap: 2.5rem; }
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-style: italic;
}

.choice input {
  appearance: none;
  -webkit-appearance: none;
  width: 0.85rem;
  height: 0.85rem;
  margin: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-content: center;
  cursor: pointer;
}

.choice input::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  transform: scale(0);
  transition: transform 0.15s ease;
}

.choice input:checked::before { transform: scale(1); }

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.form-status {
  font-style: italic;
  min-height: 1.5em;
  opacity: 0.85;
}

.form-status.error { color: #e3a39b; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 3rem var(--gutter);
  text-align: center;
  border-top: 1px solid var(--rule);
}

.site-footer .caps { color: var(--gray); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Coming soon (root index.html) ---------- */
body.soon {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.soon-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem var(--gutter);
}

.soon-title {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.02em;
}

/* ---------- Preview gate (admin/index.html) ---------- */
body.locked { overflow: hidden; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}

.gate-form {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.gate-form .label { margin-bottom: 0.5rem; }

.gate-prompt {
  font-family: var(--serif-display);
  font-size: 1.6rem;
  line-height: 1.2;
}

.gate-form input[type="password"] {
  border-bottom-color: var(--rule);
  color: var(--ink);
}

.gate-form input[type="password"]:focus { border-bottom-color: var(--ink); }

.gate-form .button:hover { background: var(--ink); color: var(--paper); }
.gate-form .form-status { color: var(--gray); }
.gate-form .form-status.error { color: #a33a2f; }
