:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --navy: #070e14;
  --navy-mid: #0b141c;
  --navy-soft: #121c26;
  --gold: #c9a84c;
  --gold-bright: #e4c878;
  --gold-dim: #8a7234;
  --cream: #f3ead2;
  --text: #e6dcc0;
  --muted: #a89468;
  --danger: #c97a6a;
  --line: rgba(201, 168, 76, 0.28);
  --nav-bg: rgba(7, 14, 20, 0.72);
  --nav-bg-solid: rgba(7, 14, 20, 0.94);
  --nav-menu-bg: rgba(7, 14, 20, 0.97);
  --surface: rgba(12, 20, 28, 0.65);
  --input-bg: rgba(0, 0, 0, 0.28);
  --ambient-glow: rgba(201, 168, 76, 0.07);
  --ambient-top: #050910;
  --ambient-bottom: #091019;
  --btn-ink: #120e06;
  --font-script: "Great Vibes", cursive;
  --font-display: "Cinzel", serif;
  --font-body: "Cormorant Garamond", serif;
  --max: 980px;
  --nav-h: 64px;
  --space: clamp(3rem, 8vw, 6rem);
}

html[data-theme="light"] {
  color-scheme: light;
  --navy: #f7f1e6;
  --navy-mid: #efe6d4;
  --navy-soft: #e8deca;
  --gold: #a8842e;
  --gold-bright: #8f6f22;
  --gold-dim: #9a7d3d;
  --cream: #1a2430;
  --text: #2a3440;
  --muted: #6b5a3a;
  --danger: #b15a4c;
  --line: rgba(143, 111, 34, 0.28);
  --nav-bg: rgba(247, 241, 230, 0.78);
  --nav-bg-solid: rgba(247, 241, 230, 0.96);
  --nav-menu-bg: rgba(247, 241, 230, 0.98);
  --surface: rgba(255, 252, 246, 0.88);
  --input-bg: rgba(255, 255, 255, 0.75);
  --ambient-glow: rgba(168, 132, 46, 0.1);
  --ambient-top: #faf6ee;
  --ambient-bottom: #efe6d4;
  --btn-ink: #120e06;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--navy);
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, var(--ambient-glow), transparent 55%),
    linear-gradient(180deg, var(--ambient-top) 0%, var(--navy) 40%, var(--ambient-bottom) 100%);
  pointer-events: none;
  transition: background 0.35s ease;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--gold);
  color: var(--btn-ink);
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.skip-link:focus {
  top: calc(var(--nav-h) + 0.5rem);
}

/* --- Nav --- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--nav-bg);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.25s, border-color 0.25s;
}

.top-nav.is-scrolled,
.top-nav.is-open {
  background: var(--nav-bg-solid);
  border-bottom-color: var(--line);
}

.nav-inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 1.75rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-family: var(--font-script);
  font-size: 1.65rem;
  color: var(--gold-bright);
  text-decoration: none;
  line-height: 1;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  order: 3;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold-bright);
}

.theme-toggle-icon {
  display: none;
  line-height: 0;
}

html[data-theme="dark"] .theme-toggle-icon--sun {
  display: block;
}

html[data-theme="light"] .theme-toggle-icon--moon {
  display: block;
}

.music-toggle {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.music-toggle:hover {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold-bright);
}

.music-toggle-icon {
  display: none;
  line-height: 0;
}

.music-toggle-icon--loading {
  font-size: 1.1rem;
  letter-spacing: 0.1em;
}

.music-toggle[data-state="loading"] .music-toggle-icon--loading {
  display: block;
}

.music-toggle[data-state="on"] .music-toggle-icon--on {
  display: block;
}

.music-toggle[data-state="off"] .music-toggle-icon--off {
  display: block;
}

.nav-rsvp-btn {
  min-height: 40px;
  padding: 0 1.1rem;
  font-size: 0.62rem;
  animation: nav-rsvp-pulse 2.4s ease-in-out infinite;
}

.nav-rsvp-btn:hover,
.nav-rsvp-btn:focus-visible {
  animation-play-state: paused;
}

/* Feed sits in the main menu, right after Programme, as a hollow gold-outlined
   button. The text is cream (white on the dark theme, dark on the light theme). */
.nav-menu .nav-menu-cta a.btn {
  display: inline-flex;
  min-height: 40px;
  padding: 0 1.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cream);
}

.nav-menu .nav-menu-cta a.btn:hover,
.nav-menu .nav-menu-cta a.btn:focus-visible {
  color: var(--cream);
}

/* The hero's Programme and Feed buttons: larger text. Feed is the solid gold
   one; Programme is hollow, with cream text (white on the dark theme, dark on
   the light theme). */
.btn-cta {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.btn-ghost.btn-cta,
.btn-ghost.btn-cta:hover,
.btn-ghost.btn-cta:focus-visible {
  color: var(--cream);
}

/* Set when the welcome popup was shown in the last 10 minutes. */
.welcome-seen #welcome-modal {
  display: none;
}

@keyframes nav-rsvp-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.55);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(201, 168, 76, 0);
  }
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 1px;
  margin: 0 auto 5px;
  background: var(--gold);
  transition: transform 0.25s, opacity 0.2s;
}

.nav-toggle span:first-child {
  margin-top: 2px;
}

.nav-toggle span:last-child {
  margin-bottom: 0;
}

.top-nav.is-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.top-nav.is-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.top-nav.is-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
  order: 2;
}

.nav-menu a {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  color: var(--gold-bright);
}

section[id] {
  scroll-margin-top: calc(var(--nav-h) + 0.5rem);
}

/* --- Shared type --- */
.eyebrow,
.section-kicker {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.section-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-style: italic;
  color: var(--cream);
  text-align: center;
  line-height: 1.2;
}

.brand {
  margin: 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 5.8rem);
  line-height: 1.05;
  color: var(--gold-bright);
}

.theme-line {
  margin: 1rem 0 2rem;
  font-family: var(--font-display);
  font-size: clamp(0.7rem, 2vw, 0.82rem);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.rule {
  width: 48px;
  height: 1px;
  margin: 1.75rem 0 0;
  background: var(--gold);
  opacity: 0.55;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: min(92vh, 920px);
  display: grid;
  place-items: end center;
  padding: calc(var(--nav-h) + 2rem) 1.25rem 4rem;
  overflow: hidden;
  animation: rise 1s ease both;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  transform: scale(1.08);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 14, 20, 0.35) 0%, rgba(7, 14, 20, 0.15) 35%, rgba(7, 14, 20, 0.82) 72%, rgba(7, 14, 20, 0.96) 100%),
    linear-gradient(90deg, rgba(7, 14, 20, 0.35), transparent 30%, transparent 70%, rgba(7, 14, 20, 0.35));
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  text-align: center;
  animation: rise 1.1s 0.12s ease both;
}

.hero-content .eyebrow {
  color: rgba(228, 200, 120, 0.8);
}

.hero-content .brand {
  color: #e4c878;
}

.hero-content .theme-line {
  color: #c9a84c;
}

/* --- Details --- */
.details {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--space) clamp(1.25rem, 4vw, 2rem);
}

.details-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.invite-message {
  margin: 0;
  max-width: 34ch;
  font-family: var(--font-body);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.45;
  color: var(--cream);
}

.event-meta {
  margin: 0;
  display: grid;
  gap: 1.35rem;
}

.event-meta dt {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.3rem;
}

.event-meta dd {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  color: var(--text);
}

.event-meta span {
  color: var(--muted);
}

/* --- Countdown --- */
.countdown-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem) var(--space);
  text-align: center;
  border-top: 1px solid var(--line);
  padding-top: var(--space);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.5rem, 2vw, 1.25rem);
  margin-top: 1.75rem;
}

.countdown-unit {
  padding: 0.35rem 0.25rem;
}

.countdown-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.75rem);
  font-weight: 500;
  color: var(--gold-bright);
  line-height: 1;
  letter-spacing: 0.04em;
}

.countdown-label {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(0.55rem, 1.6vw, 0.62rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.countdown-done {
  margin: 1.25rem 0 0;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--gold-bright);
}

/* --- Family --- */
.family-band {
  margin: 0 0 var(--space);
}

.family-band figure {
  margin: 0;
}

.family-band img {
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  object-position: center 35%;
}

.family-band figcaption {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem clamp(1.25rem, 4vw, 2rem) 0;
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

/* --- Policies --- */
.policies {
  max-width: 420px;
  margin: 0 auto var(--space);
  padding: 0 clamp(1.25rem, 4vw, 2rem);
  text-align: center;
}

.policies ul {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.policies li {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  font-style: italic;
  color: var(--text);
  margin: 0.65rem 0;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.14);
}

.policies li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.policies strong {
  font-style: normal;
  font-family: var(--font-display);
  font-size: 0.85em;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  font-weight: 500;
}

/* --- Programme --- */
.programme {
  max-width: 860px;
  margin: 0 auto var(--space);
  padding: 0 clamp(1.25rem, 4vw, 2rem);
  text-align: center;
}

#programme-nav[hidden],
#programme-cta[hidden],
.programme-status[hidden],
.programme-ended[hidden] {
  display: none;
}

.programme-ended {
  margin: -1.25rem 0 2rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.programme-page {
  padding-top: calc(var(--nav-h) + var(--space));
  min-height: 70vh;
}

.programme-status {
  margin: 1.5rem 0 0;
  font-style: italic;
  color: var(--muted);
}

/* Kicker, title and date share one line (wrapping on narrow screens). The
   list below stays in a narrower column. */
.programme-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.3rem 0.9rem;
  margin-bottom: 2.25rem;
}

.programme-head .section-kicker,
.programme-head .section-title,
.programme-head-date {
  margin: 0;
}

.programme-head .section-title {
  font-size: clamp(1.5rem, 3.2vw, 1.9rem);
}

.programme-head-date {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.programme-head-date[hidden] {
  display: none;
}

.programme-head > * + *::before {
  content: "·";
  margin-right: 0.9rem;
  color: var(--gold-dim);
}

/* Phones: too narrow for all three, so the kicker (kept for screen readers)
   gives way and "Programme · date" stays on one line. */
@media (max-width: 640px) {
  .programme-head {
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 0 0.6rem;
  }

  .programme-head .section-kicker {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .programme-head .section-title::before {
    display: none;
  }

  .programme-head > .programme-head-date::before {
    margin-right: 0.6rem;
  }

  .programme-head-date {
    font-size: 0.62rem;
    letter-spacing: 0.14em;
  }
}

.programme-page .programme-days,
.programme-page .programme-status {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.programme-day {
  margin-top: 2rem;
  text-align: left;
}

.programme-day:first-child {
  margin-top: 0;
}

.programme-date {
  margin: 0 0 2.25rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gold);
}

.programme-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.programme-item {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.25rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(201, 168, 76, 0.14);
}

.programme-item:last-child {
  border-bottom: none;
}

/* Section headings (e.g. Garden section / Hall) and item numbers. */
.programme-section {
  margin: 1.75rem 0 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gold);
  text-align: center;
}

.programme-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.programme-section-description {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  color: var(--cream);
}

.programme-section-range {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
}

.programme-number {
  margin: 0 0 0.15rem;
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* No times set for the day yet: drop the time column. */
.programme-list.is-untimed .programme-item {
  grid-template-columns: 1fr;
}

.programme-time {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  padding-top: 0.2rem;
}

.programme-name {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  color: var(--cream);
}

.programme-presenter {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.programme-description {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
  white-space: pre-line;
}

/* Live state: the item happening now is highlighted, earlier ones fade. */
.programme-now {
  display: none;
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.programme-item {
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

.programme-item.is-past {
  opacity: 0.45;
}

.programme-item.is-current {
  margin: 0 -0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--ambient-glow);
  box-shadow: 0 0 24px var(--ambient-glow);
}

.programme-item.is-current .programme-now {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.programme-item.is-current .programme-now::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--gold-bright);
  animation: programme-pulse 1.6s ease-in-out infinite;
}

@keyframes programme-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .programme-item.is-current .programme-now::before {
    animation: none;
  }
}

/* --- RSVP --- */
.rsvp {
  max-width: 480px;
  margin: 0 auto var(--space);
  padding: 0 clamp(1.25rem, 4vw, 2rem);
  text-align: center;
}

.rsvp-lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-style: italic;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 1rem;
}

.modal-overlay[hidden] {
  display: none !important;
}

html.modal-open,
html.modal-open body {
  overflow: hidden;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 7, 0.95);
  animation: rise 0.2s ease both;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--navy-soft);
  border: 1px solid var(--line);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  animation: rise 0.3s ease both;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
  background: rgba(201, 168, 76, 0.08);
}

.welcome-card {
  padding: clamp(2.75rem, 8vw, 3.75rem) clamp(1.5rem, 4vw, 2.25rem);
  text-align: center;
}

.welcome-title {
  margin: 0.6rem 0;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.1rem, 7vw, 3.2rem);
  line-height: 1.15;
  color: var(--gold-bright);
}

.welcome-card .theme-line {
  margin: 0.75rem 0 2rem;
}

.rsvp-card {
  padding: clamp(2.5rem, 7vw, 3.5rem) clamp(1.5rem, 4vw, 2.25rem);
  text-align: left;
}

.rsvp-step {
  animation: rise 0.4s ease both;
}

.rsvp-step[hidden] {
  display: none !important;
}

label,
.msg-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.6rem;
}

.input-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

input[type="text"],
input[type="tel"],
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--cream);
  background: var(--input-bg);
  border: 1px solid var(--line);
  padding: 1rem 1.2rem;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: var(--gold);
}

textarea {
  resize: vertical;
  margin-bottom: 1.25rem;
}

.form-error {
  margin: 0.85rem 0 0;
  color: var(--danger);
  font-size: 1rem;
}

.confirm-question {
  margin: 0 0 1rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.45rem, 4vw, 1.9rem);
  color: var(--cream);
  text-align: center;
}

.confirm-question span {
  color: var(--gold-bright);
  font-style: normal;
  font-family: var(--font-display);
  font-size: 0.85em;
  letter-spacing: 0.04em;
}

.party-size-note {
  margin: 0 0 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.party-size-note[hidden] {
  display: none !important;
}

.strict-notice {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1rem;
  border-left: 1px solid var(--gold);
  background: rgba(201, 168, 76, 0.06);
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.55;
}

.greeting {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--cream);
  text-align: center;
}

fieldset {
  border: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

legend {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.75rem;
  padding: 0;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(201, 168, 76, 0.18);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  transition: border-color 0.2s, background 0.2s;
}

.choice:hover,
.choice:has(input:checked) {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.06);
}

.choice input {
  accent-color: var(--gold);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.review-summary {
  margin: 0 0 1.5rem;
  padding: 1rem 1.2rem;
  background: var(--input-bg);
  border: 1px solid var(--line);
  text-align: center;
}

.review-name {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.review-answer {
  margin: 0;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--gold-bright);
}

.review-message {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  color: var(--text);
}

.review-message[hidden] {
  display: none !important;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  padding: 0.9rem 1.4rem;
  border: 1px solid var(--gold);
  min-height: 46px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-gold {
  background: var(--gold);
  color: var(--btn-ink);
  border-color: var(--gold);
}

.btn-gold:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

.btn-ghost {
  background: transparent;
  color: var(--gold);
}

.btn-ghost:hover {
  background: rgba(201, 168, 76, 0.08);
}

.btn-lg {
  padding: 1rem 1.6rem;
}

.success-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.6rem, 4vw, 2rem);
  color: var(--gold-bright);
  text-align: center;
}

.success-body {
  margin: 0 0 1.5rem;
  color: var(--text);
  text-align: center;
}

#success-step {
  text-align: center;
}

#success-step .btn {
  margin: 0.3rem;
}

/* --- Venue --- */
.directions {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem) var(--space);
  text-align: center;
  border-top: 1px solid var(--line);
  padding-top: var(--space);
}

.venue-name {
  margin: 0 0 1.75rem;
  font-style: italic;
  color: var(--muted);
}

.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 220px;
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--navy-soft);
}

.map-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(0.2) contrast(1.04) brightness(0.92);
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--gold-dim);
  font-size: 0.95rem;
}

.footer-brand {
  margin: 0 0 0.4rem;
  font-family: var(--font-script);
  font-size: clamp(1.6rem, 4vw, 2rem);
  color: var(--gold);
}

.footer-credit {
  margin: 1.35rem 0 0;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
}

.footer-credit a {
  color: var(--gold);
  text-decoration: none;
  font-style: normal;
  font-family: var(--font-display);
  font-size: 0.72em;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(201, 168, 76, 0.35);
  transition: color 0.2s, border-color 0.2s;
}

.footer-credit a:hover,
.footer-credit a:focus-visible {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
}

/* --- Motion --- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Breakpoints --- */
@media (min-width: 480px) {
  .input-row {
    flex-direction: row;
  }

  .input-row .btn {
    flex-shrink: 0;
  }
}

@media (min-width: 780px) {
  .details-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
    align-items: center;
  }

  .invite-message {
    max-width: none;
  }

  .event-meta {
    padding-left: 1.5rem;
    border-left: 1px solid var(--line);
  }

  .map-wrap {
    aspect-ratio: 16 / 9;
    min-height: 360px;
  }

  .hero {
    place-items: end center;
    min-height: 100vh;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .nav-actions {
    margin-left: auto;
  }

  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    order: 3;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.35rem 0 1rem;
    background: var(--nav-menu-bg);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }

  .top-nav.is-open .nav-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-menu a {
    display: block;
    padding: 0.95rem 1.25rem;
  }

  .nav-menu .nav-menu-cta {
    padding: 0.6rem 1.25rem 0;
  }

  .nav-menu .nav-menu-cta a.btn {
    display: flex;
    padding: 0.9rem 1.4rem;
  }

  .hero {
    min-height: 78vh;
    padding-bottom: 3rem;
  }

  .hero-media img {
    object-position: 50% 22%;
  }

  .btn-row .btn {
    flex: 1 1 100%;
  }

  #success-step .btn {
    display: flex;
    width: calc(100% - 0.6rem);
    margin: 0.3rem auto;
  }
}

@media (max-width: 380px) {
  body {
    font-size: 1.08rem;
  }

  .countdown-label {
    letter-spacing: 0.1em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* The Feed buttons stay hidden until the API says the admin has switched them on. */
.feed-closed [data-feed-ui] {
  display: none !important;
}

/* RSVP UI stays hidden until the API confirms RSVPs are open. */
.rsvp-closed [data-rsvp-ui] {
  display: none !important;
}

/* Buttons on the right of the small page navs (programme, feed): the link to
   the other page is solid gold, Invitation is hollow. */
.nav-sublinks {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-sublinks .btn {
  min-height: 40px;
  padding: 0 1rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.nav-sublinks .btn[hidden] {
  display: none;
}

/* Small phones: tighten the buttons so both fit. */
@media (max-width: 420px) {
  .nav-sublinks {
    gap: 0.45rem;
  }

  .nav-sublinks .btn {
    padding: 0 0.7rem;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 340px) {
  .nav-sublinks .btn {
    padding: 0 0.55rem;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }
}

/* --- Feed (guest shares) --- */
.feed-page {
  padding-top: calc(var(--nav-h) + var(--space));
  padding-bottom: var(--space);
  min-height: 70vh;
}

.feed-page [hidden] {
  display: none !important;
}

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

.feed-intro,
.share-card,
.feed {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

.feed-intro {
  text-align: center;
  max-width: 560px;
}

.feed-lead {
  margin: 1rem 0 0;
  font-style: italic;
  color: var(--muted);
  font-size: 1.15rem;
}

.feed-views {
  margin: 0.85rem 0 0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gold-dim);
}

/* Acknowledgements and Sponsors — scrolling strip; contacts on hover/tap. */
.acknowledgements {
  max-width: none;
  margin: 1.75rem 0 0;
  padding: 0;
  text-align: center;
  overflow: visible;
}

html[data-view="share"] .acknowledgements {
  display: none;
}

.acknowledgements[hidden] {
  display: none;
}

.acknowledgements-label {
  margin: 0 0 0.9rem;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.acknowledgements-marquee {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 0.35rem 0 0.5rem;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  scrollbar-width: none;
  -ms-overflow-style: none;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.acknowledgements-marquee::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.acknowledgements-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 1.1rem;
  width: max-content;
  animation: acknowledgements-scroll linear infinite;
  will-change: transform;
}

/* Pause only while a contact menu is open — keep autoscroll otherwise. */
.acknowledgements-marquee.is-paused .acknowledgements-track {
  animation-play-state: paused;
}

@keyframes acknowledgements-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.acknowledgements-card {
  position: relative;
  flex: 0 0 auto;
  width: 132px;
}

.acknowledgements-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 68px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.acknowledgements-logo:hover,
.acknowledgements-logo:focus-visible,
.acknowledgements-card.is-open .acknowledgements-logo {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.acknowledgements-logo:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--navy), 0 0 0 4px var(--gold);
}

.acknowledgements-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Body-level popover — must sit outside the transformed marquee track. */
.acknowledgements-popover {
  position: fixed;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 12.5rem;
  max-width: min(18rem, 72vw);
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(8, 10, 14, 0.98);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s ease;
}

.acknowledgements-popover.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.acknowledgements-popover[hidden] {
  display: none !important;
}

.acknowledgements-menu-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.acknowledgements-menu-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  padding: 0.3rem 0.1rem;
  text-decoration: none;
  text-align: left;
  color: var(--cream);
}

.acknowledgements-menu-kind {
  font-family: var(--font-display);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.acknowledgements-menu-value {
  max-width: 100%;
  font-family: var(--font-body, inherit);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--cream);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.acknowledgements-menu-link:hover .acknowledgements-menu-value,
.acknowledgements-menu-link:focus-visible .acknowledgements-menu-value {
  color: var(--gold-bright);
}

/* Per-item / lightbox share buttons still use these classes. */
.share-via-label {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.share-via-actions {
  display: flex;
  justify-content: center;
  gap: 1.35rem;
}

.share-via-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 4.75rem;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.share-via-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
}

.share-via-logo svg {
  display: block;
  width: 30px;
  height: 30px;
}

.share-via-btn--whatsapp .share-via-logo {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}

.share-via-btn--link .share-via-logo {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--btn-ink);
}

.share-via-btn--email .share-via-logo {
  background: var(--navy-soft);
  color: var(--gold-bright);
}

.share-via-btn:hover .share-via-logo,
.share-via-btn:focus-visible .share-via-logo {
  transform: translateY(-2px);
}

.share-via-btn:focus-visible {
  outline: none;
}

.share-via-btn:focus-visible .share-via-logo {
  box-shadow: 0 0 0 2px var(--navy), 0 0 0 4px var(--gold);
}

.share-via-btn.is-copied .share-via-caption {
  color: var(--gold-bright);
}

.share-via-note {
  margin: 0.75rem 0 0;
  font-style: italic;
  color: var(--gold);
}

.feed .feed-views {
  margin-top: -0.15rem;
  margin-bottom: 0.25rem;
}

/* Which of the three views is showing (chosen by ?view= before the page paints). */
.feed-view {
  display: none;
}

html[data-view="home"] #view-home,
html[data-view="share"] #view-share,
html[data-view="view"] #view-feed {
  display: block;
}

html[data-view="view"] #timer-wrap {
  display: none;
}

/* The page intro only belongs on the landing view. */
html[data-view="share"] .feed-intro,
html[data-view="view"] .feed-intro {
  display: none;
}

.feed-timer {
  max-width: 560px;
  margin: 1.5rem auto 0;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

.feed-timer .share-timer {
  margin: 0;
}

/* The two big choices on /feed/ */
.feed-choices {
  display: grid;
  gap: 1rem;
  max-width: 760px;
  margin: 2rem auto 0;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

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

  .feed-choices > :only-child {
    grid-column: 1 / -1;
    max-width: 360px;
    justify-self: center;
    width: 100%;
  }
}

.feed-choice {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  min-height: 170px;
  padding: 1.75rem 1.25rem;
  text-align: center;
  text-decoration: none;
  color: var(--cream);
  border: 1px solid var(--gold);
  transition: background 0.2s, border-color 0.2s;
}

.feed-choice:hover,
.feed-choice:focus-visible {
  background: rgba(201, 168, 76, 0.1);
}

.feed-choice--share {
  background: var(--gold);
  color: var(--btn-ink);
}

.feed-choice--share:hover,
.feed-choice--share:focus-visible {
  background: var(--gold-bright);
}

.feed-choice-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 3.5vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.feed-choice-hint {
  font-style: italic;
  font-size: 1.1rem;
  opacity: 0.85;
}

/* "Latest moments": every approved share (pinned first), grows with the list. */
.feed-preview {
  max-width: 1100px;
  margin: 2.5rem auto 0;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

@media (min-width: 640px) {
  .preview-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 960px) {
  .preview-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.preview-tile {
  position: relative;
  text-decoration: none;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}

.preview-tile img,
.preview-tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.tile-open {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  text-decoration: none;
  cursor: pointer;
}

.tile-pin {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 2;
  padding: 0.2rem 0.45rem;
  border-radius: 2px;
  background: rgba(212, 160, 72, 0.95);
  color: #1a1208;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.tile-share {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  display: flex;
  gap: 0.3rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.preview-tile:hover .tile-share,
.preview-tile:focus-within .tile-share,
.preview-tile.is-share-open .tile-share {
  opacity: 1;
  pointer-events: auto;
}

.tile-share .share-via-btn {
  min-width: 0;
  min-height: 0;
  gap: 0;
}

.tile-share .share-via-logo {
  width: 30px;
  height: 30px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.tile-share .share-via-logo svg {
  width: 16px;
  height: 16px;
}

.tile-share .share-via-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.tile-share .is-copied .share-via-logo svg {
  display: none;
}

.tile-share .is-copied .share-via-logo::after {
  content: "✓";
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
}

.tile-share .is-copied .share-via-logo {
  background: #1f8f4e;
  border-color: #1f8f4e;
  color: #fff;
}

/* Love button: always visible on a tile, bottom-left. */
.tile-like {
  position: absolute;
  left: 0.45rem;
  bottom: 0.45rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.2rem 0.55rem 0.2rem 0.35rem;
  border: 0;
  border-radius: 999px;
  overflow: visible;
  background: rgba(8, 8, 12, 0.62);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.tile-like-icon {
  display: flex;
  width: 22px;
  height: 22px;
  color: rgba(255, 255, 255, 0.88);
  transition: color 0.18s ease;
}

.tile-like-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tile-like-count {
  min-width: 0.75rem;
  color: rgba(255, 255, 255, 0.92);
}

/* Download: icon-only, bottom-right (mirrors love). */
.tile-download {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 8, 12, 0.62);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.tile-download:disabled {
  opacity: 0.65;
  cursor: wait;
}

.tile-download-icon {
  display: flex;
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.92);
}

.tile-download-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tile-download--lightbox {
  position: static;
  width: 40px;
  height: 40px;
  margin: 0;
  background: rgba(255, 255, 255, 0.1);
}

.tile-download--lightbox .tile-download-icon {
  width: 20px;
  height: 20px;
}

.tile-like.is-liked .tile-like-icon {
  color: #ff4d6d;
}

.tile-like.is-popping .tile-like-icon {
  animation: tile-like-pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.55);
}

.tile-like-burst {
  position: absolute;
  left: 1.1rem;
  top: auto;
  bottom: 1.1rem;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 8;
  overflow: visible;
}

.tile-like-mote {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  color: #ff4d6d;
  opacity: 0;
  animation: tile-like-mote 0.75s cubic-bezier(0.15, 0.85, 0.35, 1) forwards;
  animation-delay: calc(var(--mote-i, 0) * 0.02s);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.tile-like-mote svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes tile-like-pop {
  0% { transform: scale(1); }
  25% { transform: scale(0.7); }
  55% { transform: scale(1.55); }
  78% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

@keyframes tile-like-mote {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform:
      translate(
        calc(-50% + var(--mote-x, 0px)),
        calc(-50% + var(--mote-y, -36px))
      )
      scale(1)
      rotate(40deg);
  }
}

/* Fixed overlay heart — never clipped by masonry tile overflow */
.heart-reaction {
  position: fixed;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #ff4d6d;
  transform: translate(-50%, -50%);
  animation: heart-reaction 1s cubic-bezier(0.2, 0.85, 0.3, 1.15) forwards;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
}

.heart-reaction svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes heart-reaction {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.15);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  35% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -62%) scale(1.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile-like.is-popping .tile-like-icon {
    animation: none;
    transform: scale(1.2);
  }

  .tile-like-mote {
    animation: none;
    opacity: 0;
  }

  .heart-reaction {
    animation: heart-reaction-static 0.7s ease forwards;
  }
}

@keyframes heart-reaction-static {
  0%,
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

.tile-like--lightbox {
  position: static;
  margin: 0 auto 0.65rem;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  min-height: 40px;
  padding: 0.3rem 0.85rem 0.3rem 0.55rem;
}

.tile-like--lightbox .tile-like-icon {
  width: 26px;
  height: 26px;
}

.lightbox-like-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
}

.preview-text {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0.6rem;
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.preview-text p {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0.8rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.preview-embed-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: rgba(255, 248, 230, 0.55);
  background: #12151a;
}

/* "Back" on the share and feed views: a hollow button, easy to tap. */
.view-back {
  margin: 1.5rem 0 0.5rem;
  min-height: 48px;
  padding: 0 1.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--cream);
}

.view-back:hover,
.view-back:focus-visible {
  color: var(--cream);
}

#view-share,
#view-feed {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}

#view-feed {
  max-width: 1240px;
}

#view-feed .share-heading {
  margin-top: 1.25rem;
}

/* The stepped form's card */
.share-card {
  /* keep the top of the card clear of the fixed nav when a step scrolls it into view */
  scroll-margin-top: calc(var(--nav-h) + 12px);
  margin-top: 0.75rem;
  padding: 1.75rem clamp(1.1rem, 4vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--line);
}

.share-heading {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  color: var(--gold);
}

.share-timer {
  margin: 0 0 1.25rem;
  padding: 0.7rem 1rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
  border: 1px solid var(--line);
  background: rgba(201, 168, 76, 0.07);
  font-variant-numeric: tabular-nums;
}

.share-timer.is-closed {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.1rem;
  letter-spacing: 0;
  background: transparent;
  border: none;
}

#share-form label {
  margin-top: 1.1rem;
}

#share-form > label:first-child {
  margin-top: 0;
}

.optional {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-style: italic;
}

.share-drop {
  display: block;
  margin: 0 !important;
  padding: 1.4rem 1rem;
  text-align: center;
  cursor: pointer;
  color: var(--cream);
  border: 1px dashed var(--gold-dim);
  background: var(--input-bg);
  letter-spacing: 0.1em;
}

.share-drop:hover,
.share-drop:focus-within {
  border-color: var(--gold);
}

.share-drop-title {
  display: block;
  font-size: 0.85rem;
  color: var(--gold-bright);
}

.share-drop-hint {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.share-files {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.share-file {
  display: grid;
  grid-template-columns: 56px 1fr 44px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem;
  border: 1px solid var(--line);
  background: var(--input-bg);
}

.share-file.has-error {
  border-color: var(--danger);
}

.share-file-thumb {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.share-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-file-info {
  min-width: 0;
}

.share-file-name,
.share-file-status {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-file-name {
  white-space: nowrap;
  color: var(--cream);
  font-size: 1rem;
}

.share-file-status {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--muted);
}

.share-file.has-error .share-file-status {
  color: var(--danger);
}

.share-file-bar {
  height: 4px;
  margin-top: 0.4rem;
  background: rgba(201, 168, 76, 0.18);
}

.share-file-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 0.2s linear;
}

.share-file-remove {
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.share-file-remove:disabled {
  opacity: 0.35;
  cursor: default;
}

.share-count {
  margin: -0.9rem 0 1rem;
  text-align: right;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Text share preview and pickers */
.text-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  max-height: 360px;
  margin: 0 auto 0.5rem;
  padding: 1.5rem;
  text-align: center;
  line-height: 1.3;
  white-space: pre-line;
  overflow-wrap: anywhere;
  overflow: hidden;
}

.text-preview.is-empty {
  opacity: 0.6;
}

.pick-label {
  margin: 1.1rem 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.pick-row {
  display: grid;
  gap: 0.6rem;
}

/* Column counts chosen so every row is full at any width: 8 backgrounds in two
   rows of 4, 5 fonts in one row, 6 colours in one row. */
#pick-background {
  grid-template-columns: repeat(4, 1fr);
}

#pick-font {
  grid-template-columns: repeat(5, 1fr);
}

#pick-color {
  grid-template-columns: repeat(6, 1fr);
}

.pick-option {
  position: relative;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  cursor: pointer;
  border: 2px solid transparent;
  outline: 1px solid var(--line);
  outline-offset: 2px;
  color: var(--cream);
  background: var(--input-bg);
}

.pick-option[aria-pressed="true"] {
  border-color: var(--gold-bright);
  outline-color: var(--gold-bright);
}

.pick-swatch {
  height: 56px;
}

.pick-dot {
  border-radius: 50%;
  width: 100%;
  max-width: 52px;
  aspect-ratio: 1 / 1;
  min-height: 0;
  justify-self: center;
}

.pick-font {
  min-width: 0;
  padding: 0.25rem 0.1rem;
  font-size: 1.5rem;
  line-height: 1.1;
}

.pick-caption {
  display: block;
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Feedback popup (success and errors) */
.notice-card {
  text-align: center;
}

.notice-card .success-body {
  overflow-wrap: anywhere;
}

.notice-card.is-error .success-title {
  color: var(--danger);
}

.notice-card .btn {
  min-width: 8rem;
}

/* The stepped share form */
.share-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.share-step-dot {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
}

/* The line joining one step to the next. */
.share-step-dot + .share-step-dot::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 50%;
  width: 100%;
  height: 1px;
  background: var(--line);
}

.share-step-dot span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--navy-soft);
  border: 1px solid var(--line);
}

.share-step-dot.is-done span {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.share-step-dot.is-done + .share-step-dot::before,
.share-step-dot.is-current::before {
  background: var(--gold);
}

.share-step-dot.is-current span {
  color: var(--btn-ink);
  background: var(--gold);
  border-color: var(--gold);
}

.share-step-title {
  margin: 0 0 1.1rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.35rem, 4vw, 1.6rem);
  font-weight: 500;
  text-align: center;
  color: var(--cream);
}

.share-choices {
  display: grid;
  gap: 0.75rem;
}

.share-choice {
  display: block;
  font-family: var(--font-body);
  width: 100%;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  color: var(--cream);
  background: var(--input-bg);
  border: 1px solid var(--line);
  transition: border-color 0.2s, background 0.2s;
}

.share-choice:hover,
.share-choice:focus-visible,
.share-choice[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
}

.share-choice-title {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.share-choice-hint {
  display: block;
  margin-top: 0.4rem;
  font-style: italic;
  color: var(--muted);
}

.share-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.share-nav:has(#share-back:not([hidden])):has(#share-next:not([hidden])) {
  grid-template-columns: 1fr 2fr;
}

.share-nav .btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.share-nav [hidden] {
  display: none;
}

/* Review step */
.share-review {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.review-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.14);
}

.review-label {
  flex: none;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  padding-top: 0.25rem;
}

.review-value {
  text-align: right;
  color: var(--cream);
  overflow-wrap: anywhere;
}

.share-files--review .share-file {
  grid-template-columns: 56px 1fr;
}

.review-text {
  margin-bottom: 0.5rem;
}

.share-review-note {
  margin: 1rem 0 0;
  text-align: center;
  font-style: italic;
  color: var(--muted);
}

/* The feed itself */
.feed {
  margin-top: 0;
}

.feed .programme-status {
  text-align: center;
}

/* The feed view: a wide masonry of tiles (2 to 5 columns), each opening the gallery. */
.view-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.view-bar .view-back {
  margin: 0;
}

.feed-upload {
  flex: none;
}

.feed-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.feed-controls[hidden] {
  display: none;
}

.feed-select {
  min-height: 48px;
  max-width: 100%;
  padding: 0 0.9rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--cream);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
}

.feed-select:focus-visible {
  outline: none;
  border-color: var(--gold);
}

.feed-select option {
  background: var(--navy-soft);
  color: var(--cream);
}

@media (max-width: 719px) {
  .feed-controls {
    width: 100%;
  }

  /* Type and sort share a row; the poster list, which has the longest names, gets its own. */
  .feed-select {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
  }

  #filter-poster {
    order: 3;
    flex-basis: 100%;
  }
}

.feed-grid {
  margin: 1rem 0 0;
}

.feed-load-more {
  margin: 1.25rem 0 0.5rem;
  text-align: center;
  color: var(--muted, #9aa3ad);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.feed-load-more[hidden] {
  display: none;
}

.masonry {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

button.preview-tile {
  width: 100%;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.feed-tile {
  transition: border-color 0.2s, transform 0.2s;
}

.feed-tile:hover,
.feed-tile:focus-visible {
  border-color: var(--gold);
}

.feed-tile img,
.feed-tile video {
  height: 100%;
}

/* Full-screen gallery */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 10, 0.96);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 0.75rem 0.5rem;
  touch-action: pan-y;
}

@media (min-width: 720px) {
  .lightbox-stage {
    padding: 3.5rem 5rem 0.5rem;
  }
}

.lightbox-stage img,
.lightbox-stage video,
.lightbox-stage iframe.lightbox-embed {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
}

.lightbox-stage iframe.lightbox-embed {
  width: min(92vw, 56rem);
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}

.lightbox-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(92vw, 68vh);
  aspect-ratio: 1 / 1;
  padding: 1.75rem;
  text-align: center;
  line-height: 1.3;
  white-space: pre-line;
  overflow-wrap: anywhere;
  overflow: hidden;
}

.lightbox-text p {
  margin: 0;
}

.lightbox-info {
  flex: none;
  width: 100%;
  max-width: 720px;
  padding: 0.5rem 1.25rem 1.25rem;
  text-align: center;
}

.lightbox-info p {
  margin: 0;
}

.lightbox-share {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6.5rem;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 1.1rem;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.lightbox-stage:hover ~ .lightbox-share,
.lightbox-share:hover,
.lightbox.is-share-open .lightbox-share {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-caption {
  color: var(--cream);
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.lightbox-author {
  margin-top: 0.25rem !important;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.lightbox-count {
  margin-top: 0.5rem !important;
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
}

.lightbox-close:hover,
.lightbox-nav:hover,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.lightbox-close {
  top: 0.75rem;
  right: 0.75rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 0.5rem;
}

.lightbox-next {
  right: 0.5rem;
}

@media (min-width: 720px) {
  .lightbox-prev {
    left: 1.25rem;
  }

  .lightbox-next {
    right: 1.25rem;
  }
}

