:root {
  --paper: #fff7eb;
  --linen: #f2e7d7;
  --ink: #271915;
  --cocoa: #1d1411;
  --mahogany: #743f32;
  --rose: #d99075;
  --copper: #bd6f4f;
  --champagne: #d9b86d;
  --burgundy: #8b3b38;
  --olive: #5a6242;
  --sage: #758060;
  --veil: rgba(255, 247, 235, 0.88);
  --line: rgba(255, 247, 235, 0.24);
  --paper-line: rgba(116, 63, 50, 0.2);
  --gold-line: rgba(217, 184, 109, 0.44);
  --script: "Sylvaur", "Great Vibes", "Snell Roundhand", cursive;
  --serif: "Old Standard TT", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--cocoa);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 18% 14%, rgba(217, 144, 117, 0.4), transparent 30rem),
    radial-gradient(circle at 86% 72%, rgba(217, 184, 109, 0.16), transparent 24rem),
    linear-gradient(135deg, #160f0d 0%, #2d1d18 48%, #15110e 100%);
  font-family: var(--serif);
  letter-spacing: 0;
}

button {
  font: inherit;
}

.page {
  min-height: 100svh;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  padding: clamp(16px, 4vw, 42px);
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(90deg, rgba(19, 12, 10, 0.78), rgba(19, 12, 10, 0.32), rgba(19, 12, 10, 0.78)),
    linear-gradient(180deg, rgba(19, 12, 10, 0.1), rgba(19, 12, 10, 0.42));
}

.backdrop-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(22px) saturate(0.95);
  opacity: 0.72;
  transform: scale(1.07);
}

.invite {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(92vw, 440px);
  overflow: hidden;
  border: 1px solid rgba(217, 184, 109, 0.28);
  border-radius: 8px;
  background: rgba(29, 20, 17, 0.82);
  box-shadow: 0 34px 100px rgba(12, 8, 6, 0.48);
}

.invite::before {
  position: absolute;
  inset: 9px;
  z-index: 3;
  content: "";
  border: 1px solid rgba(255, 247, 235, 0.24);
  border-radius: 5px;
  pointer-events: none;
}

.video-panel {
  display: grid;
  place-items: center;
  position: relative;
  background: #120c0a;
}

.video-panel::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(255, 247, 235, 0.08), transparent 22%),
    linear-gradient(90deg, rgba(217, 184, 109, 0.16), transparent 12%, transparent 88%, rgba(217, 184, 109, 0.12));
  pointer-events: none;
}

.save-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 15;
  background: #120c0a;
  object-fit: contain;
  object-position: center;
}

.details {
  position: relative;
  display: grid;
  align-content: center;
  overflow: hidden;
  padding: clamp(18px, 4vw, 28px);
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 12%, rgba(217, 184, 109, 0.13), transparent 12rem),
    radial-gradient(circle at 92% 88%, rgba(90, 98, 66, 0.12), transparent 12rem),
    linear-gradient(180deg, rgba(255, 247, 235, 0.98), rgba(242, 231, 215, 0.94)),
    linear-gradient(90deg, rgba(189, 111, 79, 0.14), rgba(90, 98, 66, 0.1));
  text-align: center;
}

.details::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    repeating-linear-gradient(90deg, rgba(116, 63, 50, 0.025) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.26) 0 1px, transparent 1px 9px),
    radial-gradient(ellipse at 50% -24%, transparent 0 24%, rgba(217, 184, 109, 0.13) 24.4%, transparent 25% 100%),
    linear-gradient(115deg, transparent 0 46%, rgba(117, 128, 96, 0.08) 46.2% 46.7%, transparent 47% 100%),
    linear-gradient(65deg, transparent 0 48%, rgba(117, 128, 96, 0.07) 48.2% 48.7%, transparent 49% 100%);
  opacity: 0.86;
  pointer-events: none;
}

.details::after {
  position: absolute;
  inset: 12px;
  content: "";
  border: 1px solid var(--gold-line);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 247, 235, 0.36);
  pointer-events: none;
}

.details-content {
  position: relative;
  z-index: 1;
}

.details-content::before,
.details-content::after {
  position: absolute;
  width: 42px;
  height: 42px;
  content: "";
  opacity: 0.24;
  pointer-events: none;
}

.details-content::before {
  top: -5px;
  left: -4px;
  border-top: 1px solid var(--sage);
  border-left: 1px solid var(--sage);
  border-top-left-radius: 28px;
}

.details-content::after {
  right: -4px;
  bottom: -5px;
  border-right: 1px solid var(--sage);
  border-bottom: 1px solid var(--sage);
  border-bottom-right-radius: 28px;
}

.script-line {
  margin: 0 0 4px;
  color: var(--copper);
  font-family: var(--script);
  font-size: clamp(2rem, 7vw, 3.45rem);
  line-height: 0.96;
}

.monogram {
  display: inline-grid;
  min-width: 64px;
  margin: 3px auto 8px;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: color-mix(in srgb, var(--mahogany), transparent 18%);
  font-size: 0.86rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.monogram::before,
.monogram::after {
  width: 18px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--champagne), transparent);
}

.monogram i {
  color: var(--champagne);
  font-style: italic;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 5vw, 2.2rem);
  font-weight: 400;
  line-height: 1.05;
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: min(190px, 70%);
  margin: 13px auto 8px;
}

.ornament::before,
.ornament::after {
  flex: 1;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(116, 63, 50, 0.34));
}

.ornament::after {
  background: linear-gradient(90deg, rgba(116, 63, 50, 0.34), transparent);
}

.ornament span {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--champagne);
  box-shadow:
    -14px 0 0 rgba(189, 111, 79, 0.54),
    14px 0 0 rgba(189, 111, 79, 0.54),
    0 0 13px rgba(217, 184, 109, 0.52);
}

.date-line {
  margin: 0;
  color: #3a2822;
  font-size: clamp(1.6rem, 7vw, 2.8rem);
  line-height: 0.95;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
}

.date-line span {
  color: var(--copper);
}

.place {
  margin: 7px 0 0;
  color: color-mix(in srgb, var(--ink), var(--olive) 34%);
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  margin-top: 20px;
  border: 1px solid var(--paper-line);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 251, 244, 0.64), rgba(242, 231, 215, 0.48));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.countdown div {
  position: relative;
  min-width: 0;
  padding: 15px 6px 12px;
}

.countdown div + div {
  border-left: 1px solid rgba(116, 63, 50, 0.16);
}

.countdown div::before {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 4px;
  content: "";
  border-radius: 50%;
  background: var(--champagne);
  box-shadow: 0 0 10px rgba(217, 184, 109, 0.42);
  transform: translateX(-50%);
}

.countdown span {
  display: block;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  line-height: 1;
}

.countdown small {
  display: block;
  margin-top: 5px;
  color: color-mix(in srgb, var(--mahogany), transparent 22%);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.follow-note {
  margin: 14px 0 0;
  color: color-mix(in srgb, var(--ink), transparent 28%);
  font-size: 0.92rem;
  font-style: italic;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.button {
  min-height: 42px;
  min-width: 132px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 10px 16px 9px;
  letter-spacing: 0.02em;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--champagne), white 24%);
  outline-offset: 3px;
}

.primary {
  color: var(--paper);
  border-color: color-mix(in srgb, var(--champagne), transparent 35%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--copper), white 6%), var(--mahogany));
  box-shadow: inset 0 1px 0 rgba(255, 247, 235, 0.24);
}

.primary:hover {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--copper), white 12%), color-mix(in srgb, var(--mahogany), black 8%));
}

.secondary {
  color: var(--mahogany);
  border-color: rgba(116, 63, 50, 0.3);
  background: rgba(255, 247, 235, 0.28);
}

.secondary:hover {
  border-color: rgba(116, 63, 50, 0.46);
  background: rgba(255, 247, 235, 0.44);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 247, 235, 0.24);
  border-radius: 6px;
  color: var(--paper);
  background: rgba(29, 20, 17, 0.94);
  box-shadow: 0 16px 48px rgba(12, 8, 6, 0.36);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 760px) {
  .invite {
    width: min(94vw, 920px);
    max-height: calc(100svh - clamp(32px, 8vw, 84px));
    grid-template-columns: auto minmax(320px, 1fr);
  }

  .video-panel {
    border-right: 1px solid rgba(217, 184, 109, 0.28);
    box-shadow: 10px 0 26px rgba(116, 63, 50, 0.12);
  }

  .save-video {
    width: auto;
    max-width: 100%;
    height: min(700px, calc(100svh - clamp(32px, 8vw, 84px)));
  }
}

@media (max-width: 560px) {
  .hero {
    align-items: start;
    padding: 0;
  }

  .hero::after,
  .backdrop-video {
    display: none;
  }

  .invite {
    width: 100%;
    min-height: 100svh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .invite::before {
    display: none;
  }

  .save-video {
    width: 100%;
    height: auto;
  }

  .details {
    padding: 22px 16px 24px;
  }

  .details::after {
    inset: 10px;
  }

  .script-line {
    font-size: clamp(2rem, 13vw, 3rem);
  }

  .countdown div {
    padding-right: 4px;
    padding-left: 4px;
  }
}

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

  .button:hover {
    transform: none;
  }
}
