/* Palmetto and Pearl · A Neighbors' Evening · RSVP page
   Composed phone-first at 390px; the desktop face grows from the single column. */

@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-500.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-400-italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Jost"; src: url("fonts/jost-400.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("fonts/jost-500.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --pearl: #f7f2e9;
  --linen: #efe7da;
  --linen-deep: #e4d9c7;
  --palm: #2c4636;
  --palm-soft: #56695b;
  --ink: #2a3830;
  --gold: #b99b5f;
  --gold-ink: #7a6234;
  --line: rgba(185, 155, 95, .45);
  --error: #8a3b2c;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Jost", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --gutter: 1.5rem;
  --bar-h: 4.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--pearl);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the pearl mark ---------- */
.pearl {
  display: inline-block; width: .7em; height: .7em; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fffdf8 0 18%, #f1e9dc 42%, #d9ccb6 78%, #c8b796 100%);
  box-shadow: 0 0 0 1px var(--gold), 0 1px 2px rgba(60, 50, 30, .18);
  vertical-align: middle;
}
.rule { display: flex; align-items: center; gap: .9rem; justify-content: center; margin: 0 auto; color: var(--gold); }
.rule::before, .rule::after { content: ""; height: 1px; width: 3.25rem; background: var(--line); }
.rule .pearl { font-size: .8rem; }

/* ---------- the SAMPLE mark: a small gold-edged tab in the top-left corner, held while scrolling ---------- */
.sample-mark {
  position: fixed; z-index: 30; top: 0; left: 0; margin: 0;
  padding: calc(.28rem + env(safe-area-inset-top)) .62rem .3rem calc(.7rem + env(safe-area-inset-left));
  background: rgba(251, 248, 242, .94);
  border: 1px solid var(--gold); border-top: 0; border-left: 0; border-bottom-right-radius: 3px;
  font-family: var(--sans); font-weight: 500; font-size: .62rem; line-height: 1.2;
  letter-spacing: .3em; text-transform: uppercase; color: var(--gold-ink);
  pointer-events: none; user-select: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}

/* ---------- hero ---------- */
.hero { position: relative; background: var(--linen); }
.hero__frame {
  position: relative; width: 100%;
  aspect-ratio: 4 / 5;                 /* reserved before the plate arrives: nothing shifts */
  overflow: hidden; background: #d9d0d6;
}
.hero__frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 29%; }
.hero__frame::before {                 /* linen haze under the type only, earned against the brightest sky */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 85% 34% at 50% 24%, rgba(247, 242, 233, .9) 0%, rgba(247, 242, 233, .72) 45%, rgba(247, 242, 233, 0) 100%),
    linear-gradient(to bottom, rgba(247, 242, 233, .55) 0%, rgba(247, 242, 233, 0) 16%);
}
.hero__type {
  position: absolute; inset: 0 0 auto 0; z-index: 2;
  padding: 1.6rem var(--gutter) 0; text-align: center; color: var(--palm);
}
.wordmark {
  margin: 0; font-family: var(--sans); font-weight: 500;
  font-size: .72rem; letter-spacing: .32em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: .6rem;
}
.wordmark .pearl { font-size: .9rem; }
.kicker {
  margin: 2.6rem 0 .5rem; font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 1.2rem; color: var(--gold-ink); letter-spacing: .01em;
}
.headline {
  margin: 0 auto;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.5rem, 1.9rem + 2.8vw, 4.75rem);
  line-height: 1.02; letter-spacing: -.01em; color: var(--palm);
}
.hero__view {
  position: absolute; z-index: 2; right: .75rem; bottom: .75rem;
  display: inline-flex; align-items: center; gap: .45rem;
  border: 0; border-radius: 999px; padding: .5rem .85rem .5rem .75rem; min-height: 2.25rem;
  background: rgba(247, 242, 233, .82); color: var(--palm);
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hero__view svg { width: .85rem; height: .85rem; }
.hero__rsvp { display: none; }

/* ---------- the details (locked block, first line) ---------- */
.when {
  padding: 1.75rem var(--gutter) 2rem; text-align: center; background: var(--pearl);
}
.when__line {
  margin: 0 auto; max-width: 22rem;
  font-family: var(--serif); font-weight: 500; font-size: 1.42rem; line-height: 1.32; color: var(--palm);
}
.when__line .sep { color: var(--gold); }
.when__line .url { font-family: var(--sans); font-weight: 400; font-size: .92rem; letter-spacing: .04em; color: var(--gold-ink); white-space: nowrap; }
.when__where { margin: .9rem 0 0; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--palm-soft); }

/* ---------- body sections ---------- */
.layout { padding: 0 var(--gutter); }
.section { padding: 2.75rem 0; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; padding-top: .5rem; }
.eyebrow {
  margin: 0 0 1rem; font-size: .72rem; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-ink);
}
.lede { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.32rem; line-height: 1.45; color: var(--ink); }
.prose { margin: 1rem 0 0; color: var(--palm-soft); }

.evening-line { margin: 0 0 1.75rem; font-family: var(--serif); font-style: italic; font-size: 1.3rem; line-height: 1.4; color: var(--palm); }
.three { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; }
.three li { display: grid; grid-template-columns: 2.25rem 1fr; gap: .25rem .75rem; align-items: baseline; }
.three .n { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--gold-ink); }
.three h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.35rem; line-height: 1.25; color: var(--palm); }
.three p { grid-column: 2; margin: 0; color: var(--palm-soft); font-size: .98rem; }

.plates { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: .6rem; margin: 2rem 0 0; }
.plates figure { margin: 0; min-width: 0; }
.plates img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--linen); }
.plates .p2 img { aspect-ratio: 8 / 15; object-position: 50% 60%; }   /* same height as the wider plate beside it */
.plates .p1 img { object-position: 30% 50%; }
.plates figcaption { overflow-wrap: anywhere; margin-top: .45rem; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--palm-soft); }

/* the gift card: a real object a guest carries home */
.gift {
  position: relative; margin: 0; padding: 2rem 1.5rem 1.75rem; text-align: center;
  background: #fbf8f2; border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 14px 30px -22px rgba(60, 50, 30, .45);
}
.gift::after { content: ""; position: absolute; inset: .45rem; border: 1px solid rgba(185, 155, 95, .25); pointer-events: none; }
.gift .pearl { font-size: 1rem; margin-bottom: .9rem; }
.gift p { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.38rem; line-height: 1.35; color: var(--palm); }

.hosts-line { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 1.32rem; line-height: 1.5; color: var(--ink); }
.hosts-line em { font-style: italic; font-weight: 400; color: var(--palm); white-space: nowrap; }

/* ---------- the form ---------- */
.rsvp { padding: 2.75rem 0 1rem; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.rsvp__title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 2.2rem; line-height: 1.1; color: var(--palm); }
.rsvp__intro { margin: .7rem 0 1.75rem; color: var(--palm-soft); font-size: .98rem; }

.field { margin: 0 0 1.25rem; }
.field label, .field .label { display: block; margin-bottom: .4rem; font-size: .76rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--palm); }
.field .opt { font-weight: 400; letter-spacing: .06em; text-transform: none; color: var(--palm-soft); font-size: .82rem; }
.input {
  width: 100%; min-height: 3.25rem; padding: .8rem 1rem;
  background: #fffdf9; border: 1px solid var(--linen-deep); border-radius: 2px;
  font-size: 1.05rem; line-height: 1.4; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: #9aa49c; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185, 155, 95, .22); }
textarea.input { min-height: 6.5rem; resize: vertical; }
.field.invalid .input { border-color: var(--error); }
.err { display: none; margin: .4rem 0 0; font-size: .88rem; color: var(--error); }
.field.invalid .err { display: block; }

.stepper { display: grid; grid-template-columns: 3.25rem 1fr 3.25rem; border: 1px solid var(--linen-deep); background: #fffdf9; border-radius: 2px; max-width: 15rem; }
.stepper button {
  border: 0; background: transparent; min-height: 3.25rem; cursor: pointer;
  font-family: var(--serif); font-size: 1.6rem; line-height: 1; color: var(--palm);
}
.stepper button:disabled { color: #c2c6bf; cursor: default; }
.stepper button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.stepper output { display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--linen-deep); border-right: 1px solid var(--linen-deep); font-family: var(--serif); font-weight: 500; font-size: 1.45rem; color: var(--palm); }
.hint { margin: .45rem 0 0; font-size: .86rem; color: var(--palm-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; min-height: 3.5rem; padding: .9rem 1.5rem;
  border: 0; border-radius: 2px; background: var(--palm); color: var(--pearl);
  font-family: var(--sans); font-weight: 500; font-size: .86rem; letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; transition: background .15s ease;
}
.btn:hover { background: #22392b; }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn[aria-busy="true"] { opacity: .75; cursor: progress; }
.btn--ghost { background: transparent; color: var(--palm); border: 1px solid var(--palm); }
.btn--ghost:hover { background: rgba(44, 70, 54, .06); }
.form-err { display: none; margin: 1rem 0 0; padding: .85rem 1rem; background: #f6e9e3; color: var(--error); font-size: .94rem; }
.form-err.show { display: block; }
.small-print { margin: 1.1rem 0 0; font-family: var(--serif); font-style: italic; font-size: 1.08rem; line-height: 1.45; color: var(--palm-soft); text-align: center; }

/* confirmation */
.done { display: none; text-align: center; }
.rsvp.is-done form { display: none; }
.rsvp.is-done .rsvp__head { display: none; }
.rsvp.is-done .done { display: block; }
.done__plate { margin: 0 auto 1.6rem; width: 100%; max-width: 26rem; aspect-ratio: 4 / 3; overflow: hidden; background: var(--linen); }
.done__plate img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 52%; }
.done__title { margin: 0 auto; font-family: var(--serif); font-weight: 500; font-size: 1.9rem; line-height: 1.15; color: var(--palm); }
.done:focus { outline: none; }
.done__summary { margin: 1rem auto 0; max-width: 24rem; color: var(--palm-soft); }
.done__summary strong { font-weight: 500; color: var(--ink); }
.done__actions { display: grid; gap: .7rem; margin: 1.75rem auto 0; max-width: 22rem; }
.linkish { background: none; border: 0; padding: .5rem; color: var(--palm); text-decoration: underline; text-underline-offset: .25em; text-decoration-color: var(--gold); cursor: pointer; font-size: .95rem; }
.preview-note { margin: 1.5rem auto 0; max-width: 24rem; padding: .8rem 1rem; border: 1px dashed var(--line); font-size: .84rem; line-height: 1.5; color: var(--palm-soft); }

/* ---------- footer ---------- */
.foot { padding: 2.5rem var(--gutter) 2rem; text-align: center; border-top: 1px solid var(--line); margin-top: 2rem; }
.foot__sign { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--palm); }
.foot__name { margin: .35rem 0 0; font-size: .72rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--palm); }
.foot__place { margin: .3rem 0 0; font-size: .86rem; color: var(--palm-soft); }
.foot__hosts { margin-top: 1.5rem; }

/* ---------- the thumb bar (phone) ---------- */
.bar {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  padding: .7rem var(--gutter) calc(.7rem + env(safe-area-inset-bottom));
  background: rgba(247, 242, 233, .94); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 1rem;
  transition: transform .25s ease, opacity .25s ease;
}
.bar.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
.bar__when { flex: 1; min-width: 0; font-size: .8rem; line-height: 1.3; color: var(--palm); }
.bar__when b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.08rem; letter-spacing: 0; }
.bar .btn { width: auto; min-height: 3rem; padding: .7rem 1.25rem; font-size: .78rem; letter-spacing: .18em; flex: none; }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; background: var(--pearl); color: var(--ink); max-width: min(46rem, calc(100vw - 1.5rem)); width: 100%; box-shadow: 0 30px 60px -20px rgba(30, 30, 20, .5); }
dialog:focus, dialog:focus-visible { outline: none; }
dialog::backdrop { background: rgba(28, 36, 30, .62); }
.viewer { max-width: min(70rem, calc(100vw - 1rem)); background: #1d241f; }
.viewer img { width: 100%; height: auto; max-height: 86vh; object-fit: contain; }
.dlg-close {
  position: absolute; top: .6rem; right: .6rem; z-index: 2; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 0; background: rgba(247, 242, 233, .9); color: var(--palm); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.hosts { position: relative; padding: 2rem 1.5rem 1.5rem; }
.hosts h2 { margin: 0 2.5rem 0 0; font-family: var(--serif); font-weight: 500; font-size: 1.9rem; color: var(--palm); }
.hosts__count { margin: .4rem 0 1.25rem; color: var(--palm-soft); }
.hosts__table-wrap { max-height: 46vh; overflow: auto; border: 1px solid var(--linen-deep); background: #fffdf9; }
.hosts table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.hosts th, .hosts td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--linen); vertical-align: top; }
.hosts th { position: sticky; top: 0; background: var(--linen); font-weight: 500; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--palm); }
.hosts td.num { text-align: center; }
.hosts .empty { padding: 1.5rem; text-align: center; color: var(--palm-soft); }
.hosts__actions { display: grid; gap: .6rem; margin-top: 1.25rem; }
.hosts__note { margin: 1rem 0 0; font-size: .84rem; line-height: 1.5; color: var(--palm-soft); }

/* ======================================================================
   Wider faces grow from the column
   ====================================================================== */
@media (min-width: 600px) {
  :root { --gutter: 2.5rem; }
  .hero__frame { aspect-ratio: 16 / 9; max-height: 82vh; }
  .hero__frame img { object-position: 50% 40%; }
  .hero__frame::before {
    background:
      radial-gradient(ellipse 48% 30% at 50% 22%, rgba(247, 242, 233, .88) 0%, rgba(247, 242, 233, .66) 48%, rgba(247, 242, 233, 0) 100%),
      linear-gradient(to bottom, rgba(247, 242, 233, .5) 0%, rgba(247, 242, 233, 0) 14%);
  }
  .headline br { display: none; }
  .when__line { max-width: 34rem; font-size: 1.6rem; }
  .layout { max-width: 40rem; margin: 0 auto; }
}

@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .bar { display: none; }
  .hero__frame { height: min(56.25vw, 86vh); max-height: none; aspect-ratio: auto; }
  .hero__frame img { object-position: 50% 45%; }
  .hero__type { padding-top: 2.25rem; }
  .kicker { margin-top: 3.25rem; font-size: 1.4rem; }
  .headline { max-width: none; }
  .hero__rsvp {
    display: inline-flex; position: absolute; z-index: 3; top: 1.6rem; right: 2rem;
    width: auto; min-height: 2.75rem; padding: .6rem 1.4rem; font-size: .74rem;
  }
  .hero__view { right: 2rem; bottom: 1.5rem; }
  .wordmark { font-size: .78rem; }
  .sample-mark { font-size: .68rem; padding: .4rem .8rem .42rem 1rem; }

  .when { padding: 2.75rem var(--gutter) 3rem; }
  .when__line { max-width: 52rem; font-size: 1.85rem; }

  .layout {
    max-width: 72rem; padding: 0 3rem; display: grid;
    grid-template-columns: minmax(0, 1fr) 25rem; gap: 0 6rem; align-items: start;
  }
  .story { grid-column: 1; }
  .rsvp {
    grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 2rem;
    margin-top: .5rem; padding: 2.25rem 2rem 1.75rem;
    background: #fbf8f2; border: 1px solid var(--line);
    box-shadow: 0 24px 50px -36px rgba(60, 50, 30, .55);
  }
  .rsvp__title { font-size: 2.3rem; }
  .done__plate { aspect-ratio: 16 / 11; max-width: none; }
  .done__title { font-size: 1.75rem; }
  .lede { font-size: 1.5rem; }
  .three { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
  .three li { grid-template-columns: 1fr; }
  .three p { grid-column: 1; }
  .plates { gap: 1rem; }
  .foot { margin-top: 4rem; }
}

@media (min-width: 1440px) {
  .layout { max-width: 78rem; }
}
