:root {
  color-scheme: light;
  --demo-serif: Georgia, "Times New Roman", serif;
  --demo-sans: "Segoe UI", Arial, sans-serif;
  --demo-shadow: 0 22px 60px rgba(42, 35, 30, 0.13);
  --demo-radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  font-family: var(--demo-sans);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

body.demo-basic {
  --paper: #fbfaf5;
  --surface: #ffffff;
  --ink: #26332c;
  --muted: #667069;
  --accent: #6d7b64;
  --accent-strong: #435243;
  --line: #dfe4da;
  color: var(--ink);
  background: var(--paper);
}

body.demo-premium {
  --paper: #f8efe9;
  --surface: #fffaf6;
  --ink: #4a2f2e;
  --muted: #806b68;
  --accent: #ae7774;
  --accent-strong: #784c4d;
  --line: #e8d1ca;
  color: var(--ink);
  background: var(--paper);
}

body.demo-luxury {
  --paper: #f0ebe1;
  --surface: #faf7f0;
  --ink: #181713;
  --muted: #686157;
  --accent: #a9854f;
  --accent-strong: #5b4527;
  --line: #d2c4aa;
  color: var(--ink);
  background: var(--paper);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 78%, white);
  outline-offset: 3px;
}

.demo-opening {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: end center;
  min-height: 100dvh;
  padding: 48px 20px max(42px, env(safe-area-inset-bottom));
  color: #fff;
  background: #252720;
  transition: visibility 0.7s, opacity 0.7s;
}

.demo-opening[hidden] {
  display: none;
}

.demo-opening::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(17, 18, 15, 0.18), rgba(17, 18, 15, 0.82)),
    url("/demo-assets/nathan-evelyn-hero.png") center / cover no-repeat;
}

.demo-opening-content {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  text-align: center;
}

.demo-opening-kicker,
.demo-kicker {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.demo-opening h1 {
  margin: 0;
  font-family: var(--demo-serif);
  font-size: clamp(42px, 8vw, 78px);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: 0;
}

.demo-opening-date {
  margin: 14px 0 26px;
  font-size: 14px;
}

.demo-opening-guest {
  margin: 0 0 18px;
  font-family: var(--demo-serif);
  font-size: 17px;
}

.demo-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--accent-strong);
  border-radius: 4px;
  padding: 10px 20px;
  color: #fff;
  background: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}

.demo-button[data-open-invitation]::after {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  content: "☝";
  font-size: 27px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
  transform: translateX(-50%);
  animation: demo-open-cue 1.35s ease-in-out infinite;
  pointer-events: none;
}

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

.demo-button-secondary {
  color: var(--accent-strong);
  background: transparent;
}

.demo-button-light {
  border-color: rgba(255, 255, 255, 0.62);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.demo-shell {
  min-height: 100vh;
}

.demo-section {
  position: relative;
  padding: 92px 22px;
  content-visibility: auto;
  contain-intrinsic-size: auto 780px;
}

.demo-container {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.demo-container-narrow {
  width: min(760px, 100%);
  margin: 0 auto;
}

.demo-heading {
  margin-bottom: 42px;
  text-align: center;
}

.demo-heading h2 {
  margin: 0;
  font-family: var(--demo-serif);
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0;
}

.demo-heading p {
  max-width: 650px;
  margin: 14px auto 0;
  color: var(--muted);
}

.demo-hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: end center;
  overflow: hidden;
  color: #fff;
}

.demo-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(25, 25, 20, 0.08), rgba(22, 22, 18, 0.72));
}

.demo-hero-content {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100% - 40px));
  padding: 80px 0 max(70px, env(safe-area-inset-bottom));
  text-align: center;
}

.demo-hero h1 {
  margin: 0;
  font-family: var(--demo-serif);
  font-size: clamp(52px, 9vw, 104px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: 0;
}

.demo-hero-date {
  margin: 22px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.demo-quote {
  margin: 0 auto;
  font-family: var(--demo-serif);
  font-size: clamp(25px, 4vw, 42px);
  font-style: italic;
  line-height: 1.45;
  text-align: center;
}

.demo-quote cite {
  display: block;
  margin-top: 16px;
  font-family: var(--demo-sans);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.demo-countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(680px, 100%);
  margin: 38px auto 0;
}

.demo-countdown-item {
  border: 1px solid var(--line);
  padding: 20px 8px;
  text-align: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.demo-countdown-item strong {
  display: block;
  font-family: var(--demo-serif);
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
}

.demo-countdown-item span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.demo-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.demo-event-card {
  border: 1px solid var(--line);
  padding: 38px;
  background: var(--surface);
  text-align: center;
}

.demo-event-card h3 {
  margin: 0 0 16px;
  font-family: var(--demo-serif);
  font-size: 30px;
  font-weight: 400;
}

.demo-event-card p {
  margin: 8px 0;
  color: var(--muted);
}

.demo-event-card .demo-button {
  margin-top: 20px;
}

.demo-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.demo-profile {
  border: 1px solid var(--line);
  background: var(--surface);
}

.demo-profile-photo,
.demo-gallery-photo {
  display: block;
  position: relative;
  overflow: hidden;
  background-color: #dfd9ce;
  background-image: url("/demo-assets/nathan-evelyn-gallery-sprite.png");
  background-repeat: no-repeat;
  background-size: 300% 300%;
}

.demo-profile-photo {
  min-height: 410px;
}

.demo-profile-copy {
  padding: 28px;
  text-align: center;
}

.demo-profile-copy h3 {
  margin: 0 0 10px;
  font-family: var(--demo-serif);
  font-size: 32px;
  font-weight: 400;
}

.demo-profile-copy p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.photo-1 { background-position: 0 0; }
.photo-2 { background-position: 50% 0; }
.photo-3 { background-position: 100% 0; }
.photo-4 { background-position: 0 50%; }
.photo-5 { background-position: 50% 50%; }
.photo-6 { background-position: 100% 50%; }
.photo-7 { background-position: 0 100%; }
.photo-8 { background-position: 50% 100%; }
.photo-9 { background-position: 100% 100%; }

.demo-story {
  display: grid;
  gap: 0;
  width: min(820px, 100%);
  margin: 0 auto;
}

.demo-story-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding: 28px 0;
}

.demo-story-year {
  color: var(--accent-strong);
  font-family: var(--demo-serif);
  font-size: 26px;
}

.demo-story-item h3 {
  margin: 0 0 6px;
  font-family: var(--demo-serif);
  font-size: 24px;
  font-weight: 400;
}

.demo-story-item p {
  margin: 0;
  color: var(--muted);
}

.demo-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 180px;
  gap: 12px;
}

.demo-gallery-button {
  grid-column: span 4;
  grid-row: span 2;
  min-width: 0;
  border: 0;
  padding: 0;
  cursor: zoom-in;
  background: transparent;
}

.demo-gallery-button:nth-child(1),
.demo-gallery-button:nth-child(5) {
  grid-column: span 8;
}

.demo-gallery-photo {
  width: 100%;
  height: 100%;
  transition: transform 0.55s;
}

.demo-gallery-button:hover .demo-gallery-photo {
  transform: scale(1.035);
}

.demo-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.demo-field {
  display: grid;
  gap: 7px;
}

.demo-field-full {
  grid-column: 1 / -1;
}

.demo-field label,
.demo-field legend {
  font-size: 12px;
  font-weight: 700;
}

.demo-field input,
.demo-field select,
.demo-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 12px 13px;
  color: var(--ink);
  background: var(--surface);
}

.demo-field textarea {
  min-height: 110px;
  resize: vertical;
}

.demo-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  grid-column: 1 / -1;
}

.demo-form-status {
  margin: 0;
  color: var(--accent-strong);
  font-size: 13px;
}

.demo-wishes-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 36px;
}

.demo-wish-list {
  display: grid;
  gap: 12px;
  max-height: 450px;
  overflow: auto;
}

.demo-wish {
  border-left: 2px solid var(--accent);
  padding: 12px 16px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.demo-wish strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--demo-serif);
}

.demo-wish p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.demo-gift {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px;
  align-items: center;
  width: min(720px, 100%);
  margin: auto;
  border: 1px solid var(--line);
  padding: 30px;
  background: var(--surface);
}

.demo-gift h3,
.demo-gift p {
  margin: 0;
}

.demo-gift-number {
  margin-top: 10px !important;
  font-family: var(--demo-serif);
  font-size: 24px;
}

.demo-note,
.demo-simulation-label {
  color: var(--muted);
  font-size: 12px;
}

.demo-media-placeholder {
  display: grid;
  min-height: 330px;
  place-items: center;
  border: 1px solid var(--line);
  padding: 32px;
  color: #f8f1e6;
  background: linear-gradient(135deg, rgba(19, 18, 16, 0.84), rgba(45, 40, 31, 0.66)),
    url("/demo-assets/nathan-evelyn-hero.png") center / cover no-repeat;
  text-align: center;
}

.demo-media-placeholder strong {
  display: block;
  font-family: var(--demo-serif);
  font-size: 28px;
  font-weight: 400;
}

.demo-media-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #181713;
}

.demo-dress-colors {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.demo-dress-color {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.45);
}

.demo-checkin {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 34px;
  align-items: center;
  width: min(780px, 100%);
  margin: auto;
  border: 1px solid var(--line);
  padding: 34px;
  background: var(--surface);
}

.demo-qr {
  display: block;
  width: 210px;
  height: 210px;
  border: 10px solid #fff;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.demo-checkin h3 {
  margin: 0 0 8px;
  font-family: var(--demo-serif);
  font-size: 32px;
  font-weight: 400;
}

.demo-checkin-status {
  min-height: 24px;
  color: var(--accent-strong);
  font-weight: 700;
}

.demo-music {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.demo-music-icon {
  font-size: 17px;
}

.demo-music[aria-pressed="true"] .demo-music-icon {
  animation: demo-pulse 1.3s ease-in-out infinite;
}

.demo-toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 32px);
  border-radius: 4px;
  padding: 12px 18px;
  color: #fff;
  background: #22211e;
  box-shadow: var(--demo-shadow);
  font-size: 13px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.demo-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.demo-lightbox {
  width: min(780px, calc(100% - 28px));
  border: 0;
  padding: 0;
  background: transparent;
}

.demo-lightbox::backdrop {
  background: rgba(14, 13, 12, 0.86);
}

.demo-lightbox-frame {
  position: relative;
  aspect-ratio: 1;
  border: 8px solid #fff;
  background-color: #ddd;
  background-image: url("/demo-assets/nathan-evelyn-gallery-sprite.png");
  background-repeat: no-repeat;
  background-size: 300% 300%;
}

.demo-lightbox-close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  font-size: 23px;
  cursor: pointer;
}

.demo-footer {
  padding: 68px 22px 90px;
  text-align: center;
}

.demo-footer-monogram {
  margin: 0 0 15px;
  font-family: var(--demo-serif);
  font-size: 36px;
}

.demo-disclaimer {
  max-width: 740px;
  margin: 34px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Basic: quiet botanical invitation. */
.demo-basic .demo-hero {
  min-height: 88svh;
}

.demo-basic .demo-hero-content {
  padding-bottom: 52px;
}

.demo-basic .demo-section:nth-of-type(even) {
  background: #f2f4ed;
}

.demo-basic .demo-event-grid {
  grid-template-columns: minmax(0, 660px);
  justify-content: center;
}

.demo-basic .demo-event-card {
  box-shadow: 0 14px 40px rgba(64, 76, 63, 0.08);
}

/* Premium: romantic editorial layers without excess ornament. */
.demo-premium .demo-section:nth-of-type(odd) {
  background: rgba(255, 250, 246, 0.72);
}

.demo-premium .demo-heading::after {
  display: block;
  width: 64px;
  height: 1px;
  margin: 19px auto 0;
  content: "";
  background: var(--accent);
}

.demo-premium .demo-profile,
.demo-premium .demo-event-card,
.demo-premium .demo-gift {
  box-shadow: 0 18px 50px rgba(102, 60, 58, 0.09);
}

/* Luxury: sharp editorial rhythm and high-contrast bands. */
.demo-luxury .demo-hero {
  min-height: 100svh;
}

.demo-luxury .demo-hero::after {
  background: linear-gradient(90deg, rgba(17, 16, 14, 0.76), rgba(17, 16, 14, 0.08) 70%);
}

.demo-luxury .demo-hero-content {
  width: min(1220px, calc(100% - 48px));
  margin: auto;
  text-align: left;
}

.demo-luxury .demo-hero h1 {
  max-width: 760px;
  font-size: clamp(66px, 10vw, 132px);
}

.demo-luxury .demo-dark {
  color: #f4efe5;
  background: #181713;
}

.demo-luxury .demo-dark .demo-heading p,
.demo-luxury .demo-dark .demo-note,
.demo-luxury .demo-dark .demo-simulation-label {
  color: #bdb4a5;
}

.demo-luxury .demo-dark .demo-event-card {
  border-color: #514936;
  background: #211f1a;
}

.demo-luxury .demo-dark .demo-event-card p {
  color: #c9c0b2;
}

.demo-luxury .demo-profile-grid {
  gap: 0;
}

.demo-luxury .demo-profile:nth-child(2) {
  margin-top: 72px;
}

.demo-luxury .demo-profile {
  border: 0;
}

.demo-luxury .demo-gallery {
  gap: 4px;
}

.demo-luxury .demo-gallery-button:nth-child(2),
.demo-luxury .demo-gallery-button:nth-child(4) {
  transform: translateY(32px);
}

.demo-luxury .demo-custom-url {
  width: min(700px, 100%);
  margin: 28px auto 0;
  border: 1px solid #514936;
  padding: 20px;
  color: #d8c39d;
  font-family: var(--demo-serif);
  font-size: 23px;
  text-align: center;
}

@keyframes demo-pulse {
  50% { transform: scale(1.18); }
}

@keyframes demo-open-cue {
  0%, 100% { transform: translate(-50%, 3px); }
  50% { transform: translate(-50%, -4px); }
}

@media (max-width: 760px) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .demo-section {
    padding: 70px 18px;
  }

  .demo-hero {
    min-height: 82svh;
  }

  .demo-hero-image,
  .demo-opening::before {
    object-position: 61% center;
    background-position: 61% center;
  }

  .demo-event-grid,
  .demo-profile-grid,
  .demo-wishes-layout,
  .demo-checkin {
    grid-template-columns: 1fr;
  }

  .demo-profile-photo {
    min-height: 360px;
  }

  .demo-gallery {
    grid-auto-rows: 132px;
  }

  .demo-gallery-button,
  .demo-gallery-button:nth-child(1),
  .demo-gallery-button:nth-child(5) {
    grid-column: span 6;
  }

  .demo-gallery-button:nth-child(1),
  .demo-gallery-button:nth-child(4) {
    grid-column: span 12;
  }

  .demo-form-grid {
    grid-template-columns: 1fr;
  }

  .demo-field-full,
  .demo-form-actions {
    grid-column: auto;
  }

  .demo-gift {
    grid-template-columns: 1fr;
  }

  .demo-qr {
    width: min(210px, 100%);
    height: auto;
    aspect-ratio: 1;
    margin: auto;
  }

  .demo-checkin {
    padding: 24px;
    text-align: center;
  }

  .demo-luxury .demo-hero::after {
    background: linear-gradient(180deg, rgba(17, 16, 14, 0.08), rgba(17, 16, 14, 0.82));
  }

  .demo-luxury .demo-hero-content {
    text-align: center;
  }

  .demo-luxury .demo-profile:nth-child(2),
  .demo-luxury .demo-gallery-button:nth-child(2),
  .demo-luxury .demo-gallery-button:nth-child(4) {
    margin-top: 0;
    transform: none;
  }
}

@media (max-width: 480px) {
  .demo-opening h1 {
    font-size: 45px;
  }

  .demo-hero h1,
  .demo-luxury .demo-hero h1 {
    font-size: 56px;
  }

  .demo-heading h2 {
    font-size: 34px;
  }

  .demo-countdown {
    gap: 6px;
  }

  .demo-countdown-item {
    padding: 15px 4px;
  }

  .demo-countdown-item strong {
    font-size: 27px;
  }

  .demo-event-card {
    padding: 28px 20px;
  }

  .demo-story-item {
    grid-template-columns: 64px 1fr;
    gap: 14px;
  }

  .demo-gallery {
    grid-auto-rows: 110px;
  }

  .demo-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .demo-music span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .demo-music {
    width: 46px;
    padding: 8px;
    justify-content: center;
  }
}

@media (pointer: coarse) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .demo-gallery-button:hover .demo-gallery-photo {
    transform: none;
  }

  .demo-music {
    background: var(--surface);
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
