:root {
  color-scheme: light;
  --paper: #fffdf7;
  --page: #f3ead9;
  --ink: #5d2b36;
  --ink-soft: #7a4350;
  --rose: #c97f8a;
  --rose-deep: #a44f63;
  --rose-pale: #f6dde1;
  --gold: #a7804b;
  --gold-line: #cdb083;
  --line: #e3d3b8;
  --radius: 14px;
}

* { box-sizing: border-box; }

html {
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 300px at 50% -80px, #f8e3e6 0%, transparent 60%),
    var(--page);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 72px;
}

/* Festive cut-paper strip across the top. */
.picado-band {
  width: 100%;
  height: 72px;
  background-image: url("./assets/papel-picado.svg");
  background-repeat: repeat-x;
  background-position: center top;
  background-size: auto 100%;
  background-color: var(--rose-deep);
}

#invitation {
  width: min(100% - 32px, 600px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 6vw, 44px) clamp(20px, 5vw, 40px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  display: block;
  width: 120px;
  height: 6px;
  margin: 0 auto 18px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
  border-radius: 3px;
}

.panel h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(28px, 7vw, 36px);
  color: var(--rose-deep);
  margin: 0 0 14px;
}

.panel h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 8px;
}

.panel p,
.panel li,
.panel blockquote {
  font-size: 17px;
  line-height: 1.7;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

h1 {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(52px, 14vw, 84px);
  line-height: 1.05;
  color: var(--rose-deep);
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.date-line {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 21px;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 16px;
}

.cross {
  display: block;
  color: var(--gold);
  font-size: 34px;
  margin-bottom: 12px;
}

/* Hero arch with floral corners. */
.arch-frame {
  margin: 8px auto 16px;
  max-width: 380px;
  position: relative;
}

.arch-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 999px 999px 18px 18px;
  border: 2px solid var(--gold-line);
  outline: 6px solid var(--rose-pale);
  outline-offset: -2px;
  background: var(--rose-pale);
}

.arch-roses {
  position: absolute;
  inset: auto -8px -18px -8px;
  height: 120px;
  background-image: url("./assets/roses.svg");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  pointer-events: none;
}

.intro {
  max-width: 40ch;
  margin: 18px auto 0;
}

.blessing blockquote {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(22px, 6vw, 28px);
  color: var(--ink);
  margin: 0;
}

.blessing blockquote::before,
.blessing blockquote::after {
  color: var(--gold);
}

.blessing blockquote::before { content: "“"; }
.blessing blockquote::after { content: "”"; }

.family-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.family-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.family-grid li {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  padding: 4px 0;
}

.big-date {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(30px, 8vw, 44px);
  margin: 0 0 4px;
  color: var(--ink);
}

.big-date [data-slot="day"] {
  color: var(--rose-deep);
  font-weight: 600;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.countdown div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 4px;
  background: #fff;
}

.countdown span {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.countdown small {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.church-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 23px;
  font-weight: 600;
  margin: 0 0 6px;
}

.church-address {
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.mass-time {
  font-size: 19px;
  font-weight: 500;
  margin: 10px 0 18px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border: 1px solid var(--rose-deep);
}

.actions a:first-child {
  background: var(--rose-deep);
  color: #fff;
}

.actions a:not(:first-child) {
  background: transparent;
  color: var(--rose-deep);
}

.party-venue {
  font-size: 19px;
  margin: 0 0 12px;
}

.party-times {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.party-times li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.party-note {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 8px 0 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.photo-grid button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: var(--rose-pale);
  cursor: pointer;
  min-height: 44px;
  overflow: hidden;
}

.photo-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.signature {
  font-family: "Great Vibes", cursive;
  font-size: 44px;
  color: var(--rose-deep);
  margin: 12px 0 0;
}

/* Welcome overlay card. */
dialog.welcome-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  padding: clamp(28px, 7vw, 48px) clamp(22px, 6vw, 44px);
  width: min(92vw, 440px);
}

dialog.welcome-card::backdrop {
  background: rgba(74, 31, 40, 0.55);
}

dialog.welcome-card h1 {
  font-size: clamp(56px, 15vw, 76px);
}

.welcome-date {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 20px;
  margin: 0 0 12px;
}

.welcome-intro {
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 22px;
}

#open-invitation {
  min-height: 48px;
  padding: 12px 34px;
  border: none;
  border-radius: 999px;
  background: var(--rose-deep);
  color: #fff;
  font: 600 17px/1.4 "DM Sans", system-ui, sans-serif;
  cursor: pointer;
}

/* Floating music control. */
#music-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--rose-deep);
  background: var(--paper);
  color: var(--rose-deep);
  font: 600 15px/1.2 "DM Sans", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(74, 31, 40, 0.18);
}

#music-toggle[aria-pressed="true"] {
  background: var(--rose-deep);
  color: #fff;
}

/* Photo lightbox. */
dialog.lightbox {
  border: none;
  border-radius: 16px;
  padding: 12px;
  background: #2b1218;
  width: min(94vw, 720px);
}

dialog.lightbox::backdrop {
  background: rgba(20, 6, 10, 0.8);
}

dialog.lightbox img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  background: #2b1218;
}

.lightbox-controls {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.lightbox-controls button {
  flex: 1;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid #8a5a64;
  background: transparent;
  color: #fff;
  font: 600 16px/1.2 "DM Sans", system-ui, sans-serif;
  cursor: pointer;
}

.lightbox-controls #photo-close {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
}

/* Focus must always be visible. */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Designed desktop: two true columns, not a stretched phone. */
@media (min-width: 1024px) {
  #invitation {
    width: min(100% - 64px, 1060px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }

  .panel.hero {
    grid-row: span 3;
  }

  .panel.gallery,
  .panel.closing {
    grid-column: 1 / -1;
  }

  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .actions {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
