:root {
  --navy: #0e1a2f;
  --navy-2: #16243d;
  --ice: #f3efe6;
  --paper: #f7f5f0;
  --red: #b8202b;
  --red-dark: #951a23;
  --ink: #111827;
  --muted: #5b6272;
  --rule: rgba(14, 26, 47, 0.18);

  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --nav-h: 3.75rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--nav-h);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--navy); color: var(--ice);
  padding: 0.75rem 1rem; text-decoration: none;
}
.skip:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* Shared type */
.kicker, .label {
  font: 600 0.75rem/1.3 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.kicker { color: var(--red); }
.kicker::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 1.5rem; height: 2px; margin: -0.15em 0.75rem 0 0;
  background: currentColor;
}
@media (max-width: 420px) {
  .kicker { font-size: 0.6875rem; letter-spacing: 0.12em; }
}
.label { color: var(--muted); }
.label--light { color: rgba(243, 239, 230, 0.65); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0 1.75rem;
  background: var(--navy); color: var(--ice);
  border: 0; border-radius: 2px;
  font: 600 0.875rem/1 var(--sans);
  letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--red); }
.btn:active { transform: translateY(1px); }
.btn span[aria-hidden] { transition: transform 0.2s ease; }
.btn:hover span[aria-hidden] { transform: translateX(3px); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.75; cursor: progress; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  background: rgba(247, 245, 240, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav__mark {
  font: 900 1.5rem/1 var(--display);
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--navy);
}
.nav__link {
  display: inline-flex; align-items: center;
  min-height: 2.75rem; padding: 0 0.25rem;
  font: 600 0.8125rem/1 var(--sans);
  letter-spacing: 0.2em;
  text-decoration: none;
  color: var(--navy);
  border-bottom: 2px solid var(--red);
}
.nav__link:hover { color: var(--red); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
}
.hero__copy {
  position: relative;
  padding: clamp(2rem, 7vw, 5rem) var(--gutter) 2rem;
  display: flex; flex-direction: column; justify-content: center;
  gap: 1.25rem;
  isolation: isolate;
  overflow: hidden;
}
.hero__numeral {
  position: absolute; z-index: -1;
  right: -0.05em; top: 50%;
  transform: translateY(-50%);
  font: 900 clamp(14rem, 48vw, 34rem)/0.8 var(--display);
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(14, 26, 47, 0.08);
  pointer-events: none;
  user-select: none;
}
.hero__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  color: var(--navy);
  line-height: 0.86;
  letter-spacing: 0.005em;
}
.hero__title > span { display: block; }
.hero__title-pre {
  font-size: clamp(1.5rem, 4.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--red);
  margin-bottom: 0.35em;
}
.hero__title-pre sup { font-size: 0.55em; vertical-align: 0.6em; line-height: 0; }
.hero__title-main { font-size: clamp(3.5rem, 15vw, 7.5rem); }
.hero__title-post {
  font-size: clamp(1.625rem, 6.4vw, 3.25rem);
  font-weight: 700;
  margin-top: 0.3em;
  line-height: 0.95;
}
.hero__lede {
  font: 400 clamp(1.1875rem, 2.6vw, 1.5rem)/1.4 var(--serif);
  color: var(--ink);
  max-width: 30ch;
}
.hero__time {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1.5rem;
  font: 700 1.5rem/1 var(--display);
  letter-spacing: 0.04em;
  color: var(--navy);
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  max-width: 26rem;
}
.hero__actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem;
  padding-top: 0.25rem;
}
.invite-only {
  font: 600 0.6875rem/1 var(--sans);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 0.6rem;
}
.invite-only::before {
  content: ""; width: 0.45rem; height: 0.45rem;
  background: var(--red); transform: rotate(45deg);
}

.hero__media {
  position: relative;
  margin: 0;
  background: var(--navy);
  overflow: hidden;
}
.hero__media img {
  width: 100%;
  aspect-ratio: 4 / 4.2;
  max-height: 72svh;
  object-fit: cover;
  object-position: 50% 18%;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__copy > :not(.hero__numeral) { animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
  .hero__copy > :nth-child(3) { animation-delay: 0.08s; }
  .hero__copy > :nth-child(4) { animation-delay: 0.16s; }
  .hero__copy > :nth-child(5) { animation-delay: 0.22s; }
  .hero__copy > :nth-child(6) { animation-delay: 0.28s; }
  .hero__media img { animation: settle 1.4s cubic-bezier(.2,.7,.2,1) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes settle { from { transform: scale(1.04); } }

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    min-height: calc(100svh - var(--nav-h));
    max-height: 60rem;
  }
  .hero__copy { padding-block: 4rem; gap: 1.5rem; }
  .hero__title-main { font-size: clamp(5rem, 8.6vw, 9rem); }
  .hero__title-post { font-size: clamp(2rem, 3.4vw, 3.5rem); }
  .hero__title-pre { font-size: clamp(1.75rem, 2.4vw, 2.5rem); }
  .hero__numeral { font-size: clamp(20rem, 30vw, 34rem); right: 0.02em; }
  /* Image fills the column without driving its height, so it can't spill out */
  .hero__media img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    aspect-ratio: auto;
    max-height: none;
    object-position: 50% 22%;
  }
  }

/* Heritage sock stripes */
.stripes {
  height: 22px;
  background: linear-gradient(
    to bottom,
    var(--navy) 0 6px,
    var(--ice) 6px 9px,
    var(--red) 9px 15px,
    var(--ice) 15px 18px,
    var(--navy) 18px
  );
}

/* Statement */
.statement {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
    var(--navy);
  color: var(--ice);
  padding: clamp(3.5rem, 10vw, 8rem) var(--gutter);
}
.statement__inner {
  max-width: 76rem; margin: 0 auto;
  display: grid; gap: 2rem;
}
.statement__no {
  font: 900 clamp(6rem, 22vw, 13rem)/0.8 var(--display);
  color: var(--ice);
  margin-top: 0.75rem;
  display: flex; align-items: flex-start; gap: 0.1em;
}
.statement__no span {
  font-size: 0.18em; letter-spacing: 0.1em;
  color: var(--red); padding-top: 0.4em;
  text-transform: uppercase;
}
.statement__lead {
  font: 400 clamp(1.5rem, 3.6vw, 2.625rem)/1.28 var(--serif);
  letter-spacing: -0.005em;
  text-wrap: pretty;
}
.statement__lead em {
  font-style: italic;
  background-image: linear-gradient(var(--red), var(--red));
  background-size: 100% 2px;
  background-position: 0 92%;
  background-repeat: no-repeat;
}
.facts {
  margin: clamp(2.5rem, 6vw, 4rem) 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(243, 239, 230, 0.25);
  border-bottom: 1px solid rgba(243, 239, 230, 0.25);
}
.facts > div {
  padding: 1.25rem 1rem 1.25rem 0;
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 0.5rem;
}
.facts > div + div { padding-left: 1rem; border-left: 1px solid rgba(243, 239, 230, 0.25); }
.facts dt {
  font: 600 0.6875rem/1.35 var(--sans);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(243, 239, 230, 0.7);
}
.facts dd {
  margin: 0;
  font: 900 clamp(2.5rem, 7vw, 4rem)/0.9 var(--display);
}
.facts dd small { font-size: 0.4em; letter-spacing: 0.08em; margin-left: 0.1em; }
.statement__note {
  max-width: 44rem;
  font-size: 1.0625rem;
  color: rgba(243, 239, 230, 0.82);
}
.statement__note strong { color: var(--ice); font-weight: 600; }

@media (min-width: 900px) {
  .statement__inner { grid-template-columns: 14rem minmax(0, 1fr); gap: 4rem; }
}

/* RSVP */
.rsvp {
  max-width: 76rem; margin: 0 auto;
  padding: clamp(3.5rem, 10vw, 8rem) var(--gutter);
  display: grid; gap: 2.5rem;
}
.rsvp__intro { display: grid; gap: 1.25rem; align-content: start; }
.rsvp__title {
  margin: 0;
  font: 900 clamp(3rem, 10vw, 5.5rem)/0.88 var(--display);
  text-transform: uppercase;
  color: var(--navy);
}
.rsvp__intro > p:not(.kicker):not(.rsvp__meta) {
  font: 400 1.25rem/1.45 var(--serif);
  max-width: 34ch;
}
.hero__time .label { margin-right: 0.5rem; }

.rsvp__meta { margin: 0; border-top: 1px solid var(--rule); }
.rsvp__meta > div {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.rsvp__meta dt { color: var(--red); padding-top: 0.2em; }
.rsvp__meta dd { margin: 0; font-size: 0.9375rem; line-height: 1.45; }
.rsvp__meta strong { font-weight: 600; color: var(--navy); }

.confirm__pay {
  display: grid; gap: 1rem; justify-items: start;
  padding: 1.25rem;
  background: var(--paper);
  border-left: 3px solid var(--red);
}

.rsvp__panel {
  background: #fff;
  border-top: 6px solid var(--navy);
  box-shadow: 0 1px 0 var(--rule), 0 24px 48px -32px rgba(14, 26, 47, 0.35);
  padding: clamp(1.5rem, 5vw, 2.75rem);
}
.form { display: grid; gap: 1.25rem; }
.form__row { display: grid; gap: 1.25rem; }
.field { display: grid; gap: 0.5rem; }
.field label {
  font: 600 0.75rem/1 var(--sans);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--navy);
}
.field input {
  width: 100%;
  min-height: 3.5rem;
  padding: 0 1rem;
  font: 400 1.0625rem/1 var(--sans); /* ≥16px prevents iOS zoom */
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(14, 26, 47, 0.28);
  border-radius: 2px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.field input:hover { border-color: var(--navy); }
.field input:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 3px rgba(184, 32, 43, 0.35); }
.field input[aria-invalid="true"] { border-color: var(--red); }

.form__error {
  padding: 0.875rem 1rem;
  border-left: 3px solid var(--red);
  background: rgba(184, 32, 43, 0.07);
  color: var(--red-dark);
  font-size: 0.9375rem; line-height: 1.45;
}

.btn.is-loading .btn__text::after {
  content: ""; display: inline-block;
  width: 0.9em; height: 0.9em; margin-left: 0.75em;
  vertical-align: -0.1em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.confirm { display: grid; gap: 1rem; outline: none; }
.confirm__title {
  margin: 0;
  font: 900 clamp(2.5rem, 8vw, 4rem)/0.9 var(--display);
  text-transform: uppercase;
  color: var(--navy);
}
.confirm__body { font: 400 1.25rem/1.45 var(--serif); }
.confirm__fine {
  padding-top: 1rem; border-top: 1px solid var(--rule);
  font: italic 400 0.9375rem/1.4 var(--serif);
  color: var(--muted);
}
@media (prefers-reduced-motion: no-preference) {
  .confirm:not([hidden]) { animation: rise 0.6s cubic-bezier(.2,.7,.2,1) both; }
}

@media (min-width: 560px) {
  .form__row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .rsvp { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 5rem; align-items: start; }
}

/* Footer */
.footer {
  background: var(--navy);
  color: rgba(243, 239, 230, 0.75);
  text-align: center;
  padding: 3.5rem var(--gutter) calc(3rem + env(safe-area-inset-bottom));
  display: grid; gap: 0.375rem;
  font-size: 0.9375rem;
  border-top: 6px solid var(--red);
}
.footer__name {
  font: 900 1.625rem/1.05 var(--display);
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ice);
  margin-bottom: 0.25rem;
}
.footer__tag { font: italic 400 1.0625rem/1.4 var(--serif); margin-top: 0.75rem; }
.footer__est {
  margin-top: 1.25rem;
  font: 600 0.6875rem/1 var(--sans);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(243, 239, 230, 0.5);
}
