@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600&family=Lora:wght@400;600&display=swap');

/* ══════════════════════════════════════════════════════════════════════════
   Tokens — Classical design system (subset used by the invitation).
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201f1d;
  --color-accent: #b68235;
  --color-divider: color-mix(in srgb, #201f1d 16%, transparent);

  --color-accent-100: #fff3e4;
  --color-accent-200: #ffe3bf;
  --color-accent-300: #facb8d;
  --color-accent-400: #e1ad66;
  --color-accent-500: #c28d41;
  --color-accent-700: #7d5411;

  --font-heading: "Cormorant Garamond", Georgia, serif;
  --font-heading-weight: 600;
  --font-body: "Lora", Georgia, serif;

  --radius-md: 4px;
  --radius-lg: 7px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);

  /* Dark sections (hero + closing) share one palette. */
  --ink-deep: #120e0b;
  --ink-warm: #241d15;
  --paper-light: #f4ead6;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
}

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

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

.inv-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: 9.2px 16.56px;
  border-radius: var(--radius-md);
}
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.btn-primary:active { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-block { width: 100%; margin-top: 9.2px; }
/* Touch target floor for the in-invitation buttons (mobile fix from the design). */
.btn-touch { min-height: 46px; padding: 13px 20px; }

/* ── device framing ──────────────────────────────────────────────────────── */
.stage {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
}

.phone {
  width: 100%;
  height: 100dvh;
  background: #0f0c0a;
}

.screen {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--color-bg);
  /* Type inside the invitation scales to the frame, not to the window, so the
     desktop phone mockup and a real phone render identically. */
  container-type: size;
  container-name: screen;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Desktop keeps the design's 428×880 phone mockup, shrinking on short screens. */
@media (min-width: 768px) and (min-height: 640px) {
  .stage { padding: 24px; }
  .phone {
    width: 428px;
    height: min(880px, calc(100dvh - 48px));
    padding: 12px;
    border: 1px solid var(--color-divider);
    border-radius: 38px;
    box-shadow: var(--shadow-lg);
  }
  .screen { border-radius: 28px; }
}

/* ── layers ──────────────────────────────────────────────────────────────── */
.intro-layer {
  position: absolute; inset: 0; z-index: 20;
  background: #bcdff2;
}

.invitation {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}
.invitation.is-revealed { animation: cardRise .9s cubic-bezier(.2,.7,.2,1) both; }

[hidden] { display: none !important; }

/* ── sections ────────────────────────────────────────────────────────────── */
.panel {
  height: 100%;
  scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 34px;
  background: var(--color-bg);
}
.panel--tint { background: color-mix(in srgb, var(--color-accent) 5%, var(--color-bg)); }
.panel--center { text-align: center; }
/* Only the hero, countdown and closing panels centre their boxes on the cross
   axis; the rest stay full-bleed so block buttons span the frame. */
.panel--stack { align-items: center; }
.panel--dark {
  position: relative; overflow: hidden;
  color: var(--paper-light);
}
.panel--hero { background: radial-gradient(120% 80% at 50% 12%, var(--ink-warm), var(--ink-deep)); }
.panel--closing { background: radial-gradient(120% 80% at 50% 20%, var(--ink-warm), var(--ink-deep)); }

.panel-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 30px;
}
.panel-lede {
  font-size: 14px;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
  text-wrap: pretty;
  margin: 0;
}
.kicker {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.quote {
  font-family: var(--font-heading); font-style: italic;
  text-wrap: pretty;
}
.field-label {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.rule-sm {
  width: 44px; height: 1px; background: var(--color-accent-400);
  transform-origin: center;
}

.sparks { position: absolute; inset: 0; }
.spark, .petal { position: absolute; }
.petal {
  top: -30px;
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, var(--color-accent-300), var(--color-accent-200));
}
.spark { border-radius: 50%; background: var(--color-accent-300); box-shadow: 0 0 4px var(--color-accent-300); }

/* — hero — */
.hero-ghost {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-heading); line-height: 1;
  font-size: 210px;
  font-size: min(210px, 49cqw);
  color: color-mix(in srgb, var(--color-accent-500) 11%, transparent);
  animation: riseGlow 6s ease-in-out infinite;
  user-select: none; pointer-events: none;
}
.hero-inner { position: relative; }
.hero-kicker {
  font-size: 11px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--color-accent-400);
  animation: fadeUp .8s ease .2s both;
}
.hero-rule { margin: 18px auto; animation: growX 1s ease .4s both; }
.hero-names {
  font-size: 64px; font-weight: 400; line-height: 1.02; margin: 0;
  background: linear-gradient(90deg, #e9c987, #fff4dc, #c08f43, #e9c987);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 7s linear infinite, fadeUp .9s ease .45s both;
}
.hero-names .amp {
  font-style: italic; font-size: 38px; display: inline-block; margin: 4px 0;
}
.hero-quote {
  font-size: 19px; line-height: 1.55; margin: 26px 4px 0;
  color: color-mix(in srgb, var(--paper-light) 84%, transparent);
  animation: fadeUp 1s ease .9s both;
}
.hero-date {
  margin-top: 26px; font-size: 13px; letter-spacing: .16em;
  color: var(--color-accent-300);
  animation: fadeIn 1.1s ease 1.1s both;
}
.scroll-hint {
  position: absolute; bottom: 30px; left: 0; right: 0;
  color: var(--color-accent-300);
  animation: hintBob 2.4s ease-in-out infinite;
}
.scroll-hint svg { margin: 0 auto; display: block; }

/* — countdown — */
.cd-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px; margin-top: 28px; width: 100%;
}
.cd-cell {
  padding: 22px 8px;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.cd-value {
  font-family: var(--font-heading); font-size: 46px; line-height: 1;
  color: var(--color-accent-700);
}
.cd-label {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
  margin-top: 6px;
}
.cd-note {
  font-size: 18px; margin: 30px 6px 0;
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
}

/* — schedule — */
.schedule { margin-top: 26px; }
.schedule-row {
  display: flex; align-items: baseline; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--color-divider);
}
.schedule-row:last-child { border-bottom: 1px solid var(--color-divider); }
.schedule-time {
  font-family: var(--font-heading); font-size: 22px;
  color: var(--color-accent-700); min-width: 62px;
}
.schedule-label { font-size: 15px; }

/* — venue — */
.venue-sub {
  font-size: 14px; color: color-mix(in srgb, var(--color-text) 62%, transparent);
  margin-bottom: 22px;
}
.map {
  position: relative; height: 230px; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  background:
    repeating-linear-gradient(0deg, transparent, transparent 26px, color-mix(in srgb, var(--color-text) 5%, transparent) 26px, color-mix(in srgb, var(--color-text) 5%, transparent) 27px),
    repeating-linear-gradient(90deg, transparent, transparent 26px, color-mix(in srgb, var(--color-text) 5%, transparent) 26px, color-mix(in srgb, var(--color-text) 5%, transparent) 27px);
}
.map-pulse {
  position: absolute; left: 50%; top: 50%;
  width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--color-accent) 35%, transparent);
  transform: translate(-50%, -50%);
  animation: ringPulse 2.4s ease-out infinite;
}
.map-pin {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -100%);
  color: var(--color-accent-700);
}
.map + .btn { margin-top: 20px; }

/* — gallery — */
.gallery {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px; margin-top: 22px;
}
.plate {
  position: relative; overflow: hidden;
  filter: sepia(0.22) saturate(0.82) contrast(1.05);
  border: 6px solid var(--color-surface);
  outline: 1px solid var(--color-divider);
  background: var(--color-surface);
  aspect-ratio: 4 / 3;
}
.plate--tall { grid-row: span 2; aspect-ratio: 3 / 5; }
.plate img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plate-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 42%, transparent);
  background: color-mix(in srgb, var(--color-text) 4%, var(--color-bg));
}

/* — rsvp — */
.rsvp-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.rsvp-message {
  font-size: 17px; margin: 22px 0 0; color: var(--color-accent-700);
  animation: fadeIn .5s ease both;
}
.btn[aria-pressed="true"] { background: color-mix(in srgb, var(--color-accent) 16%, transparent); }

/* — gift — */
.gift-card {
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  padding: 18px; text-align: left; background: var(--color-bg);
  margin-top: 20px;
}
.gift-recipient { font-size: 15px; margin-bottom: 10px; }
.gift-iban { font-size: 15px; }

/* — closing — */
.closing-inner { position: relative; }
.closing-rule { margin: 0 auto 22px; }
.closing-names {
  font-family: var(--font-heading); font-size: 38px;
  background: linear-gradient(90deg, #e9c987, #fff4dc, #c08f43);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.closing-quote {
  font-size: 18px; margin: 18px 6px 0;
  color: color-mix(in srgb, var(--paper-light) 80%, transparent);
}
.closing-date {
  margin-top: 22px; font-size: 12px; letter-spacing: .2em;
  color: var(--color-accent-300);
}

/* ── loading / error ─────────────────────────────────────────────────────── */
.state {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 40px 34px; text-align: center;
  background: var(--color-bg);
}
.state-title { font-family: var(--font-heading); font-size: 22px; }
.state-text {
  font-size: 13px; margin: 0;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
}
.state code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
  padding: 2px 6px; border-radius: var(--radius-md);
}

/* Short frames (landscape phones, small laptops) — trim the largest steps so a
   panel's content still fits inside its 100%-height snap point. */
@container screen (max-height: 720px) {
  .panel { padding: 32px 28px; }
  .hero-names { font-size: 52px; }
  .hero-names .amp { font-size: 32px; }
  .hero-quote { font-size: 17px; margin-top: 20px; }
  .hero-date, .cd-grid { margin-top: 20px; }
  .cd-cell { padding: 14px 8px; }
  .cd-value { font-size: 36px; }
  .cd-note { font-size: 16px; margin-top: 22px; }
  .panel-title { font-size: 26px; }
  .closing-names { font-size: 30px; }
  .map { height: 168px; }
  .schedule, .gallery { margin-top: 18px; }
  .schedule-row { padding: 12px 0; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Keyframes
   ═══════════════════════════════════════════════════════════════════════ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes petalFall {
  0% { transform: translateY(-30px) translateX(0) rotate(0); }
  100% { transform: translateY(700px) translateX(48px) rotate(400deg); }
}
@keyframes twinkle { 0%, 100% { opacity: .12; } 50% { opacity: .95; } }
@keyframes ringPulse {
  0% { transform: translate(-50%, -50%) scale(.5); opacity: .75; }
  100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; }
}
@keyframes shimmer { 0% { background-position: 0% 50%; } 100% { background-position: -200% 50%; } }
@keyframes riseGlow { 0%, 100% { opacity: .35; } 50% { opacity: .7; } }
@keyframes cardRise {
  0% { opacity: 0; transform: translateY(80px) scale(.92); }
  100% { opacity: 1; transform: none; }
}
@keyframes hintBob {
  0%, 100% { transform: translateY(0); opacity: .55; }
  50% { transform: translateY(7px); opacity: 1; }
}

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