/* ---------------------------------------------------------------
   Bradford LL — the site typeface (assets/font/)
   --------------------------------------------------------------- */

@font-face {
  font-family: "Bradford LL";
  src: url("assets/font/BradfordLL-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bradford LL";
  src: url("assets/font/BradfordLL-LightItalic.otf") format("opentype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Bradford LL";
  src: url("assets/font/BradfordLL-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bradford LL";
  src: url("assets/font/BradfordLL-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Bradford LL";
  src: url("assets/font/BradfordLL-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bradford LL";
  src: url("assets/font/BradfordLL-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bradford LL";
  src: url("assets/font/BradfordLL-BoldItalic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --serif: "Bradford LL", Georgia, "Times New Roman", serif;
  --ivory: #F5F2EA;
  --ink: #2B2B26;
  --ink-soft: #55534A;
  --moss: #55684D;
  --moss-dark: #3B4A36;
  --outline: #BDB6A3;
  --bloom: #C97B76;
  --bloom-dark: #8E4A46;
  --vase: #8A9680;
  --card: #FFFDF8;
  --focus: #4C7A93;
  --cerulean: #565CCE;
  --cerulean-dark: #454AA5;
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

html {
  background: #9EAFC5;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--serif);
}

main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  /* Transparent — the copy sits straight on the blurred hero, the only
     glass panel is the .rsvp form itself. */
  padding: 8vh 1.25rem 22vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* ---------------------------------------------------------------
   Hero — 3D depth parallax (see hero.js)
   .hero gives the crane-in its scroll distance; .hero__stage is a fixed
   full-viewport backdrop. The crane + progressive blur play out, then
   the frosted <main> sheet scrolls up over the still-blurred hero.
   --------------------------------------------------------------- */

.hero {
  height: 175vh;
}

.hero__stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  /* Fallback shown until (or unless) hero.js paints the canvas. */
  background: var(--ink) url("assets/hero-web.jpg") center 30% / cover no-repeat;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero__overlay {
  --p: 0;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: var(--ivory);
  /* Drift up and fade as the hero scrolls past. */
  transform: translateY(calc(var(--p) * -12vh));
  opacity: calc(1 - var(--p) * 1.6);
  will-change: transform, opacity;
}

/* The hero title ("Victoria & Micah") is drawn by hero.js as WebGL
   layers, not DOM text — the <h1> is visually hidden for a11y only. */

.hero__cue {
  position: absolute;
  bottom: 2.2rem;
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: calc(0.85 - var(--p) * 3);
}

.hero__cue span {
  display: inline-block;
  animation: hero-cue 2.4s ease-in-out infinite;
}

@keyframes hero-cue {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(5px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__cue span { animation: none; }
}

/* Copy that sits straight on the blurred hero, above the glass form. */
.rsvp-copy {
  width: 100%;
  text-align: center;
  color: var(--ivory);
}

.rsvp-copy__kicker {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  opacity: 0.92;
}

.rsvp-copy__date {
  margin: 0 0 1.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  /* Sized off the same content width as the .rsvp block beneath it
     (main's max-width minus its side padding), so the date always
     spans that width edge-to-edge instead of clipping past it.
     614px measured glyph width at 100px font-size for this string. */
  font-size: calc(min(100vw - 2.5rem, 31.5rem) / 6.5);
  line-height: 1;
  white-space: nowrap;
}


/* ---------------------------------------------------------------
   Write-on — a soft pen edge sweeps left to right, so the letters
   draw themselves in. Matches the hero's WebGL write-on (hero.js).
   --------------------------------------------------------------- */

.write-on {
  -webkit-mask-image: linear-gradient(to right, #000 0 38%, transparent 62%);
  mask-image: linear-gradient(to right, #000 0 38%, transparent 62%);
  -webkit-mask-size: 260% 100%;
  mask-size: 260% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
}

.write-on.is-written {
  transition: -webkit-mask-position 1.5s cubic-bezier(0.62, 0.02, 0.24, 1),
    mask-position 1.5s cubic-bezier(0.62, 0.02, 0.24, 1);
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .write-on {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.arrangement-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

#arrangement {
  width: 100%;
  max-width: 26rem;
  height: auto;
}

.vase {
  fill: var(--vase);
  opacity: 0.85;
}

.branch {
  fill: none;
  stroke: var(--moss);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.7;
}

.flower .petal {
  transition: fill 0.4s ease, stroke 0.4s ease;
}

.flower .center {
  transition: fill 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  .flower .petal,
  .flower .center {
    transition: none;
  }
}

.flower-pending .petal {
  fill: none;
  stroke: var(--outline);
  stroke-width: 1;
}

.flower-pending .center {
  fill: none;
  stroke: var(--outline);
  stroke-width: 1;
}

.flower-bloomed .petal {
  fill: var(--bloom);
  stroke: var(--bloom-dark);
  stroke-width: 0.6;
}

.flower-bloomed .center {
  fill: var(--bloom-dark);
}

.flower-removed {
  opacity: 0.12;
}

.tally-caption {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* The one glass panel: just the name fields + yes/no buttons. */
.rsvp {
  width: 100%;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(28px) saturate(1.15);
  -webkit-backdrop-filter: blur(28px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.6);
  /* Concentric with the corner-nearest content (the field input's 8px
     radius, inset by this panel's own padding): 8px + 28px = 36px. */
  border-radius: 2.25rem;
  padding: 1.75rem;
  box-shadow: 0 16px 50px rgba(20, 20, 18, 0.2);
}

.deadline-text {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  text-align: center;
  color: var(--ink-soft);
}

.field-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.field input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.field input::placeholder {
  color: var(--ink-soft);
  opacity: 0.7;
}

.field input:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

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

.btn {
  flex: 1;
  min-width: 10rem;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.btn-yes {
  background: var(--cerulean);
  color: #fff;
}

.btn-yes:hover {
  background: var(--cerulean-dark);
}

.btn-no {
  background: transparent;
  border-color: var(--ink-soft); /* matches the button's own text colour */
  color: var(--ink-soft);
}

.btn-no:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#form-status {
  min-height: 1.2rem;
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  text-align: center;
}

#form-status[data-state="success"] {
  color: var(--moss-dark);
}

#form-status[data-state="error"] {
  color: var(--bloom-dark);
}

/* ---------------------------------------------------------------
   Post-response panel — swaps in for the form once someone replies.
   --------------------------------------------------------------- */

.rsvp-done {
  text-align: center;
}

.rsvp-done__copy {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.55;
}

.calendar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cal-btn {
  display: block;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  border: 1.5px solid var(--outline);
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink);
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cal-btn:hover {
  border-color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
}

.cal-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.linkish {
  margin-top: 1.25rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.linkish:hover {
  color: var(--ink);
}

@media (max-width: 420px) {
  .field-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  .rsvp {
    padding: 1.25rem;
    border-radius: 1.75rem;
  }
}
