:root {
  --paper: #f5efe9;
  --ink: #2b231d;
  --tan: #c39a6b;
  --muted: #7b7067;
  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
  --vh: 1vh;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

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

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url('../img/patron.jpg');
  background-repeat: repeat;
  background-size: 550px auto;
  background-attachment: fixed;
  font-family: Quicksand, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--paper);
  opacity: .82;
  pointer-events: none;
  z-index: 0;
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

.full-viewport {
  min-height: calc(var(--vh) * 100);
}

.pad-safe {
  padding-top: calc(20px + var(--safe-top));
  padding-right: calc(16px + var(--safe-right));
  padding-bottom: calc(20px + var(--safe-bottom));
  padding-left: calc(16px + var(--safe-left));
}

.mb-safe {
  height: calc(8px + var(--safe-bottom));
}

.frame {
  position: absolute;
  inset: 12px;
  border: 2px solid var(--ink);
  border-radius: 20px;
  pointer-events: none;
  z-index: 1;
}

#welcome, .hero-message, .venue-section, .rsvp-section {
  position: relative;
  z-index: 2;
}

.welcome-inner {
  max-width: 480px;
}

.heart {
  position: relative;
  width: 120px;
  aspect-ratio: 1/1;
  isolation: isolate;
  transform-origin: center;
  will-change: transform;
  margin-inline: auto;
}

.heart-svg {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .05));
}

.heart-fill {
  fill: var(--tan);
}

.heart-stroke {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}

.badge-date {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%);
  width: min(72%, 110px);
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: clamp(14px, 4.4vw, 18px);
  line-height: 1.05;
  letter-spacing: .2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  z-index: 3;
  pointer-events: none;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  10% { transform: scale(1.06); }
  20% { transform: scale(1); }
  30% { transform: scale(1.04); }
  40% { transform: scale(1); }
  100% { transform: scale(1); }
}

.heart.pulse {
  animation: heartbeat 1.8s ease-in-out infinite;
}

@keyframes ring {
  0% { transform: translate(-50%, -50%) scale(.55); opacity: .35; }
  60% { opacity: .10; }
  100% { transform: translate(-50%, -50%) scale(1.35); opacity: 0; }
}

.heart.pulse::before, .heart.pulse::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160px;
  height: 160px;
  border-radius: 9999px;
  transform: translate(-50%, -50%) scale(.55);
  z-index: 0;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(195, 154, 107, .55) inset, 0 0 32px 8px rgba(195, 154, 107, .18);
  background: radial-gradient(circle, rgba(195, 154, 107, .18) 0%, rgba(195, 154, 107, .10) 45%, rgba(195, 154, 107, 0) 70%);
  animation: ring 1.8s ease-out infinite;
}

.heart.pulse::after {
  animation-delay: .9s;
}

.overline {
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  margin: 0;
}

.script-title {
  font-family: "Great Vibes", cursive;
  font-size: 44px;
  line-height: 1;
  margin: 0;
  color: var(--ink);
}

.event-line {
  color: var(--muted);
}

.countdown {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
}

.cd-box {
  min-width: 64px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cd-box span {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.cd-box small {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.btn-brand {
  --bs-btn-bg: var(--tan);
  --bs-btn-border-color: var(--tan);
  --bs-btn-hover-bg: #b98f5f;
  --bs-btn-hover-border-color: #b98f5f;
  --bs-btn-active-bg: #ad8456;
  --bs-btn-active-border-color: #ad8456;
  color: #fff;
  font-weight: 800;
  border-radius: 16px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .heart.pulse { animation: none; }
  .heart.pulse::before, .heart.pulse::after { animation: none; opacity: 0; }
}

@media (max-width: 360px) {
  .badge-date { font-size: clamp(13px, 4vw, 16px); width: min(70%, 100px); }
}

.hidden {
  display: none !important;
}

.curtain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: saturate(1.2) blur(2px);
  animation: fadeIn .4s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.curtain.closing {
  animation: fadeOut .5s ease both;
}

.curtain-inner {
  height: 100%;
  display: grid;
  place-items: center;
}

.video-wrap {
  width: min(92vw, 460px);
  aspect-ratio: 9/16;
  background: rgba(0, 0, 0, .35);
  border: 2px solid rgba(255, 255, 255, .35);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 18px 52px rgba(0, 0, 0, .35);
}

.intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.v-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.v-controls .btn {
  --bs-btn-bg: #ffffff;
  --bs-btn-color: #222;
  --bs-btn-hover-bg: #f1f1f1;
  --bs-btn-border-color: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}

.progress-line {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 5px;
  background: rgba(255, 255, 255, .3);
  border-radius: 999px;
  overflow: hidden;
}

.progress-line span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--tan), #e6c49a);
  transition: width .25s linear;
}

.btn-close-video {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.btn-close-video:active {
  transform: scale(0.9);
  background-color: rgba(0, 0, 0, 0.8);
}

.hero-message {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  z-index: 2;
}

.hero-message::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(195, 154, 107, .14) 0%, rgba(195, 154, 107, .06) 35%, rgba(195, 154, 107, 0) 65%), linear-gradient(180deg, #f5efe9 0%, #f0e6da 100%);
  z-index: 0;
  pointer-events: none;
  opacity: .98;
}

.hero-message .container, .hero-message .scroll-cue {
  position: relative;
  z-index: 1;
}

.hero-message .container {
  max-width: 100%;
  padding: 0;
}

.hero-title {
  font-size: clamp(40px, 10.5vw, 72px);
  line-height: 1.03;
  letter-spacing: -.2px;
  margin: 0 0 1rem;
  font-family: "Great Vibes", cursive;
  text-wrap: balance;
}

@media (max-width: 340px) {
  .hero-title { font-size: clamp(36px, 11.5vw, 54px); letter-spacing: -.15px; }
}

.hero-title .highlight {
  color: var(--tan);
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .05);
}

.hero-subtext {
  font-family: Quicksand, system-ui, sans-serif;
  font-size: clamp(15px, 4.2vw, 17px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 92%;
}

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
  animation: fadeInUp 2s ease forwards;
}

.scroll-cue i {
  font-size: 1.4rem;
  color: var(--tan);
  animation: bounceDown 2s ease-in-out infinite;
}

.scroll-text {
  font-size: .85rem;
  color: var(--muted);
  letter-spacing: .02em;
  margin-top: 4px;
}

@keyframes bounceDown {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(6px); }
  60% { transform: translateY(3px); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-mark {
  display: block;
  width: calc(100vw - (var(--safe-left) + var(--safe-right)));
  max-width: 100vw;
  max-height: calc(var(--vh) * 48);
  height: auto;
  margin-inline: auto;
  margin-bottom: clamp(12px, 3.5vw, 20px);
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .04));
  opacity: .98;
}

.quote-section {
  position: relative;
  overflow: hidden;
  background-color: var(--paper);
  padding-top: 4rem;
  padding-bottom: 4rem;
  z-index: 2;
}

.quote-section .container {
  position: relative;
  z-index: 2;
}

.quote-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(195, 154, 107, 0.25), transparent 60%);
  filter: blur(60px);
  z-index: 1;
  pointer-events: none;
  animation: floatMesh1 18s ease-in-out infinite alternate;
  transform-origin: center;
}

.quote-section::after {
  content: "";
  position: absolute;
  bottom: -50%;
  right: -50%;
  width: 180%;
  height: 180%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.6), transparent 50%);
  filter: blur(80px);
  z-index: 1;
  pointer-events: none;
  animation: floatMesh2 15s ease-in-out infinite alternate-reverse;
  transform-origin: center;
}

.icon-dove {
  color: var(--tan);
  font-size: 28px;
  opacity: 0.9;
  animation: floatIcon 6s ease-in-out infinite;
}

.quote-text {
  font-family: "Great Vibes", cursive;
  font-size: clamp(28px, 6vw, 42px);
  color: var(--ink) !important;
  opacity: 1 !important;
  line-height: 1.3;
  margin-bottom: 0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.quote-ref {
  color: var(--muted);
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 1rem;
  position: relative;
  z-index: 2;
}

.quote-divider {
  border-top: 2px solid var(--tan);
  opacity: 0.3;
  width: 60px;
  margin: 2rem auto;
  position: relative;
  z-index: 2;
}

.quote-footer {
  font-size: 0.95rem;
  max-width: 400px;
  margin: 0 auto;
  color: var(--muted);
  position: relative;
  z-index: 2;
}

@keyframes floatMesh1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10%, 10%) scale(1.1); }
  100% { transform: translate(-5%, 15%) scale(0.95); }
}

@keyframes floatMesh2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-10%, -5%) scale(1.2); }
  100% { transform: translate(5%, -15%) scale(1); }
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.venue-section {
  position: relative;
  z-index: 2;
  background: radial-gradient(120% 80% at 50% 0%, rgba(195, 154, 107, .10) 0%, rgba(195, 154, 107, .04) 40%, rgba(195, 154, 107, 0) 70%), var(--paper);
  color: var(--ink);
  padding-top: calc(28px + var(--safe-top));
  padding-bottom: calc(28px + var(--safe-bottom));
}

.venue-title {
  font-family: "Great Vibes", cursive;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.1;
  margin-bottom: .25rem;
  color: var(--ink);
}

.venue-sub {
  font-family: Quicksand, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(14px, 4.2vw, 16px);
  color: var(--muted);
  margin-bottom: .75rem;
}

@media (max-width: 360px) {
  .venue-title { font-size: clamp(24px, 8vw, 34px); }
}

.rsvp-section {
  position: relative;
  z-index: 2;
  background: radial-gradient(120% 80% at 50% 0%, rgba(195, 154, 107, .10) 0%, rgba(195, 154, 107, .06) 40%, rgba(195, 154, 107, 0) 70%), url('../img/patron.jpg') center/cover no-repeat, var(--paper);
  padding-top: calc(28px + var(--safe-top));
  padding-bottom: calc(28px + var(--safe-bottom));
}

.rsvp-surface {
  max-width: 560px;
  background: rgba(245, 239, 233, .92);
  border: 2px solid rgba(43, 35, 29, .18);
  border-radius: 20px;
  padding: 20px 16px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .06);
  color: var(--ink);
}

.rsvp-title {
  font-family: "Great Vibes", cursive;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: .5rem;
}

.rsvp-text {
  font-family: Quicksand, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: clamp(14px, 4.2vw, 17px);
  line-height: 1.6;
  color: var(--ink);
}

.btn-rsvp {
  --bs-btn-bg: var(--tan);
  --bs-btn-border-color: var(--tan);
  --bs-btn-hover-bg: #b98f5f;
  --bs-btn-hover-border-color: #b98f5f;
  --bs-btn-active-bg: #ad8456;
  --bs-btn-active-border-color: #ad8456;
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(195, 154, 107, .28);
}

.rsvp-foot {
  color: var(--muted);
}

@media (max-width: 360px) {
  .rsvp-surface { padding: 18px 12px; }
}