/* =========================================================
   Cielito v5 — Fullscreen "living invitation" demo overlay
   Sarai & Co. aesthetic. Premium, refined, lots of whitespace.
   Fonts reused from index.html: Cormorant Garamond (serif),
   Caveat (script), General Sans (body).
   ========================================================= */

.cielito-demo {
  /* sunset (default) palette */
  --demo-sky-1: #aac6e6;
  --demo-sky-2: #f4dca5;
  --demo-ink: #1f2a3a;
  --demo-accent: #c4912b;
  --demo-cream: #fdf8ec;
  --demo-soft: #f6efe0;

  --demo-serif: 'Cormorant Garamond', Georgia, serif;
  --demo-script: 'Caveat', 'Brush Script MT', cursive;
  --demo-body: 'General Sans', 'Inter', 'Helvetica Neue', sans-serif;

  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, var(--demo-sky-1) 0%, var(--demo-sky-2) 100%);
  color: var(--demo-ink);
  font-family: var(--demo-body);
  -webkit-font-smoothing: antialiased;
}

.cielito-demo[data-theme="night"] {
  --demo-sky-1: #0c1738;
  --demo-sky-2: #2a1e3d;
  --demo-ink: #f4dca5;
  --demo-accent: #c4912b;
  --demo-cream: #1c1f2e;
  --demo-soft: #14182a;
}

/* ---- Visibility / entrance ---- */
.cielito-demo[hidden] { display: none; }

.cielito-demo[data-open] {
  display: block;
  animation: demoIn 280ms cubic-bezier(0.22, 0.9, 0.31, 1);
}
@keyframes demoIn {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}

body.is-demo-open { overflow: hidden; }

/* helper fonts inside the demo */
.cielito-demo .serif  { font-family: var(--demo-serif); }
.cielito-demo .script { font-family: var(--demo-script); }

/* =========================================================
   Papel picado — sticky top banner, CSS only
   ========================================================= */
.demo__papel-picado {
  position: sticky;
  top: 0;
  z-index: 9998;
  height: 26px;
  width: 100%;
  /* the string line */
  background:
    linear-gradient(to bottom, rgba(31,42,58,0.35) 0 1.5px, transparent 1.5px) top/100% 100% no-repeat;
}
.demo__papel-picado::after {
  /* the pennants — tiny colorful triangles repeating */
  content: "";
  position: absolute;
  top: 1.5px;
  left: 0;
  right: 0;
  height: 22px;
  background-image:
    linear-gradient(135deg, transparent 49%, transparent 51%),
    repeating-linear-gradient(
      to right,
      #2c6fb8 0 18px,
      #c4912b 18px 36px,
      #d96a8c 36px 54px,
      #f4dca5 54px 72px
    );
  -webkit-mask:
    repeating-linear-gradient(
      to right,
      #000 0,
      #000 7px,
      transparent 7px,
      transparent 9px,
      #000 9px,
      #000 16px,
      transparent 16px,
      transparent 18px
    ),
    linear-gradient(to bottom, #000 0 60%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  /* triangle bottoms via conic clip */
  clip-path: polygon(
    0 0, 100% 0, 100% 45%,
    98% 100%, 96% 45%, 94% 45%, 92% 100%, 90% 45%,
    88% 45%, 86% 100%, 84% 45%, 82% 45%, 80% 100%, 78% 45%,
    76% 45%, 74% 100%, 72% 45%, 70% 45%, 68% 100%, 66% 45%,
    64% 45%, 62% 100%, 60% 45%, 58% 45%, 56% 100%, 54% 45%,
    52% 45%, 50% 100%, 48% 45%, 46% 45%, 44% 100%, 42% 45%,
    40% 45%, 38% 100%, 36% 45%, 34% 45%, 32% 100%, 30% 45%,
    28% 45%, 26% 100%, 24% 45%, 22% 45%, 20% 100%, 18% 45%,
    16% 45%, 14% 100%, 12% 45%, 10% 45%, 8% 100%, 6% 45%,
    4% 45%, 2% 100%, 0 45%
  );
  opacity: 0.92;
}
.cielito-demo[data-theme="night"] .demo__papel-picado::after { opacity: 0.78; }

/* =========================================================
   Toolbar — close (left), lang + theme (right)
   ========================================================= */
.demo__toolbar {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(14px, 3vw, 28px);
  pointer-events: none;
}
.demo__toolbar > *,
.demo__toolbar-right > * { pointer-events: auto; }

.demo__toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo__close,
.demo__theme {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: var(--demo-cream);
  color: var(--demo-ink);
  box-shadow: 0 8px 22px -10px rgba(31,42,58,0.45);
  transition: transform 160ms ease, background 200ms ease;
}
.demo__close:hover,
.demo__theme:hover { transform: scale(1.06); }

.demo__lang {
  display: inline-flex;
  background: var(--demo-cream);
  border-radius: 999px;
  padding: 3px;
  box-shadow: 0 8px 22px -10px rgba(31,42,58,0.45);
}
.demo__lang button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--demo-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--demo-ink);
  opacity: 0.55;
  padding: 5px 12px;
  border-radius: 999px;
  transition: opacity 180ms ease, background 180ms ease;
}
.demo__lang button.is-active {
  opacity: 1;
  background: var(--demo-accent);
  color: #2a1f08;
}

/* =========================================================
   Scroll content
   ========================================================= */
.demo__scroll {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 40px) 120px;
}

/* shared section rhythm */
.demo__scroll > section {
  padding: clamp(40px, 8vw, 72px) 0;
  text-align: center;
  scroll-margin-top: 86px;
}

.demo__section-title {
  font-family: var(--demo-serif);
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0 0 8px;
}
.demo__section-sub {
  font-family: var(--demo-body);
  font-size: clamp(0.9rem, 2.6vw, 1rem);
  color: var(--demo-ink);
  opacity: 0.7;
  margin: 0 auto 28px;
  max-width: 34ch;
}
.demo__section-label {
  font-family: var(--demo-script);
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--demo-ink);
  opacity: 0.85;
  margin: 0 0 22px;
}

/* ---- Divider with center snowflake ---- */
.demo__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: clamp(18px, 4vw, 30px) 0;
}
.demo__divider::before,
.demo__divider::after {
  content: "";
  height: 1px;
  width: clamp(50px, 18vw, 130px);
  background: linear-gradient(to right, transparent, var(--demo-ink), transparent);
  opacity: 0.32;
}
.demo__divider .snow {
  font-size: 1rem;
  color: var(--demo-accent);
  opacity: 0.9;
}
.demo__divider.final { padding-top: 40px; }

/* =========================================================
   Hero
   ========================================================= */
.demo__hero {
  padding-top: clamp(96px, 16vw, 140px) !important;
}
.demo__eyebrow {
  display: inline-block;
  font-family: var(--demo-body);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--demo-ink);
  opacity: 0.55;
  margin-bottom: 22px;
}
.demo__hero-photo {
  width: clamp(120px, 32vw, 168px);
  height: clamp(120px, 32vw, 168px);
  margin: 0 auto 18px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 24px 60px -28px rgba(31,42,58,0.55);
  border: 3px solid var(--demo-cream);
}
.demo__hero-photo svg { display: block; }
.demo__hero-quote {
  font-family: var(--demo-script);
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  color: var(--demo-ink);
  opacity: 0.8;
  margin: 0 0 4px;
}
.demo__hero-title {
  font-family: var(--demo-serif);
  font-size: clamp(2.6rem, 11vw, 4.4rem);
  font-weight: 500;
  line-height: 1.02;
  margin: 0;
}
.demo__hero-honoree {
  font-family: var(--demo-script);
  font-size: clamp(2rem, 8vw, 3rem);
  color: var(--demo-ink);
  margin: 0 0 14px;
}
.demo__hero-date {
  font-family: var(--demo-serif);
  font-size: clamp(1.05rem, 3.4vw, 1.4rem);
  letter-spacing: 0.02em;
  margin: 0 0 16px;
}
.demo__hero-tagline {
  font-family: var(--demo-script);
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  color: var(--demo-accent);
  margin: 0 0 30px;
}
.demo__scroll-hint {
  font-family: var(--demo-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--demo-ink);
  opacity: 0.5;
  position: relative;
}
.demo__scroll-hint::after {
  content: "↓";
  display: block;
  margin-top: 8px;
  font-size: 1rem;
  animation: scrollBob 1.8s ease-in-out infinite;
}
@keyframes scrollBob {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(5px); opacity: 1; }
}

/* =========================================================
   Quote / cancion
   ========================================================= */
.demo__quote p {
  font-family: var(--demo-serif);
  font-style: italic;
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  line-height: 1.5;
  max-width: 24ch;
  margin: 0 auto;
  color: var(--demo-ink);
  opacity: 0.85;
}

/* =========================================================
   Countdown
   ========================================================= */
.demo__countdown-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 2.4vw, 16px);
  max-width: 460px;
  margin: 0 auto;
}
.demo__countdown-tiles .tile {
  background: var(--demo-cream);
  border-radius: 18px;
  padding: clamp(14px, 3vw, 22px) 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 18px 40px -26px rgba(31,42,58,0.5);
}
.demo__countdown-tiles .num {
  font-family: var(--demo-serif);
  font-size: clamp(1.7rem, 7vw, 2.6rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
}
.demo__countdown-tiles .lbl {
  font-family: var(--demo-body);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* =========================================================
   Cards (generic)
   ========================================================= */
.demo__card {
  background: var(--demo-cream);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 26px 60px -34px rgba(31,42,58,0.5);
  text-align: left;
}
.demo__card .label {
  display: block;
  font-family: var(--demo-body);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 4px;
}
.demo__card .big {
  font-family: var(--demo-serif);
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  margin: 0 0 18px;
  line-height: 1.2;
}
.demo__card p { margin: 0 0 16px; line-height: 1.45; }
.demo__card p:last-child { margin-bottom: 0; }

/* When & where grid */
.demo__ww-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  text-align: left;
}
.map-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.map-buttons a {
  font-family: var(--demo-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--demo-accent);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid color-mix(in oklab, var(--demo-accent) 45%, transparent);
  border-radius: 999px;
  text-align: center;
  transition: background 180ms ease;
}
.map-buttons a:hover {
  background: color-mix(in oklab, var(--demo-accent) 14%, transparent);
}

/* =========================================================
   Journey gallery
   ========================================================= */
.demo__gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}
.demo__gallery .photo {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  box-shadow: 0 18px 40px -26px rgba(31,42,58,0.5);
  border: 4px solid var(--demo-cream);
}

/* =========================================================
   Details cards (dress code / registry)
   ========================================================= */
.demo__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.demo__card--detail { text-align: left; }
.demo__card--detail h3 {
  font-family: var(--demo-serif);
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 500;
  margin: 0 0 10px;
}
.demo__card--detail p { font-size: 0.92rem; opacity: 0.85; }
.demo__btn-link {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--demo-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--demo-accent);
  text-decoration: none;
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 2px;
}

/* =========================================================
   Share
   ========================================================= */
.demo__share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}
.demo__share-grid button {
  background: var(--demo-cream);
  border: none;
  border-radius: 18px;
  padding: 18px 8px;
  cursor: pointer;
  font-family: var(--demo-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--demo-ink);
  line-height: 1.3;
  box-shadow: 0 18px 40px -28px rgba(31,42,58,0.5);
  transition: transform 160ms ease;
}
.demo__share-grid button:hover { transform: translateY(-3px); }

/* =========================================================
   RSVP
   ========================================================= */
.demo__rsvp-form {
  max-width: 440px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--demo-cream);
  border-radius: 28px;
  padding: clamp(22px, 5vw, 34px);
  box-shadow: 0 26px 60px -34px rgba(31,42,58,0.5);
}
.demo__rsvp-form label > span,
.demo__rsvp-attend legend {
  display: block;
  font-family: var(--demo-body);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 6px;
}
.demo__rsvp-form input[type="text"],
.demo__rsvp-form input[type="email"],
.demo__rsvp-form input[type="number"],
.demo__rsvp-form textarea {
  width: 100%;
  font-family: var(--demo-body);
  font-size: 0.95rem;
  color: var(--demo-ink);
  background: var(--demo-soft);
  border: 1px solid color-mix(in oklab, var(--demo-ink) 16%, transparent);
  border-radius: 12px;
  padding: 11px 14px;
  box-sizing: border-box;
}
.demo__rsvp-form textarea { resize: vertical; }
.demo__rsvp-form input:focus,
.demo__rsvp-form textarea:focus {
  outline: none;
  border-color: var(--demo-accent);
}
.demo__rsvp-attend {
  border: none;
  padding: 0;
  margin: 0;
}
.demo__rsvp-attend label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--demo-body);
  font-size: 0.92rem;
  padding: 6px 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  opacity: 1;
}
.demo__rsvp-attend label span {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  opacity: 1;
}
.demo__rsvp-attend input[type="radio"] { accent-color: var(--demo-accent); }

.demo__btn-primary {
  border: none;
  cursor: pointer;
  background: var(--demo-accent);
  color: #2a1f08;
  font-family: var(--demo-body);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 13px 20px;
  border-radius: 999px;
  box-shadow: 0 14px 30px -14px rgba(196,145,43,0.8);
  transition: transform 160ms ease;
}
.demo__btn-primary:hover { transform: translateY(-2px); }

.rsvp-thanks {
  max-width: 440px;
  margin: 18px auto 0;
  background: color-mix(in oklab, var(--demo-accent) 16%, var(--demo-cream));
  border-radius: 20px;
  padding: 22px 26px;
  font-family: var(--demo-serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
}
.rsvp-thanks[hidden] { display: none; }

/* =========================================================
   Footer tagline
   ========================================================= */
.demo__footer-tagline {
  text-align: center;
  font-family: var(--demo-script);
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  color: var(--demo-accent);
  margin: 8px 0 0;
}

/* =========================================================
   Sticky bottom CTA
   ========================================================= */
.demo__sticky-cta {
  position: sticky;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  margin: -80px auto 24px;
  width: min(420px, 90vw);
  border: none;
  cursor: pointer;
  background: linear-gradient(180deg, #d8b15f, var(--demo-accent));
  color: #2a1f08;
  font-family: var(--demo-body);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 16px 24px;
  border-radius: 999px;
  z-index: 9997;
  box-shadow: 0 20px 44px -16px rgba(31,42,58,0.5);
  transition: transform 160ms ease;
}
.demo__sticky-cta:hover { transform: translateX(-50%) translateY(-2px); }

/* =========================================================
   Confetti (spawned by JS on open)
   ========================================================= */
.demo__confetti {
  position: fixed;
  top: 26%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 10001;
  pointer-events: none;
}
.demo__confetti span {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 12px;
  opacity: 0;
  animation: demoConfetti 1500ms ease-out forwards;
}
@keyframes demoConfetti {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); }
}

/* =========================================================
   Toast (copy link)
   ========================================================= */
.demo__toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 10002;
  background: var(--demo-ink);
  color: var(--demo-cream);
  font-family: var(--demo-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}
.demo__toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 560px) {
  .demo__ww-grid,
  .demo__details { grid-template-columns: 1fr; }
  .demo__gallery { grid-template-columns: repeat(2, 1fr); }
  .demo__share-grid { grid-template-columns: repeat(2, 1fr); }
  .demo__countdown-tiles { gap: 8px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cielito-demo[data-open] { animation: none; }
  .demo__scroll-hint::after,
  .demo__confetti span { animation: none; }
}
