/* ==========================================================================
   Caithlyn's Birthday Invitation — Pastel Fairycore
   ========================================================================== */

@font-face {
  font-family: 'Fraunces';
  src: local('Fraunces');
}

:root {
  --blush: #f6dfe6;
  --blush-deep: #e9b8c8;
  --lilac: #ded3f0;
  --lilac-deep: #c3aee6;
  --cream: #fbf3e6;
  --gold: #cda45e;
  --gold-bright: #e0b96f;
  --sage: #a9b98f;
  --dusty-rose: #c98a94;
  --ink: #4a3b45;
  --ink-soft: #7a6670;
  --paper: #fffaf3;
  --white: #ffffff;

  --font-display: 'Bodoni Moda', 'Playfair Display', 'Georgia', serif;
  --font-script: 'Great Vibes', 'Snell Roundhand', cursive;
  --font-body: 'Frank Ruhl Libre', 'Iowan Old Style', Georgia, serif;
  --font-ui: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 22px;
  --shadow-soft: 0 18px 40px -20px rgba(90, 55, 70, 0.35);
  --shadow-card: 0 10px 30px -14px rgba(90, 55, 70, 0.28);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------------- Background texture ---------------- */

.bg-wash {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, var(--blush) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 90% 10%, var(--lilac) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 100%, var(--blush) 0%, transparent 60%),
    var(--cream);
}

.petal-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -40px;
  opacity: 0.55;
  animation: drift linear infinite;
  will-change: transform;
}

@keyframes drift {
  0% { transform: translateY(-5vh) translateX(0) rotate(0deg); }
  50% { transform: translateY(52vh) translateX(24px) rotate(180deg); }
  100% { transform: translateY(110vh) translateX(-12px) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .petal { animation: none; display: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- Reveal-on-scroll ---------------- */

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

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------------- Header / Hero ---------------- */

.hero {
  position: relative;
  padding: 64px 0 40px;
  text-align: center;
}

.hero-photo-bg {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 250px;
  transform: translateX(-50%);
  overflow: hidden;
}

.hero-photo-bg img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  object-position: center 22%;
  filter: blur(3px) saturate(0.9) brightness(1.05);
  transform: scale(1.1);
}

.hero-photo-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.4) 0%, rgba(255, 250, 243, 0.58) 32%, rgba(255, 250, 243, 0.9) 66%, var(--cream) 92%);
}

.crest {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  color: var(--gold);
}

.eyebrow {
  font-family: var(--font-ui);
  font-size: 12.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--dusty-rose);
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-name {
  font-family: var(--font-script);
  font-size: clamp(64px, 20vw, 118px);
  line-height: 1.35;
  padding-block: 0.12em 0.08em;
  color: var(--ink);
  margin: 0 0 6px;
  background: linear-gradient(180deg, #5a3e4d 10%, var(--dusty-rose) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  overflow: visible;
}

.hero-name--compact {
  font-size: clamp(48px, 14vw, 84px);
}

.hero-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(17px, 4vw, 22px);
  color: var(--ink-soft);
  margin: 0 auto 26px;
  max-width: 420px;
}

.hero-sub strong {
  font-style: normal;
  color: var(--gold);
  font-weight: 600;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(205, 164, 94, 0.35);
  padding: 10px 22px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.hero-meta .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}

.age-badge {
  font-weight: 800;
  color: var(--dusty-rose);
}

/* ---------------- Divider ---------------- */

.divider {
  display: flex;
  justify-content: center;
  margin: 6px auto 0;
  color: var(--gold);
  width: 100%;
  opacity: 0.85;
}
.divider svg { width: 180px; height: auto; }

/* ---------------- Section shell ---------------- */

section { position: relative; padding: 54px 0; }

.section-head {
  text-align: center;
  margin-bottom: 34px;
}

.section-kicker {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 700;
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.35;
  color: var(--ink);
  margin: 0;
  overflow: visible;
}

/* ---------------- Details card ---------------- */

.details-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 38px 28px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(205,164,94,0.22);
}

.details-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(205,164,94,0.3);
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
}

.detail-rows {
  display: grid;
  gap: 22px;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-align: left;
}

.detail-row .icon {
  flex: none;
  width: 40px; height: 40px;
  color: var(--dusty-rose);
}

.detail-row .label {
  font-family: var(--font-ui);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 700;
  margin-bottom: 3px;
}

.detail-row .value {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--ink);
  font-weight: 500;
}

.detail-row .value small {
  display: block;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ---------------- Buttons ---------------- */

.btn-row {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 15px 20px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:active { transform: scale(0.98); }

.btn svg { width: 19px; height: 19px; flex: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--dusty-rose), var(--blush-deep));
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(201, 138, 148, 0.7);
}

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border-color: rgba(205,164,94,0.4);
}

.btn-tertiary {
  background: rgba(169,185,143,0.14);
  color: var(--ink);
  border-color: rgba(169,185,143,0.4);
}

/* ---------------- Gallery ---------------- */

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  aspect-ratio: 4 / 3;
  border: 4px solid var(--white);
}

.gallery-item.feature {
  grid-column: span 1;
  aspect-ratio: 5 / 4;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:active img { transform: scale(1.04); }

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5);
  pointer-events: none;
}

/* ---------------- Footer ---------------- */

footer {
  text-align: center;
  padding: 44px 22px 60px;
}

footer .sig {
  font-family: var(--font-script);
  font-size: 30px;
  color: var(--gold);
  margin-bottom: 8px;
}

footer .fine {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-soft);
  opacity: 0.8;
}

/* ==========================================================================
   Program Page specifics
   ========================================================================== */

.program-intro {
  text-align: center;
  max-width: 460px;
  margin: 0 auto;
}

.program-intro p {
  font-family: var(--font-ui);
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.search-wrap {
  position: sticky;
  top: 12px;
  z-index: 20;
  margin: 26px auto 8px;
  max-width: 420px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid rgba(205,164,94,0.4);
  border-radius: 999px;
  padding: 13px 20px;
  box-shadow: var(--shadow-card);
}

.search-box svg {
  width: 18px; height: 18px;
  color: var(--dusty-rose);
  flex: none;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  width: 100%;
}

.search-box input::placeholder { color: #b6a3ab; }

.search-status {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--sage);
  margin-top: 8px;
  min-height: 16px;
  letter-spacing: 0.03em;
}

.search-hint {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 18px;
  line-height: 1.6;
}

.groups {
  display: grid;
  gap: 26px;
  margin-top: 30px;
}

.group-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 22px;
  border: 1px solid rgba(205,164,94,0.2);
}

.group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.group-head .motif {
  width: 34px; height: 34px;
  flex: none;
  color: var(--dusty-rose);
}

.group-head h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 20px;
  line-height: 1.35;
  margin: 0;
  color: var(--ink);
}

.group-head .count {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--sage);
  letter-spacing: 0.1em;
  margin-left: auto;
  text-transform: uppercase;
}

.roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.roster li {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  transition: background 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease, color 0.35s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.roster li .num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12.5px;
  color: var(--gold);
  width: 16px;
  flex: none;
}

.roster li.match {
  background: linear-gradient(135deg, rgba(224,185,111,0.22), rgba(201,138,148,0.16));
  box-shadow: 0 0 0 1.5px var(--gold-bright), 0 8px 20px -10px rgba(205,164,94,0.6);
  transform: scale(1.03);
  color: var(--ink);
  font-weight: 700;
}

.roster li.dim {
  opacity: 0.3;
}

.program-footer-details {
  margin-top: 50px;
}

/* ==========================================================================
   Entry Gate
   ========================================================================== */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, var(--blush) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 90% 10%, var(--lilac) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 100%, var(--blush) 0%, transparent 60%),
    var(--cream);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.gate.is-hidden {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.gate.is-removed { display: none; }

.gate-inner {
  text-align: center;
  max-width: 340px;
}

.gate-scene {
  position: relative;
  width: 250px;
  height: 190px;
  margin: 0 auto 20px;
}

.gate-photo-card {
  position: absolute;
  top: -26px;
  left: 50%;
  width: 192px;
  height: 140px;
  transform: translateX(-50%) rotate(-4deg) scale(0.97);
  transform-origin: center;
  border-radius: 12px;
  overflow: hidden;
  border: 5px solid #fff;
  box-shadow: var(--shadow-card);
  opacity: 0.98;
  z-index: 1;
  transition: transform 0.85s cubic-bezier(0.22, 0.8, 0.25, 1), opacity 0.6s ease;
}

.gate-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
}

.gate-envelope {
  position: relative;
  z-index: 2;
  display: block;
  width: 190px;
  height: 142px;
  margin: 0 auto;
  overflow: visible;
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
}

.env-flap {
  transform-origin: 80px 26px;
  transition: transform 0.6s cubic-bezier(0.5, -0.2, 0.5, 1.3), opacity 0.5s ease;
}

.env-seal {
  transform-origin: 80px 26px;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.env-seal-heart {
  transform-origin: 80px 26px;
  transition: opacity 0.3s ease;
}

.gate.is-opening .gate-photo-card {
  transform: translateX(-50%) translateY(-80px) rotate(-1deg) scale(1.18);
  opacity: 1;
  z-index: 5;
}

.gate.is-opening .gate-envelope {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
}

.gate.is-opening .env-flap {
  transform: scaleY(0.05) translateY(-4px);
  opacity: 0.5;
}

.gate.is-opening .env-seal {
  transform: scale(0);
  opacity: 0;
}

.gate-eyebrow {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dusty-rose);
  font-weight: 700;
  margin: 0 0 6px;
}

.gate-name {
  font-family: var(--font-script);
  font-size: clamp(48px, 15vw, 76px);
  line-height: 1.35;
  padding-block: 0.1em 0.05em;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #5a3e4d 10%, var(--dusty-rose) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  overflow: visible;
}

.gate-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-soft);
  margin: 4px 0 24px;
}

.gate-sub strong {
  font-style: normal;
  color: var(--gold);
  font-weight: 600;
}

.gate-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, var(--dusty-rose), var(--blush-deep));
  border: none;
  padding: 15px 26px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 26px -10px rgba(201, 138, 148, 0.75);
  animation: gate-pulse 2.6s ease-in-out infinite;
}

.gate-btn:active { transform: scale(0.97); }
.gate-btn svg { width: 17px; height: 17px; }

@keyframes gate-pulse {
  0%, 100% { box-shadow: 0 10px 26px -10px rgba(201, 138, 148, 0.75); }
  50% { box-shadow: 0 10px 30px -6px rgba(201, 138, 148, 0.95); }
}

@media (prefers-reduced-motion: reduce) {
  .gate-btn { animation: none; }
}

/* ==========================================================================
   Invitation reveal + swipeable panels
   ========================================================================== */

.invitation {
  opacity: 0;
}

.invitation.is-revealed {
  opacity: 1;
  transition: opacity 0.9s ease 0.1s;
}

.panels {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transition: height 0.45s cubic-bezier(0.22, 0.8, 0.25, 1);
}

.panels::-webkit-scrollbar { display: none; }

.panel {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
}

.panel > * { width: 100%; }

.panel .hero { padding-top: 24px; }

.panel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 720px;
  margin: 18px auto 0;
  padding: 0 26px;
  transition: opacity 0.3s ease;
}

.panel-nav.is-hidden { display: none; }

/* ---------------- Teaser panel content ---------------- */

.teaser-card {
  text-align: center;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px 26px;
  border: 1px solid rgba(205, 164, 94, 0.22);
}

.teaser-card .icon {
  width: 34px;
  height: 34px;
  color: var(--dusty-rose);
  margin: 0 auto 12px;
}

.teaser-value {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 21px;
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 10px;
}

.teaser-value small {
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 13px;
  color: var(--ink-soft);
}

.teaser-meta {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
}

.teaser-hint {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold);
  margin: 18px 0 0;
}

.gallery-teaser {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.gallery-teaser .gallery-item {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  aspect-ratio: 5 / 4;
  border: 4px solid var(--white);
}

.gallery-teaser .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-skip {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  opacity: 0.75;
  flex: none;
}

.panel-skip:active { opacity: 1; }

.panel-skip.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.panel-dots {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.panel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(201, 138, 148, 0.3);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.panel-dot.is-active {
  background: var(--dusty-rose);
  transform: scale(1.3);
}

.panel-next {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid rgba(205, 164, 94, 0.4);
  background: #fff;
  color: var(--dusty-rose);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease;
}

.panel-next:active { transform: scale(0.94); }
.panel-next svg { width: 18px; height: 18px; flex: none; }

.panel-next.is-finale {
  width: auto;
  height: auto;
  gap: 9px;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--dusty-rose), var(--blush-deep));
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px -10px rgba(201, 138, 148, 0.75);
}

.panel-next.is-finale svg { width: 15px; height: 15px; }

/* ---------------- Program: gated roster reveal ---------------- */

.after-panels {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.8s cubic-bezier(0.22, 0.8, 0.25, 1), opacity 0.6s ease 0.1s;
}

.after-panels.is-revealed {
  max-height: 6000px;
  opacity: 1;
}

/* ---------------- Responsive ---------------- */

@media (min-width: 560px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery-item { aspect-ratio: 1 / 1; }
  .gallery-item.feature { grid-column: span 2; aspect-ratio: 16 / 9; }
}

@media (min-width: 640px) {
  .btn-row { grid-template-columns: 1fr 1fr 1fr; }
}

@media (min-width: 760px) {
  .groups { grid-template-columns: 1fr 1fr; }
  .group-card:first-child { grid-column: 1 / -1; }
}
