/* ===========================================================================
   Reception RSVP — guest page
   Palette pulled from the photographs: basalt, deep Atlantic, glacier,
   cottongrass, and one low-sun amber that appears exactly once.
   ========================================================================= */

:root {
  --basalt:      #14181b;
  --basalt-deep: #0c0f11;
  --atlantic:    #1b3a44;
  --glacier:     #a9c5cd;
  --cottongrass: #ecefea;
  --amber:       #d9a441;

  --ink:         var(--cottongrass);
  --ink-soft:    rgb(236 239 234 / 0.74);
  --ink-faint:   rgb(236 239 234 / 0.40);
  --line:        rgb(236 239 234 / 0.16);
  --line-strong: rgb(236 239 234 / 0.30);

  --panel:       rgb(12 15 17 / 0.74);
  --panel-solid: rgb(12 15 17 / 0.88);

  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --body:    'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --measure: 68rem;
  --radius: 3px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

/* Author rules like `.sheet { display: grid }` outrank the browser's own
   [hidden] rule, so state we toggle with `el.hidden` needs this to stick. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--basalt-deep);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

::selection { background: var(--glacier); color: var(--basalt); }

:focus-visible {
  outline: 2px solid var(--glacier);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--measure));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--cottongrass);
  color: var(--basalt);
  font-weight: 600;
}
.skip:focus { left: 1rem; top: 1rem; }

/* --- Background photographs --------------------------------------------- */

.backdrop, .backdrop-grade {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.backdrop-frame {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 2.4s var(--ease), transform 9s linear;
  will-change: opacity, transform;
}
.backdrop-frame.is-active {
  opacity: 1;
  transform: scale(1);
}

/* Graded so the text column stays readable without flattening the photograph:
   the scrim is heaviest on the left, where the words are, and clears to the
   right so the landscape still reads. */
.backdrop-grade {
  z-index: -1;
  background:
    linear-gradient(105deg,
      rgb(12 15 17 / 0.86) 0%,
      rgb(12 15 17 / 0.62) 30%,
      rgb(12 15 17 / 0.22) 58%,
      rgb(12 15 17 / 0.34) 100%),
    linear-gradient(to bottom,
      rgb(12 15 17 / 0.40) 0%,
      rgb(12 15 17 / 0.06) 24%,
      rgb(12 15 17 / 0.10) 62%,
      rgb(12 15 17 / 0.88) 100%),
    linear-gradient(to right,
      rgb(27 58 68 / 0.30) 0%,
      transparent 60%);
}

/* --- Type --------------------------------------------------------------- */

.eyebrow, .label, .geo-place, .geo-coords, .geo-index, .optional {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 clamp(1.5rem, 4vw, 2.75rem);
  color: var(--glacier);
}

.label {
  margin: 0 0 0.75rem;
  color: var(--glacier);
}

.h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.85rem, 1.2rem + 2.6vw, 3.1rem);
  font-variation-settings: 'opsz' 100, 'SOFT' 0, 'WONK' 1;
  line-height: 1.06;
  letter-spacing: -0.015em;
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(6rem, 14vh, 9rem) 0 7.5rem;
}

.hero-inner { position: relative; }

.names {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(3.5rem, 1.4rem + 10.5vw, 10rem);
  font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 1;
  line-height: 0.86;
  letter-spacing: -0.035em;
}

.name { display: block; }

/* The ampersand sits on its own rule, like a scale bar on a map. */
.amp {
  display: flex;
  align-items: center;
  gap: 0.6em;
  width: 100%;
  margin: 0.16em 0;
  font-size: 0.22em;
  letter-spacing: 0;
}
.amp-mark {
  font-family: var(--display);
  font-variation-settings: 'opsz' 9, 'WONK' 1;
  color: var(--amber);
  font-style: italic;
}
.amp-rule {
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}
.amp-rule:first-child { max-width: 3.5em; flex: 0 0 3.5em; }

.tagline {
  max-width: 34rem;
  margin: clamp(1.75rem, 4vw, 2.5rem) 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.1875rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(2rem, 5vw, 2.75rem);
}

/* Laptop-height screens: the hero would otherwise outgrow the viewport and
   push the caption strip below the fold. Tighten the type and the padding
   rather than letting the signature element fall off the screen. */
@media (max-height: 820px) {
  .hero {
    padding-top: clamp(4rem, 9vh, 5.5rem);
    padding-bottom: 6rem;
  }
  .names { font-size: clamp(3rem, 8.2vw, 6.5rem); }
  .eyebrow { margin-bottom: clamp(1rem, 2.5vh, 1.75rem); }
  .tagline {
    margin-top: clamp(1.25rem, 3vh, 1.75rem);
    font-size: clamp(0.9375rem, 0.9rem + 0.25vw, 1.0625rem);
  }
  .hero-actions { margin-top: clamp(1.5rem, 3.5vh, 2rem); }
}

/* --- Geo strip (the signature) ------------------------------------------ */

.geo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding-block: 1.15rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, rgb(12 15 17 / 0.75), transparent);
  backdrop-filter: blur(2px);
}

.geo-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.geo-text {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  min-width: 0;
  transition: opacity 0.5s var(--ease);
}
.geo-text.is-swapping { opacity: 0; }

.geo-index { color: var(--ink-faint); }
.geo-place { color: var(--ink); letter-spacing: 0.26em; white-space: nowrap; }
.geo-coords {
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.geo-dots {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.geo-dot {
  width: 26px;
  height: 2px;
  padding: 0;
  border: 0;
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.4s var(--ease);
}
.geo-dot:hover { background: var(--ink-soft); }
.geo-dot[aria-selected='true'] { background: var(--glacier); }

@media (max-width: 40rem) {
  .geo-coords { display: none; }
  .geo-place { letter-spacing: 0.18em; }
}

/* --- Sections and panels ------------------------------------------------ */

.section {
  padding-block: clamp(4.5rem, 11vh, 8rem);
}

.panel {
  padding: clamp(1.75rem, 5vw, 3.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

.panel-head {
  margin-bottom: clamp(2rem, 5vw, 2.75rem);
}

.panel-note {
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* --- Manifest ----------------------------------------------------------- */
/* Rows, not cards: this is a list of facts, so it reads like one. */

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

.manifest-row {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) 1fr;
  gap: 1rem 2rem;
  align-items: baseline;
  padding-block: 1.05rem;
  border-bottom: 1px solid var(--line);
}

.manifest-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.manifest-value {
  margin: 0;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
  line-height: 1.45;
  text-wrap: pretty;
}

@media (max-width: 34rem) {
  .manifest-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
              border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--cottongrass);
  color: var(--basalt);
}
.btn-primary:hover { background: #fff; }
.btn-primary:disabled {
  background: var(--ink-faint);
  color: var(--basalt);
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--glacier);
  color: var(--glacier);
}

.btn-sm { padding: 0.7rem 1.4rem; font-size: 0.6875rem; }

/* --- Form --------------------------------------------------------------- */

.form { display: grid; gap: 1.6rem; }

.honeypot {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.field { display: grid; gap: 0.55rem; min-width: 0; }

.field-choice { margin: 0; padding: 0; border: 0; }

.field-label {
  display: block;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}

.optional {
  margin-left: 0.5rem;
  color: var(--ink-faint);
  letter-spacing: 0.14em;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.6rem;
}

.input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgb(12 15 17 / 0.5);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.input::placeholder { color: var(--ink-faint); }
.input:hover { border-color: var(--ink-faint); }
.input:focus {
  border-color: var(--glacier);
  background: rgb(12 15 17 / 0.72);
  outline: none;
  box-shadow: 0 0 0 3px rgb(169 197 205 / 0.15);
}
textarea.input { resize: vertical; min-height: 3.5rem; }

.input.has-error {
  border-color: #e08a7a;
  box-shadow: 0 0 0 3px rgb(224 138 122 / 0.14);
}

/* Attending yes/no */
.choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
}

.choice-option { display: block; cursor: pointer; }
.choice-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-face {
  display: grid;
  gap: 0.2rem;
  padding: 1.05rem 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgb(12 15 17 / 0.5);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.choice-option:hover .choice-face { border-color: var(--ink-faint); }

.choice-title { font-weight: 500; }
.choice-sub { color: var(--ink-faint); font-size: 0.875rem; }

.choice-option input:checked + .choice-face {
  border-color: var(--glacier);
  background: rgb(169 197 205 / 0.12);
}
.choice-option input:focus-visible + .choice-face {
  outline: 2px solid var(--glacier);
  outline-offset: 3px;
}

/* Guest stepper */
.stepper {
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgb(12 15 17 / 0.5);
}
.stepper:focus-within { border-color: var(--glacier); }

.stepper-btn {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.stepper-btn:hover { background: rgb(236 239 234 / 0.08); color: var(--ink); }

.stepper-input {
  border: 0;
  border-inline: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-family: var(--mono);
  -moz-appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-input:focus { box-shadow: none; background: transparent; }

/* Fields that only apply when someone is actually coming. */
.only-attending {
  transition: opacity 0.35s var(--ease);
}
.only-attending.is-muted {
  opacity: 0.32;
  pointer-events: none;
}

.error {
  margin: 0;
  min-height: 0;
  color: #e8a294;
  font-size: 0.8125rem;
}
.error:empty { display: none; }

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 0.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.form-status { margin: 0; font-size: 0.9375rem; color: var(--ink-soft); }
.form-status.is-error { color: #e8a294; }

/* --- Closed / thanks ---------------------------------------------------- */

.closed p { margin: 0 0 1.5rem; color: var(--ink-soft); }

.thanks { display: grid; justify-items: start; gap: 1rem; }
.thanks-mark { color: var(--glacier); }
.thanks-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem);
  font-variation-settings: 'opsz' 100, 'WONK' 1;
  line-height: 1.1;
}
.thanks-body { margin: 0; max-width: 36rem; color: var(--ink-soft); }
#another-btn { margin-top: 0.75rem; }

/* --- Footer ------------------------------------------------------------- */

.footer {
  padding-block: 3.5rem 4.5rem;
  border-top: 1px solid var(--line);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.footer-names {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 300;
  font-variation-settings: 'opsz' 40, 'WONK' 1;
}
.footer-note { margin: 0; font-size: 0.875rem; color: var(--ink-faint); }
.footer-note a { color: var(--glacier); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* --- Entrance ----------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
}
.is-ready .reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.is-ready .reveal[data-step='1'] { transition-delay: 0.15s; }
.is-ready .reveal[data-step='2'] { transition-delay: 0.30s; }
.is-ready .reveal[data-step='3'] { transition-delay: 0.60s; }
.is-ready .reveal[data-step='4'] { transition-delay: 0.75s; }
.is-ready .reveal[data-step='5'] { transition-delay: 0.95s; }

.section .panel {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.section .panel.in-view {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .section .panel { opacity: 1; transform: none; }
  .backdrop-frame { transform: none; }
}
