:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --surface: rgba(255, 255, 255, 0.06);
  --glass: rgba(22, 22, 24, 0.72);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text: #f5f5f5;
  --text-soft: #a8a8a8;
  --accent: #ff6b9d;
  --accent-2: #c77dff;
  --gold: #f4c95f;
  --gradient: linear-gradient(135deg, #ff6b9d 0%, #c77dff 45%, #f4c95f 100%);
  --radius: 1.25rem;
  --radius-lg: 1.75rem;
  --shadow-deep: 0 24px 60px rgba(0, 0, 0, 0.55), 0 8px 20px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 18px 48px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(255, 107, 157, 0.08);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --pad: clamp(0.75rem, 3vw, 1.5rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(255, 107, 157, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 45% at 95% 5%, rgba(199, 125, 255, 0.2), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(244, 201, 95, 0.1), transparent 55%),
    linear-gradient(180deg, #0a0a0a 0%, #121018 50%, #0a0a0a 100%);
  line-height: 1.55;
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 80;
}

/* ---------- Top bar / hero ---------- */
.top-bar {
  position: relative;
  z-index: 10;
  padding: calc(1.5rem + env(safe-area-inset-top, 0px)) var(--pad) 1rem;
  text-align: center;
}

.top-bar-inner {
  max-width: 36rem;
  margin: 0 auto;
}

.eyebrow {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.85rem;
}

.top-bar h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  line-height: 1.12;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.02em;
}

.top-bar .name {
  display: inline-block;
  margin-top: 0.2rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@supports not (background-clip: text) {
  .top-bar .name {
    color: var(--gold);
    background: none;
    -webkit-text-fill-color: unset;
  }
}

.tagline {
  margin: 0.9rem auto 0;
  max-width: 24rem;
  color: var(--text-soft);
  font-size: 0.98rem;
  font-weight: 400;
}

/* ---------- Shared photo card ---------- */
.ig-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
  transform-style: preserve-3d;
  will-change: transform;
  border: 1px solid var(--glass-border);
  isolation: isolate;
}

.ig-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.14) 0%,
    transparent 35%,
    transparent 70%,
    rgba(0, 0, 0, 0.25) 100%
  );
  z-index: 2;
}

.ig-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.ig-card .card-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 40%, rgba(255, 107, 157, 0.18), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.ig-card:hover .card-glow,
.ig-card.is-tilting .card-glow {
  opacity: 1;
}

/* ---------- Mobile feed (Instagram stories / feed) ---------- */
.ig-feed {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 0.5rem var(--pad) 1.5rem;
  max-width: 520px;
  margin: 0 auto;
  perspective: 1000px;
}

.ig-feed .ig-card {
  width: 100%;
  aspect-ratio: 4 / 5;
  min-height: 280px;
  max-height: min(78vh, 640px);
  scroll-snap-align: center;
  transform-origin: center center;
}

/* Horizontal stories mode on very short / landscape phones optional via class */
.ig-feed.is-stories {
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  gap: 0.85rem;
  padding: 0.75rem var(--pad) 1.25rem;
  max-width: none;
  scrollbar-width: none;
}

.ig-feed.is-stories::-webkit-scrollbar {
  display: none;
}

.ig-feed.is-stories .ig-card {
  flex: 0 0 min(86vw, 360px);
  width: min(86vw, 360px);
  aspect-ratio: 4 / 5;
  min-height: 300px;
}

/* Vertical scroll-snap for feed */
@media (max-width: 900px) {
  .ig-feed:not(.is-stories) {
    scroll-snap-type: y proximity;
  }
}

/* Desktop: hide feed, show grid */
@media (min-width: 901px) {
  .ig-feed {
    display: none !important;
  }

  .ig-grid {
    display: grid !important;
  }
}

@media (max-width: 900px) {
  .ig-grid {
    display: none !important;
  }

  .ig-feed {
    display: flex !important;
  }
}

/* ---------- Desktop immersive grid ---------- */
.ig-grid {
  display: none;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
  padding: 1rem clamp(1.5rem, 4vw, 3.5rem) 2rem;
  max-width: 1280px;
  margin: 0 auto;
  perspective: 1400px;
  transform-style: preserve-3d;
}

.ig-grid .ig-card {
  grid-column: span 4;
  aspect-ratio: 4 / 5;
  min-height: 320px;
  cursor: default;
  transition: box-shadow 0.35s ease;
}

.ig-grid .ig-card:nth-child(1) {
  grid-column: 1 / span 5;
  grid-row: span 1;
  aspect-ratio: 1 / 1;
  min-height: 380px;
}

.ig-grid .ig-card:nth-child(2) {
  grid-column: 6 / span 4;
  aspect-ratio: 4 / 5;
}

.ig-grid .ig-card:nth-child(3) {
  grid-column: 10 / span 3;
  aspect-ratio: 3 / 4;
  align-self: end;
}

.ig-grid .ig-card:nth-child(4) {
  grid-column: 1 / span 3;
  aspect-ratio: 3 / 4;
}

.ig-grid .ig-card:nth-child(5) {
  grid-column: 4 / span 5;
  aspect-ratio: 5 / 4;
  min-height: 300px;
}

.ig-grid .ig-card:nth-child(6) {
  grid-column: 9 / span 4;
  aspect-ratio: 4 / 5;
}

.ig-grid .ig-card:nth-child(7) {
  grid-column: 1 / span 4;
  aspect-ratio: 4 / 5;
}

.ig-grid .ig-card:nth-child(8) {
  grid-column: 5 / span 4;
  aspect-ratio: 1 / 1;
}

.ig-grid .ig-card:nth-child(9) {
  grid-column: 9 / span 4;
  aspect-ratio: 4 / 5;
}

.ig-grid .ig-card:nth-child(10) {
  grid-column: 1 / span 5;
  aspect-ratio: 5 / 4;
}

.ig-grid .ig-card:nth-child(11) {
  grid-column: 6 / span 3;
  aspect-ratio: 3 / 4;
}

.ig-grid .ig-card:nth-child(12) {
  grid-column: 9 / span 4;
  aspect-ratio: 1 / 1;
}

.ig-grid .ig-card:nth-child(13) {
  grid-column: 1 / span 4;
  aspect-ratio: 4 / 5;
}

.ig-grid .ig-card:nth-child(14) {
  grid-column: 5 / span 4;
  aspect-ratio: 4 / 5;
}

.ig-grid .ig-card:nth-child(15) {
  grid-column: 9 / span 4;
  aspect-ratio: 3 / 4;
}

.ig-grid .ig-card:nth-child(16) {
  grid-column: 3 / span 6;
  aspect-ratio: 16 / 10;
  min-height: 340px;
}

.ig-grid .ig-card:hover {
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 107, 157, 0.25),
    0 8px 32px rgba(199, 125, 255, 0.15);
  z-index: 5;
}

/* ---------- Wish glass card ---------- */
.wish-section {
  position: relative;
  z-index: 10;
  padding: 1.5rem var(--pad) 2rem;
  display: flex;
  justify-content: center;
}

.wish-glass {
  width: 100%;
  max-width: 560px;
  padding: 1.85rem 1.6rem 2rem;
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--glass-border);
  box-shadow:
    var(--shadow-deep),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateZ(40px);
}

.wish-glass h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.55rem;
  margin: 0 0 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@supports not (background-clip: text) {
  .wish-glass h2 {
    color: var(--gold);
    background: none;
    -webkit-text-fill-color: unset;
  }
}

.wish-glass blockquote {
  margin: 0;
  padding: 0;
  border: none;
}

.wish-glass blockquote p {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 1.15rem;
  font-weight: 500;
}

.wish-glass footer {
  font-style: italic;
  color: var(--accent);
  text-align: right;
  font-family: var(--sans);
  font-size: 0.95rem;
}

/* Desktop: wish between sections feel — pull up slightly over grid */
@media (min-width: 901px) {
  .wish-section {
    margin-top: -1rem;
    padding-bottom: 3rem;
  }

  .wish-glass {
    max-width: 520px;
  }
}

/* ---------- Mute + footer ---------- */
.mute-toggle {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 100;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(20, 20, 22, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
  color: var(--text);
}

.mute-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0.5rem var(--pad) calc(2.5rem + env(safe-area-inset-bottom, 0px));
  color: var(--text-soft);
  font-size: 0.8rem;
}

/* ---------- Small phones ---------- */
@media (max-width: 420px) {
  .ig-feed .ig-card {
    min-height: 300px;
    aspect-ratio: 4 / 5;
  }

  .wish-glass {
    padding: 1.45rem 1.15rem 1.65rem;
  }

  .top-bar h1 {
    font-size: clamp(1.95rem, 9vw, 2.5rem);
  }
}

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

  .ig-card {
    will-change: auto;
    transition: none;
  }

  .grain {
    display: none;
  }
}
