/* =====================================================================
   Warm Keepsake — design tokens (from the Stitch "Wedding Guestbook" DS)
   ===================================================================== */
:root {
  /* Core palette */
  --wine: #661411;
  --wine-deep: #460002;
  --wine-tint: #a03f37;
  --honey: #ffbd59;
  --honey-deep: #815500;
  --butter: #f9dea0;
  --champagne: #ffe7c2;
  --terracotta: #bc7a5c;
  --poppy: #c24f40;
  --linen: #f5f2eb;

  /* Surfaces */
  --surface: #fcf9f2;
  --surface-low: #f6f3ec;
  --surface-container: #f1eee7;
  --surface-high: #ebe8e1;
  --on-surface: #1c1c18;
  --on-surface-variant: #564240;
  --outline: #89726f;
  --outline-variant: #dcc0bd;
  --error: #ba1a1a;

  /* Type */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Radii */
  --r-sm: 0.25rem;
  --r: 0.5rem;
  --r-md: 0.75rem;
  --r-lg: 1rem;
  --r-xl: 1.5rem;
  --r-full: 9999px;

  /* Spacing */
  --margin: 1.25rem;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;

  /* Elevation (warm, wine-tinted) */
  --shadow-1: 0 4px 16px -2px rgba(102, 20, 17, 0.06), 0 1px 3px 0 rgba(102, 20, 17, 0.04);
  --shadow-2: 0 8px 24px -4px rgba(102, 20, 17, 0.1);
  --shadow-3: 0 16px 36px -6px rgba(102, 20, 17, 0.16);
  --border-soft: 1px solid rgba(188, 122, 92, 0.2);

  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --nav-h: 76px;
  --app-max: 560px;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--on-surface);
  background-color: var(--linen);
  background-image:
    radial-gradient(1200px 600px at 110% -10%, rgba(255, 189, 89, 0.18), transparent 60%),
    radial-gradient(900px 500px at -20% 30%, rgba(188, 122, 92, 0.12), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.08 0 0 0 0 0.07 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  font-size: 24px;
  line-height: 1;
  user-select: none;
}
.icon-fill { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

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

:focus-visible {
  outline: 3px solid var(--honey);
  outline-offset: 3px;
  border-radius: var(--r);
}

/* =====================================================================
   App shell
   ===================================================================== */
.app {
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--space-lg));
  position: relative;
}
.app[data-view="gallery"] { max-width: 1100px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: calc(env(safe-area-inset-top) + 0.75rem) var(--margin) 0.75rem;
  background: linear-gradient(to bottom, rgba(245, 242, 235, 0.92), rgba(245, 242, 235, 0.78));
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(188, 122, 92, 0.12);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  min-width: 0;
}
.monogram {
  width: 40px; height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--wine);
  color: var(--champagne);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  font-weight: 600;
  box-shadow: inset 0 0 0 2px rgba(255, 189, 89, 0.55), var(--shadow-1);
}
.brand-text { min-width: 0; }
.brand-names {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.2;
  color: var(--wine);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta);
}

/* Live pill with pulsing ring */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem 0.4rem 0.65rem;
  border-radius: var(--r-full);
  background: rgba(255, 189, 89, 0.22);
  color: var(--wine);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.live-dot {
  position: relative;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--poppy);
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--honey);
  animation: pulse-ring 1.8s var(--ease-out) infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

.view {
  padding: var(--space-lg) var(--margin) 0;
  animation: view-in 0.5s var(--ease-out) both;
}
.view[hidden] { display: none; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* =====================================================================
   Typography helpers
   ===================================================================== */
.eyebrow {
  margin: 0 0 var(--space-sm);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
}
.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.01em;
  color: var(--wine);
}
.display em { font-style: italic; color: var(--wine-tint); }
.headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 32px;
  color: var(--wine);
}
.lede {
  margin: var(--space-sm) 0 0;
  font-size: 17px;
  line-height: 27px;
  color: var(--on-surface-variant);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  margin: var(--space-xl) 0 var(--space-md);
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 700;
  font-size: 15px;
  color: var(--wine);
  text-decoration: none;
  padding: 0.5rem 0;
}
.text-link .material-symbols-rounded { font-size: 20px; transition: transform 0.25s var(--ease-out); }
.text-link:hover .material-symbols-rounded { transform: translateX(4px); }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 56px;
  padding: 0 1.75rem;
  border: 0;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(180deg, #7a1c18 0%, var(--wine) 100%);
  color: var(--linen);
  box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-primary:hover { box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.12); }

.btn-secondary {
  background: linear-gradient(180deg, #ffc76f 0%, var(--honey) 100%);
  color: var(--wine);
  box-shadow: var(--shadow-1), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-secondary:hover { box-shadow: var(--shadow-2); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  color: var(--wine);
  border: 1.5px solid rgba(188, 122, 92, 0.35);
}
.btn-ghost:hover { background: #fff; }

.btn-xl { min-height: 72px; font-size: 19px; border-radius: var(--r-xl); justify-content: flex-start; padding: 0 1.25rem; }
.btn-xl .btn-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  flex: none;
}
.btn-secondary.btn-xl .btn-icon { background: rgba(102, 20, 17, 0.1); }
.btn-xl .btn-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.btn-xl .btn-label small { font-size: 14px; font-weight: 500; opacity: 0.8; margin-top: 2px; }
.btn-xl .chev { margin-left: auto; opacity: 0.7; transition: transform 0.25s var(--ease-out); }
.btn-xl:hover .chev { transform: translateX(4px); }

/* shimmer on primary hover */
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 231, 194, 0.22) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.8s var(--ease-out);
}
.btn-primary:hover::after { transform: translateX(100%); }

.spinner {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   Screen 1 — Snap & Welcome
   ===================================================================== */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-3);
  aspect-ratio: 4 / 5;
  background: var(--inverse, #31312c);
  isolation: isolate;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 52% 50%;
  transform: scale(1.06);
  animation: hero-zoom 14s ease-out forwards;
}
@keyframes hero-zoom { to { transform: scale(1); } }
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(70, 0, 2, 0) 35%, rgba(70, 0, 2, 0.55) 72%, rgba(40, 0, 1, 0.88) 100%),
    linear-gradient(0deg, rgba(255, 189, 89, 0.08), rgba(255, 189, 89, 0.08));
  mix-blend-mode: multiply;
}
.hero::after {
  /* inner foil frame */
  content: '';
  position: absolute;
  inset: 12px;
  z-index: 2;
  border-radius: calc(var(--r-xl) - 6px);
  border: 1px solid rgba(255, 221, 178, 0.45);
  pointer-events: none;
}
.hero-content {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  color: var(--linen);
  text-align: center;
}
.hero-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--butter);
}
.hero-names {
  margin: 0.4rem 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 9vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.hero-names .amp { font-style: italic; color: var(--honey); font-weight: 500; }
.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 15px;
  color: rgba(245, 242, 235, 0.9);
}
.hero-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--honey); }

.welcome-card {
  position: relative;
  margin: calc(var(--space-lg) * -1) var(--space-sm) 0;
  padding: var(--space-lg) var(--space-lg) var(--space-lg);
  background: var(--champagne);
  border: var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  z-index: 4;
  text-align: center;
}
.welcome-card .headline { font-size: 22px; line-height: 30px; }
.welcome-card p { margin: 0.4rem 0 0; color: var(--on-surface-variant); font-size: 16px; }
.flourish {
  display: block;
  width: 84px;
  margin: 0 auto var(--space-sm);
  color: var(--terracotta);
}

.cta-stack {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.btn-hero-upload {
  min-height: 76px;
  font-size: 20px;
  box-shadow: 0 10px 28px -6px rgba(102, 20, 17, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.btn-hero-upload:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -8px rgba(102, 20, 17, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-hero-upload .btn-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.18);
}
.btn-hero-upload .btn-icon .material-symbols-rounded {
  font-size: 28px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin: var(--space-lg) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  padding: var(--space-md) var(--space-sm);
  background: rgba(255, 255, 255, 0.55);
  border: var(--border-soft);
  border-radius: var(--r-lg);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface-variant);
  line-height: 1.3;
}
.steps .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  margin: 0 auto 0.4rem;
  border-radius: 50%;
  background: var(--butter);
  color: var(--wine);
  font-size: 22px;
}

/* Recent memories strip */
.strip {
  display: flex;
  gap: var(--space-md);
  margin: 0 calc(var(--margin) * -1);
  padding: var(--space-sm) var(--margin) var(--space-lg);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip > * { scroll-snap-align: start; flex: 0 0 168px; }
.strip .polaroid { margin: 0; }
.strip .polaroid:nth-child(odd) { transform: rotate(-1.5deg); }
.strip .polaroid:nth-child(even) { transform: rotate(1.2deg) translateY(6px); }

/* =====================================================================
   Polaroid & message cards (shared)
   ===================================================================== */
.polaroid {
  position: relative;
  padding: 10px 10px 0;
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--shadow-2);
  border: 1px solid rgba(188, 122, 92, 0.12);
  transition: transform 0.35s var(--ease-spring), box-shadow 0.3s var(--ease-out);
  break-inside: avoid;
}
.polaroid-photo {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-container);
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: zoom-in;
}
.polaroid-photo img {
  width: 100%;
  height: auto;
  object-fit: cover;
  filter: saturate(1.02) contrast(1.02);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out);
}
.polaroid-photo img.loaded { opacity: 1; }
.polaroid:hover .polaroid-photo img { transform: scale(1.03); }
.polaroid-photo video {
  width: 100%;
  height: auto;
  min-height: 100%;
  object-fit: cover;
  background: #111;
  display: block;
  filter: saturate(1.02) contrast(1.02);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out);
}
.polaroid-photo video.loaded { opacity: 1; }
.polaroid:hover .polaroid-photo video { transform: scale(1.03); }
.polaroid-video {
  position: relative;
}
.video-card-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px 3px 6px;
  background: rgba(18, 14, 13, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: transform 0.25s var(--ease-spring), background 0.2s ease;
}
.video-card-badge .material-symbols-rounded {
  font-size: 15px;
  color: var(--honey);
}
.polaroid:hover .video-card-badge {
  transform: scale(1.05);
  background: rgba(102, 20, 17, 0.9);
}
.polaroid-caption { padding: 0.75rem 0.25rem 0.85rem; }
.polaroid-caption .quote {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  line-height: 1.4;
  color: var(--on-surface);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.strip .polaroid-caption .quote { -webkit-line-clamp: 2; font-size: 15px; }

.byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}
.byline-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--wine);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.byline-time { font-size: 12px; font-weight: 600; color: var(--outline); white-space: nowrap; }

.message-card {
  position: relative;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  background: var(--champagne);
  border: var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  break-inside: avoid;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.3s var(--ease-out);
}
.message-card::before {
  content: '\201C';
  position: absolute;
  top: -6px;
  left: 14px;
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1;
  color: var(--honey);
  opacity: 0.85;
}
.message-card .quote {
  margin: var(--space-sm) 0 var(--space-md);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
  color: var(--wine-deep);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message-card.alt { background: #fff8ec; }
.message-card.gold { background: var(--butter); }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px dashed rgba(188, 122, 92, 0.35);
}
.polaroid .card-foot { margin: 0 0.25rem; padding-bottom: 0.65rem; }
.who { min-width: 0; display: flex; flex-direction: column; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--r-full);
  background: rgba(188, 122, 92, 0.14);
  color: #7d4a33;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.polaroid .tag {
  position: absolute;
  top: 18px; left: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-1);
  z-index: 1;
}

/* Heart reaction */
.heart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 48px;
  min-height: 40px;
  padding: 0 0.7rem;
  border: 0;
  border-radius: var(--r-full);
  background: rgba(194, 79, 64, 0.08);
  color: var(--poppy);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s, transform 0.2s var(--ease-spring);
  flex: none;
}
.heart-btn:hover { background: rgba(194, 79, 64, 0.16); }
.heart-btn .material-symbols-rounded { font-size: 22px; transition: transform 0.3s var(--ease-spring); }
.heart-btn.hearted .material-symbols-rounded { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.heart-btn.pop .material-symbols-rounded { animation: heart-pop 0.5s var(--ease-spring); }
@keyframes heart-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.45); }
  100% { transform: scale(1); }
}
.heart-burst {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  color: var(--poppy);
  font-size: 18px;
  animation: burst 0.9s var(--ease-out) forwards;
}
@keyframes burst {
  0% { opacity: 1; transform: translate(0, 0) scale(0.6); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(var(--rot)); }
}

/* =====================================================================
   Screen 2 — Share Wish
   ===================================================================== */
.share-head { text-align: center; margin-bottom: var(--space-lg); }

.photo-drop {
  position: relative;
  width: min(84%, 340px);
  margin: 0 auto var(--space-xl);
  padding: 12px;
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--shadow-2);
  transform: rotate(-1.5deg);
  transition: transform 0.4s var(--ease-spring);
}
.photo-drop:hover { transform: rotate(0deg) scale(1.01); }
.photo-drop-inner {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(249, 222, 160, 0.35) 0 12px, rgba(255, 231, 194, 0.35) 12px 24px),
    var(--champagne);
}
.photo-drop-inner img,
.photo-drop-inner video { width: 100%; height: 100%; object-fit: cover; }
.photo-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  border: 2px dashed rgba(188, 122, 92, 0.55);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--wine);
  cursor: pointer;
  font-weight: 700;
  font-size: 17px;
}
.media-pick-icons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.media-pick-icons .material-symbols-rounded,
.photo-empty > .material-symbols-rounded {
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--wine);
  color: var(--champagne);
  font-size: 28px;
  box-shadow: var(--shadow-2);
  transition: transform 0.35s var(--ease-spring);
}
.photo-empty:hover .media-pick-icons .material-symbols-rounded:first-child,
.photo-empty:hover > .material-symbols-rounded { transform: scale(1.08) rotate(-6deg); }
.photo-empty:hover .media-pick-icons .material-symbols-rounded:last-child { transform: scale(1.08) rotate(6deg); }
.photo-empty small { font-weight: 500; font-size: 14px; color: var(--on-surface-variant); }
.photo-actions {
  position: absolute;
  right: -10px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.round-btn {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--wine);
  box-shadow: var(--shadow-2);
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring);
}
.round-btn:hover { transform: scale(1.08); }
.round-btn.danger { color: var(--poppy); }

.tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 96px; height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(249, 222, 160, 0.75);
  box-shadow: 0 1px 2px rgba(102, 20, 17, 0.08);
  z-index: 2;
  clip-path: polygon(3% 0, 97% 4%, 100% 50%, 97% 100%, 2% 96%, 0 50%);
}

.form { display: grid; gap: var(--space-lg); }
.field { display: grid; gap: 0.5rem; }
.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  font-weight: 700;
  color: var(--wine);
}
.field-label small { font-weight: 500; color: var(--outline); font-size: 13px; }
.input, .textarea {
  width: 100%;
  min-height: 56px;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid rgba(188, 122, 92, 0.4);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.25s;
  -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: rgba(102, 20, 17, 0.5); }
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 4px rgba(255, 189, 89, 0.35);
}
.textarea-wrap {
  position: relative;
  border-radius: var(--r-md);
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, rgba(188, 122, 92, 0.16) 31px 32px);
}
.textarea {
  min-height: 176px;
  resize: vertical;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 32px;
  padding-top: 0.75rem;
  background: rgba(255, 255, 255, 0.82);
}
.counter { justify-self: end; font-size: 13px; font-weight: 600; color: var(--outline); }
.counter.warn { color: var(--poppy); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.chip {
  min-height: 42px;
  padding: 0 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid rgba(188, 122, 92, 0.35);
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.5);
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s var(--ease-out);
}
.chip:hover { border-color: var(--terracotta); background: #fff; }
.chip[aria-pressed="true"], .chip[aria-selected="true"] {
  background: var(--butter);
  border-color: var(--butter);
  color: var(--wine);
  box-shadow: var(--shadow-1);
}
.chip .material-symbols-rounded { font-size: 18px; }
.chip .count {
  min-width: 22px;
  padding: 0 0.35rem;
  border-radius: var(--r-full);
  background: rgba(102, 20, 17, 0.08);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.form-error {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  background: #ffdad6;
  color: #93000a;
  font-weight: 600;
  font-size: 15px;
}
.form-error[hidden] { display: none; }

.privacy-note {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 13px;
  color: var(--outline);
  text-align: center;
}
.privacy-note .material-symbols-rounded { font-size: 18px; }

.progress {
  height: 6px;
  border-radius: var(--r-full);
  background: rgba(188, 122, 92, 0.2);
  overflow: hidden;
}
.progress[hidden] { display: none; }
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--honey), var(--poppy));
  transition: width 0.2s;
}

/* =====================================================================
   Screen 3 — Live Gallery
   ===================================================================== */
.gallery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.stat {
  padding: 0.85rem 0.75rem;
  background: rgba(255, 255, 255, 0.6);
  border: var(--border-soft);
  border-radius: var(--r-lg);
  text-align: center;
}
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.1;
  color: var(--wine);
}
.stat span { font-size: 13px; font-weight: 600; color: var(--on-surface-variant); }
@media (max-width: 480px) {
  .stat { padding: 0.6rem 0.25rem; }
  .stat strong { font-size: 20px; }
  .stat span { font-size: 11px; }
}

.filter-bar {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 65px);
  z-index: 10;
  margin: var(--space-lg) calc(var(--margin) * -1) var(--space-md);
  padding: 0.6rem var(--margin);
  background: rgba(245, 242, 235, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.masonry {
  column-count: 2;
  column-gap: var(--space-md);
}
.masonry > * {
  display: inline-block;
  width: 100%;
  margin-bottom: var(--space-lg);
  animation: card-in 0.6s var(--ease-out) both;
}
.masonry > .polaroid:nth-child(4n+1) { transform: rotate(-1.2deg); }
.masonry > .polaroid:nth-child(4n+3) { transform: rotate(1deg); }
.masonry > *:hover { transform: rotate(0deg) translateY(-3px); box-shadow: var(--shadow-3); z-index: 2; }
@keyframes card-in {
  from { opacity: 0; translate: 0 18px; }
  to { opacity: 1; translate: 0 0; }
}
.masonry > .is-new { animation: card-new 0.9s var(--ease-spring) both; }
@keyframes card-new {
  0% { opacity: 0; scale: 0.8; }
  60% { opacity: 1; scale: 1.03; }
  100% { scale: 1; }
}

@media (max-width: 380px) {
  .masonry { column-count: 1; }
}
@media (min-width: 720px) {
  .masonry { column-count: 3; column-gap: var(--space-lg); }
  .view { padding-left: 2rem; padding-right: 2rem; }
  .filter-bar { margin-left: -2rem; margin-right: -2rem; padding-left: 2rem; padding-right: 2rem; }
}
@media (min-width: 1000px) {
  .masonry { column-count: 4; }
}

.empty-state {
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px dashed rgba(188, 122, 92, 0.4);
  border-radius: var(--r-xl);
}
.empty-state .material-symbols-rounded {
  font-size: 44px;
  color: var(--terracotta);
}
.empty-state h3 { margin: 0.5rem 0 0.25rem; font-family: var(--font-display); color: var(--wine); font-size: 22px; }
.empty-state p { margin: 0 0 var(--space-lg); color: var(--on-surface-variant); }

.skeleton {
  border-radius: var(--r);
  background: linear-gradient(100deg, rgba(255,255,255,0.5) 30%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0.5) 70%) var(--surface-high);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.load-sentinel {
  display: flex;
  justify-content: center;
  padding: var(--space-lg) 0;
  color: var(--outline);
  font-size: 14px;
  font-weight: 600;
}

.new-toast {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 128px);
  left: 50%;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border: 0;
  border-radius: var(--r-full);
  background: var(--wine);
  color: var(--champagne);
  font-weight: 700;
  font-size: 15px;
  box-shadow: var(--shadow-3);
  cursor: pointer;
  transform: translate(-50%, -20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--ease-spring), opacity 0.3s;
}
.new-toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }

/* =====================================================================
   Bottom navigation
   ===================================================================== */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  z-index: 40;
  width: min(calc(100% - 24px), 440px);
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 0.5rem;
  transform: translateX(-50%);
  background: rgba(255, 252, 246, 0.88);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(188, 122, 92, 0.2);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-3);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.4rem 0;
  color: var(--outline);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
}
.nav-item .material-symbols-rounded { font-size: 26px; transition: transform 0.3s var(--ease-spring); }
.nav-item[aria-current="page"] { color: var(--wine); }
.nav-item[aria-current="page"] .material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  transform: translateY(-1px) scale(1.06);
}
.nav-fab {
  width: 64px; height: 64px;
  margin: 0 0.75rem;
  margin-top: -26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, #d0604f, var(--poppy) 55%, #a63c2f);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 24px -6px rgba(194, 79, 64, 0.6), 0 0 0 5px var(--linen);
  transition: transform 0.3s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}
.nav-fab:hover { transform: scale(1.06) rotate(-4deg); }
.nav-fab:active { transform: scale(0.94); }
.nav-fab .material-symbols-rounded { font-size: 30px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }

/* =====================================================================
   Sheets, lightbox, confetti
   ===================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(102, 20, 17, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.3s var(--ease-out);
}
.overlay[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } }

.sheet {
  width: min(100%, 520px);
  max-height: 92dvh;
  overflow: auto;
  padding: var(--space-lg) var(--margin) calc(env(safe-area-inset-bottom) + var(--space-lg));
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-3);
  text-align: center;
  animation: sheet-up 0.5s var(--ease-spring);
}
@media (min-width: 560px) {
  .overlay { align-items: center; }
  .sheet { border-radius: var(--r-xl); }
}
@keyframes sheet-up { from { transform: translateY(60px); opacity: 0; } }
.sheet-grip { width: 44px; height: 5px; margin: 0 auto var(--space-lg); border-radius: 3px; background: var(--outline-variant); }
.success-badge {
  width: 88px; height: 88px;
  margin: 0 auto var(--space-md);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--butter);
  color: var(--wine);
  box-shadow: 0 0 0 10px rgba(249, 222, 160, 0.35);
  animation: badge-pop 0.7s var(--ease-spring) 0.1s both;
}
.success-badge .material-symbols-rounded { font-size: 44px; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 48; }
@keyframes badge-pop { from { transform: scale(0.3) rotate(-30deg); opacity: 0; } }
.sheet .lede { margin-bottom: var(--space-lg); }
.sheet .cta-stack { margin-top: 0; }

/* =====================================================================
   Lightbox: Scaled Media Viewer & Well-Wishes
   ===================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 6, 5, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-in 0.25s var(--ease-out);
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  background: #1e0907;
  color: var(--linen);
  overflow: hidden;
}

/* Lightbox top bar */
.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 0.6rem) var(--margin) 0.6rem;
  background: rgba(18, 6, 5, 0.85);
  border-bottom: 1px solid rgba(255, 231, 194, 0.08);
  flex-shrink: 0;
  z-index: 10;
}
.lightbox-bar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.lightbox-bar-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  color: var(--butter);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lightbox-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.lightbox-bar .round-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
  width: 40px;
  height: 40px;
  transition: background-color 0.2s, transform 0.2s;
}
.lightbox-bar .round-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

/* Lightbox body: Split layout on desktop / tablet, stacked on mobile */
.lightbox-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Media Stage: Perfectly scales photo/video to fit display */
.lightbox-stage {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 0.5rem;
  position: relative;
  overflow: hidden;
}
.lightbox-media-frame {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r-sm);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  animation: zoom-in 0.35s var(--ease-spring);
  outline: none;
  display: block;
}
.lightbox-stage video {
  background: #000;
}
@keyframes zoom-in { from { transform: scale(0.92); opacity: 0; } }

/* Lightbox foot: Heart button docked below the image/video */
.lightbox-foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem var(--margin) calc(env(safe-area-inset-bottom) + 0.75rem);
  background: rgba(18, 6, 5, 0.85);
  border-top: 1px solid rgba(255, 231, 194, 0.08);
  z-index: 10;
}
#lightbox-heart {
  display: flex;
  align-items: center;
  justify-content: center;
}
#lightbox-heart .heart-btn {
  background: rgba(255, 255, 255, 0.12);
  color: var(--poppy);
  border: 1px solid rgba(194, 79, 64, 0.35);
  font-size: 15px;
  min-height: 44px;
  padding: 0 1.25rem;
  gap: 0.45rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
#lightbox-heart .heart-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.06);
}
#lightbox-heart .heart-btn.hearted {
  background: rgba(194, 79, 64, 0.3);
  border-color: var(--poppy);
  color: #fff;
}
#lightbox-heart .heart-btn .material-symbols-rounded {
  font-size: 21px;
}

/* Desktop & Tablet Layout */
@media (min-width: 820px) {
  .lightbox-dialog {
    width: min(1040px, 92vw);
    height: min(90vh, 900px);
    border-radius: var(--r-xl);
    border: 1px solid rgba(255, 231, 194, 0.15);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.75);
  }
  .lightbox-bar {
    padding: 0.75rem 1.25rem;
  }
  .lightbox-stage {
    padding: 1.25rem;
  }
  .lightbox-stage img,
  .lightbox-stage video {
    border-radius: var(--r-md);
  }
  .lightbox-foot {
    padding: 0.85rem 1.25rem;
  }
}

/* Landscape Mobile Layout */
@media (max-width: 819px) and (orientation: landscape) and (max-height: 520px) {
  .lightbox-stage {
    padding: 0.35rem;
  }
  .lightbox-foot {
    padding: 0.4rem 1rem calc(env(safe-area-inset-bottom) + 0.4rem);
  }
  #lightbox-heart .heart-btn {
    min-height: 36px;
    font-size: 13.5px;
    padding: 0 0.9rem;
  }
}

/* Comment button on cards */
.comment-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 38px;
  padding: 0 0.65rem;
  border: 0;
  border-radius: var(--r-full);
  background: rgba(102, 20, 17, 0.06);
  color: var(--wine);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s, transform 0.2s var(--ease-spring);
  flex: none;
}
.comment-card-btn:hover {
  background: rgba(102, 20, 17, 0.12);
  transform: scale(1.05);
}
.comment-card-btn .material-symbols-rounded {
  font-size: 19px;
  color: var(--terracotta);
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 96px);
  z-index: 90;
  max-width: calc(100% - 32px);
  padding: 0.8rem 1.2rem;
  border-radius: var(--r-full);
  background: var(--inverse-surface, #31312c);
  color: var(--linen);
  font-weight: 600;
  font-size: 15px;
  box-shadow: var(--shadow-3);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: transform 0.35s var(--ease-spring), opacity 0.25s;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
