/* ==========================================================================
   Wedding site — shared styles
   Booth page (index.html) + invitation page (invitation.html)
   ========================================================================== */

:root {
  --burgundy: #4b0505;
  --burgundy-deep: #2a0202;
  --wine: #6e1014;
  --cream: #f6ecd9;
  --cream-soft: #fff6e2;
  --ink: #2a1414;
  --muted: #b99a8a;
  --brass-light: #f1d9a4;
  --brass: #c9a25c;
  --brass-dark: #7d5a24;

  --font-script: "Pinyon Script", cursive;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Manrope", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--burgundy);
  /* soft vignette + fine paper grain */
  background-image:
    radial-gradient(ellipse at 50% 30%, rgba(255, 220, 200, 0.08), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, 0.45), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-attachment: fixed;
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.6;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--brass-light);
  outline-offset: 3px;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

.script {
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 1.1;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.95em 2.2em;
  border: 1px solid var(--brass);
  border-radius: 999px;
  background: transparent;
  color: var(--cream-soft);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}

.btn:hover {
  background: var(--brass);
  color: var(--burgundy-deep);
}

.btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Photo strip (used on both pages)
   ========================================================================== */

.strip {
  --strip-w: 200px;
  width: var(--strip-w);
  margin: 0;
  padding: 12px 12px 0;
  background: var(--cream);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25);
  color: var(--ink);
}

.strip__frame {
  position: relative;
  aspect-ratio: 5 / 4;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--burgundy);
}

.strip__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.strip__frame--title {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 40%, var(--wine), var(--burgundy-deep));
  color: var(--cream-soft);
  text-align: center;
}

.strip__frame--title .script {
  font-size: calc(var(--strip-w) * 0.19);
}

.strip__caption {
  margin: 0;
  padding: 4px 0 12px;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
  color: #8a6b5e;
}

/* ==========================================================================
   Booth page — a steel shadow box holding the photo strip
   ========================================================================== */

.booth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 3.5vh, 2rem);
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(2rem, 5vh, 3rem) 16px;
  text-align: center;
}

.booth__intro .eyebrow {
  font-size: clamp(0.95rem, 3.2vw, 1.25rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--cream-soft);
}

.booth__intro .script {
  margin: 0.1rem 0 0;
  font-size: clamp(2.8rem, 10vw, 3.6rem);
  color: var(--cream-soft);
}

/* Steel shadow box (frame.png), with the strip sitting inside the recess */
.shadowbox {
  --box-w: min(240px, 62vw);
  position: relative;
  width: var(--box-w);
  aspect-ratio: 408 / 799;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.5));
}

.shadowbox__frame {
  width: 100%;
  height: 100%;
}

/* Clips the strip to the opening of the box while it drops in */
.shadowbox__recess {
  position: absolute;
  /* top edge = the inner lip of the bezel, where the strip comes out */
  inset: 11% 11.5% 4% 11.5%;
  overflow: hidden;
}

.shadowbox .strip {
  --strip-w: calc(var(--box-w) * 0.39);
  /* resting distance below the lip, so the strip's bottom edge sits on the
     floor line of the box (~89% down the frame) */
  --rest: calc(var(--box-w) * 0.255);
  position: absolute;
  top: 0;
  left: 50%;
  padding: calc(var(--strip-w) * 0.04) calc(var(--strip-w) * 0.04) calc(var(--strip-w) * 0.2);
  background: #f4f4f2;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, var(--rest));
  transform-origin: 50% 0;
}

.shadowbox .strip__frame {
  aspect-ratio: 1 / 0.74;
  margin-bottom: calc(var(--strip-w) * 0.04);
  background: #222;
}

.shadowbox .strip__frame img {
  /* trims the thin edge lines left on the source photos */
  transform: scale(1.04);
}

/* Strip prints out of the lip: the rollers push it in short, even jerks with
   pauses, then it falls free under gravity and settles with a small bounce. */
.js .shadowbox .strip {
  animation: print-feed 3.8s linear 0.5s both;
}

@keyframes print-feed {
  0%   { transform: translate(-50%, -100%); }
  12%  { transform: translate(-50%, -100%); animation-timing-function: ease-in; } /* motor spins up */
  /* first pushes are short and slow while the rollers grip */
  22%  { transform: translate(-50%, -91%); }
  26%  { transform: translate(-50%, -91%); }
  35%  { transform: translate(-50%, -78%) rotate(0.15deg); }
  39%  { transform: translate(-50%, -78%) rotate(0.15deg); }
  47%  { transform: translate(-50%, -61%) rotate(-0.1deg); }
  50%  { transform: translate(-50%, -61%) rotate(-0.1deg); }
  57%  { transform: translate(-50%, -42%) rotate(0.2deg); }
  60%  { transform: translate(-50%, -42%) rotate(0.2deg); }
  66%  { transform: translate(-50%, -23%) rotate(-0.15deg); }
  68%  { transform: translate(-50%, -23%) rotate(-0.15deg); }
  73%  { transform: translate(-50%, -5%) rotate(0.25deg); }
  76%  { transform: translate(-50%, -5%) rotate(0.25deg); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  /* released: falls to rest */
  86%  { transform: translate(-50%, var(--rest)) rotate(-0.9deg); animation-timing-function: ease-out; }
  91%  { transform: translate(-50%, calc(var(--rest) - 4px)) rotate(0.5deg); animation-timing-function: ease-in; }
  95%  { transform: translate(-50%, var(--rest)) rotate(-0.25deg); animation-timing-function: ease-out; }
  98%  { transform: translate(-50%, calc(var(--rest) - 1px)) rotate(0.1deg); }
  100% { transform: translate(-50%, var(--rest)); }
}

.booth__date {
  margin: 0;
  font-family: "Oranienbaum", var(--font-serif);
  font-size: clamp(2.8rem, 11vw, 3.6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--cream-soft);
}

.btn--square {
  border-color: rgba(255, 246, 226, 0.75);
  border-radius: 0;
  padding: 0.95em 1.6em;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.btn--square:hover {
  background: var(--cream-soft);
  border-color: var(--cream-soft);
}

/* Date and button follow the strip in */
.js .booth [data-after] {
  opacity: 0;
  transform: translateY(10px);
  animation: enter 0.9s var(--ease-out) forwards;
  animation-delay: calc(0.3s + var(--i, 0) * 0.2s);
}

/* ==========================================================================
   Invitation page
   ========================================================================== */

.container {
  width: min(1040px, 100%);
  margin-inline: auto;
  padding-inline: 16px;
}

.section {
  padding-block: clamp(4rem, 10vw, 7rem);
  text-align: center;
}

.section--light {
  background: var(--cream-soft);
  color: var(--ink);
}

.section--light .eyebrow {
  color: #9a6a5a;
}

.section__title {
  margin: 0.4rem 0 2.5rem;
  font-family: var(--font-script);
  font-size: clamp(2.6rem, 7vw, 3.8rem);
  font-weight: 400;
  line-height: 1.1;
}

.section--light .section__title {
  color: var(--burgundy);
}

.divider {
  width: 64px;
  height: 1px;
  margin: 1.5rem auto;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}

/* Top bar */
.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 16px;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.topbar a {
  color: var(--muted);
  text-decoration: none;
}

.topbar a:hover {
  color: var(--cream-soft);
}

.monogram {
  font-family: var(--font-script);
  font-size: 1.8rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cream-soft);
}

/* Hero */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6rem 16px 4rem;
  overflow: hidden;
  text-align: center;
}

.hero__names {
  margin: 0.6rem 0 0.2rem;
  font-family: var(--font-script);
  font-size: clamp(3.4rem, 13vw, 7.5rem);
  font-weight: 400;
  line-height: 1.05;
  color: var(--cream-soft);
}

.hero__names span {
  display: block;
  font-size: 0.55em;
  color: var(--brass-light);
}

.hero__date {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(0.85rem, 2.4vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

.hero__place {
  margin: 0.6rem 0 2.4rem;
  font-style: italic;
  color: var(--muted);
}

.hero__strip {
  position: absolute;
  top: 50%;
  display: none;
}

.hero__strip .strip {
  /* shrinks with the window so the strips fit beside the names */
  --strip-w: clamp(100px, 14vw, 150px);
}

.hero__strip .strip__caption {
  white-space: nowrap;
  letter-spacing: 0.18em;
}

.hero__strip--left {
  left: max(2vw, 16px);
  transform: translateY(-50%) rotate(-8deg);
}

.hero__strip--right {
  right: max(2vw, 16px);
  transform: translateY(-46%) rotate(7deg);
}

@media (min-width: 640px) {
  .hero__strip {
    display: block;
  }
}

.scroll-cue {
  position: absolute;
  bottom: 24px;
  left: 50%;
  width: 1px;
  height: 48px;
  background: linear-gradient(var(--brass), transparent);
  animation: cue 2.4s var(--ease-out) infinite;
}

@keyframes cue {
  0% { transform: translateX(-50%) scaleY(0); transform-origin: top; }
  50% { transform: translateX(-50%) scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: translateX(-50%) scaleY(0); transform-origin: bottom; }
}

/* Countdown */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 20px);
  max-width: 560px;
  margin: 0 auto;
}

.countdown__unit {
  padding: 1.1rem 0.4rem 0.9rem;
  border: 1px solid rgba(75, 5, 5, 0.18);
  border-radius: 14px;
  background: #fffaf0;
}

.countdown__value {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--burgundy);
}

.countdown__label {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #9a6a5a;
}

.countdown__done {
  margin: 0;
  font-family: var(--font-script);
  font-size: 2.6rem;
  color: var(--burgundy);
}

/* Event cards */
.cards {
  display: grid;
  gap: 20px;
  text-align: center;
}

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

.card {
  padding: 2.4rem 1.6rem;
  border: 1px solid rgba(201, 162, 92, 0.45);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.12);
}

.card h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-script);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--cream-soft);
}

.card__time {
  margin: 0 0 1rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--brass-light);
}

.card p {
  margin: 0;
}

.card .btn {
  margin-top: 1.4rem;
}

/* Timeline */
.timeline {
  max-width: 520px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  text-align: left;
}

.timeline li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(75, 5, 5, 0.14);
}

.timeline li:last-child {
  border-bottom: 0;
}

.timeline time {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--burgundy);
  padding-top: 0.25em;
}

.timeline strong {
  display: block;
  font-weight: 500;
  font-size: 1.25rem;
}

.timeline span {
  color: #7a5a50;
}

/* Video placeholder */
.video {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  max-width: 820px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(201, 162, 92, 0.45);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 45%, rgba(110, 16, 20, 0.9), var(--burgundy-deep));
}

.video video,
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.video__placeholder {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.video__play {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid var(--brass);
  border-radius: 50%;
}

.video__play::before {
  content: "";
  margin-left: 5px;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent var(--brass-light);
}

/* Dress code swatches */
.swatches {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 1.8rem 0 0;
  padding: 0;
  list-style: none;
}

.swatches li {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.prose {
  max-width: 560px;
  margin: 0 auto;
}

/* Reply */
.reply {
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1.4rem;
  border: 1px dashed rgba(201, 162, 92, 0.7);
  border-radius: 18px;
  text-align: left;
}

.reply__note {
  margin: 0 0 1.4rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-light);
}

.reply fieldset {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.field label,
.field legend,
.field__label {
  display: block;
  margin-bottom: 0.35rem;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input:not([type="radio"]),
.field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(201, 162, 92, 0.45);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--cream);
  font: inherit;
  font-size: 1rem;
}

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

.field--choice input {
  accent-color: var(--brass);
}

.field--choice label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1.4rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cream);
}

.field textarea {
  resize: vertical;
}

/* Number-of-guests stepper */
.field__label {
  margin: 0 0 0.35rem;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
}

.stepper__btn {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--brass);
  border-radius: 50%;
  background: transparent;
  color: var(--cream-soft);
  font-family: var(--font-sans);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, opacity 0.3s;
}

.stepper__btn:not(:disabled):hover {
  background: var(--brass);
  color: var(--burgundy-deep);
}

.stepper__btn.is-limit {
  opacity: 0.35;
  cursor: default;
}

.stepper__btn.is-limit:not(:disabled):hover {
  background: transparent;
  color: var(--cream-soft);
}

.stepper__value {
  min-width: 2ch;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-variant-numeric: tabular-nums;
  color: var(--cream-soft);
}

.reply__status {
  min-height: 1.4em;
  margin: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--brass-light);
}

.reply__status.is-error {
  color: #ffb4a8;
}

.reply :disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.reply .btn {
  justify-self: center;
  margin-top: 0.6rem;
}

/* Footer */
.footer {
  padding: 4rem 16px 3rem;
  text-align: center;
}

.footer .monogram {
  font-size: 3rem;
}

.footer p {
  margin: 0.4rem 0 0;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Reveal on scroll (only when JS is running, so content never stays hidden) */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Guest greeting: hidden until a name is set; room is reserved on personal links */
.hero__greeting {
  margin-bottom: 1rem;
  color: var(--brass-light);
}

.hero__greeting:empty {
  display: none;
}

.has-guest .hero__greeting:empty {
  display: block;
  min-height: 1.2em;
}

/* Hero entrance */
.js .hero [data-enter] {
  opacity: 0;
  transform: translateY(16px);
  animation: enter 1.1s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 160ms + 150ms);
}

@keyframes enter {
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Page transitions (cross-document view transitions)
   Browsers without support simply navigate as normal.
   ========================================================================== */

@view-transition {
  navigation: auto;
}

/* The couple's names morph between the booth and the invitation hero */
.booth__intro .script,
.hero__names {
  view-transition-name: couple-names;
}

::view-transition-old(root) {
  animation: vt-out 0.35s var(--ease-out) both;
}

::view-transition-new(root) {
  animation: vt-in 0.5s var(--ease-out) 0.1s both;
}

::view-transition-group(couple-names) {
  animation-duration: 0.6s;
  animation-timing-function: var(--ease-out);
}

@keyframes vt-out {
  to { opacity: 0; transform: translateY(-12px); }
}

@keyframes vt-in {
  from { opacity: 0; transform: translateY(16px); }
}

/* Fallback for browsers without cross-document view transitions (Firefox):
   page-transitions.js adds .is-leaving before navigating. */
.vt-fallback body {
  animation: vt-in 0.5s var(--ease-out) both;
}

.vt-fallback.is-leaving body {
  animation: vt-out 0.3s var(--ease-out) both;
}

/* Prerendered in the background (see index.html): wait to play the hero
   entrance until the page is actually shown */
.is-prerendering .hero [data-enter] {
  animation-play-state: paused;
}

/* Arriving via a transition: show the names at once so the morph lands */
.js.vt-arrive .hero .hero__names {
  animation: none;
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js [data-reveal],
  .js .hero [data-enter],
  .js .booth [data-after] {
    opacity: 1;
    transform: none;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* Language toggle */
.i18n-wait body {
  visibility: hidden;
}

.lang {
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(201, 162, 92, 0.55);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  cursor: pointer;
}

.lang:hover {
  color: var(--cream-soft);
}

.lang--corner {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  font-family: var(--font-sans);
}

.topbar__end {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}
