/* ==========================================================================
   Mazwi & Thabsile — Digital Wedding Invitation
   style.css · mobile-first
   --------------------------------------------------------------------------
    1. Design tokens
    2. Base & typography
    3. Shared components (layout, buttons, ornaments, rings)
    4. Opening envelope
    5. Hero
    6. Countdown
    7. Programme tabs
    8. Venue & calendar
    9. RSVP form
   10. Footer
   11. Music toggle
   12. Scroll reveal
   13. Larger screens
   14. Reduced motion
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Colours */
  --emerald:        #0F3B2A;
  --emerald-deep:   #0A2C1F;
  --emerald-light:  #17553E;
  --gold:           #D9B54A;
  --gold-light:     #EED48A;
  --gold-dark:      #A8862C;
  --cream:          #F6F0DF;
  --cream-muted:    rgba(246, 240, 223, 0.82);
  --gold-line:      rgba(217, 181, 74, 0.42);
  --gold-faint:     rgba(217, 181, 74, 0.12);
  --dot:            rgba(217, 181, 74, 0.07);
  --error:          #F4A896;

  /* Zulu beadwork accents (match assets/images/beadwork.svg) */
  --bead-red:       #B8372B;
  --bead-black:     #151515;
  --beads-height:   24px;

  /* Typography */
  --font-display:   'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --font-body:      'Montserrat', 'Helvetica Neue', Arial, sans-serif;

  /* Shape & motion */
  --radius:         20px;
  --shadow:         0 20px 45px rgba(0, 0, 0, 0.32);
  --ease:           cubic-bezier(0.22, 0.61, 0.36, 1);
  --container:      1080px;
}


/* --------------------------------------------------------------------------
   2. Base & typography
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--cream);
  background-color: var(--emerald);
  /* Faint dotted texture, a nod to shweshwe print */
  background-image: radial-gradient(var(--dot) 1px, transparent 1.6px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
}

/* Stops the page scrolling behind the opening envelope */
body.is-locked {
  overflow: hidden;
}

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

h1, h2, h3, p {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--gold);
}

:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 4px;
}

/* Headings that receive focus from script don't need a ring */
[tabindex="-1"]:focus {
  outline: none;
}

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.amp {
  color: var(--gold);
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* --------------------------------------------------------------------------
   3. Shared components
   -------------------------------------------------------------------------- */

/* Layout */
.container {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.container--narrow {
  --container: 640px;
}

.section {
  position: relative;
  overflow: hidden;
  padding: clamp(4.5rem, 14vw, 7.5rem) 0;
}

/* Darker band; semi-transparent so the dotted texture still shows */
.section--deep {
  background-color: rgba(4, 22, 15, 0.38);
  border-block: 1px solid var(--gold-faint);
}

.section__header {
  margin-bottom: clamp(2.25rem, 7vw, 3.25rem);
  text-align: center;
}

.section__title {
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 9vw, 3.6rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
  color: var(--cream);
}

.section__subtitle {
  max-width: 34ch;
  margin: 1rem auto 0;
  font-size: 0.95rem;
  color: var(--cream-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 50px;
  padding: 0.85rem 1.9rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease),
              transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.btn--gold {
  background-color: var(--gold);
  color: var(--emerald);
  box-shadow: 0 10px 24px rgba(217, 181, 74, 0.22);
}

.btn--gold:hover {
  background-color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(217, 181, 74, 0.3);
}

.btn--gold:active {
  transform: translateY(0);
}

.btn--block {
  width: 100%;
}

/* Gold line — motif — gold line */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin: 1.1rem auto 0;
  color: var(--gold);
}

.ornament::before,
.ornament::after {
  content: "";
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.ornament::after {
  transform: scaleX(-1);
}

/* Small isihlangu (shield) in the middle */
.ornament svg {
  width: 15px;
  height: 24px;
}

/* Zulu beadwork (ubuhlalu) band: one generated tile repeated sideways */
.beadwork {
  height: var(--beads-height);
  background: url("../images/beadwork.svg") repeat-x center / auto 100%;
}

/* Full-width band along the top edge of a section */
.beadwork--edge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
}

/* Decorative concentric circles that sit in section corners */
.rings {
  position: absolute;
  z-index: 0;
  width: clamp(190px, 52vw, 380px);
  height: auto;
  aspect-ratio: 1;
  color: var(--gold);
  opacity: 0.14;
  pointer-events: none;
  animation: slow-spin 140s linear infinite;
}

.rings--tl    { top: 0;    left: 0;   translate: -45% -45%; }
.rings--tr    { top: 0;    right: 0;  translate: 45% -45%; }
.rings--bl    { bottom: 0; left: 0;   translate: -45% 45%; }
.rings--br    { bottom: 0; right: 0;  translate: 45% 45%; }
.rings--left  { top: 50%;  left: 0;   translate: -55% -50%; }
.rings--right { top: 50%;  right: 0;  translate: 55% -50%; }

@keyframes slow-spin {
  to { rotate: 360deg; }
}


/* --------------------------------------------------------------------------
   4. Opening envelope
   -------------------------------------------------------------------------- */

/* Only shown when JavaScript can open it */
.opening {
  display: none;
}

.js .opening {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  text-align: center;
  background:
    radial-gradient(ellipse 90% 55% at 50% 42%, rgba(217, 181, 74, 0.13), transparent 70%),
    radial-gradient(circle at 50% 42%, var(--emerald-light) 0%, var(--emerald) 55%, var(--emerald-deep) 100%);
  transition: opacity 0.7s var(--ease), visibility 0s linear 0.7s;
}

.js .opening[hidden] {
  display: none;
}

.opening.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.opening__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: auto; /* centres vertically without clipping on short screens */
  transition: transform 0.7s var(--ease);
}

.opening.is-leaving .opening__inner {
  transform: scale(1.05);
}

/* Gentle staggered entrance on page load */
.opening__inner > * {
  animation: rise 1s var(--ease) backwards;
}
.opening__inner > :nth-child(2) { animation-delay: 0.15s; }
.opening__inner > :nth-child(3) { animation-delay: 0.3s; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

.opening__welcome,
.opening__details {
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

/* Text steps aside so the rising letter has the stage */
.is-opening .opening__welcome {
  opacity: 0;
  transform: translateY(-12px);
}

.is-opening .opening__details {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.opening__welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.opening__zulu {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 9.5vw, 2.7rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  color: var(--gold);
}

.opening__names {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 11vw, 3.2rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
}

.opening__date {
  margin: 0.6rem 0 1.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream-muted);
}

/* The envelope itself */
.envelope {
  position: relative;
  width: min(80vw, 320px);
  aspect-ratio: 3 / 2;
  margin: 3rem auto 2.25rem; /* top space lets the letter slide up */
  perspective: 1200px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.envelope__back {
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  background: linear-gradient(165deg, #1d6248, #114330);
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.45);
}

.envelope__letter {
  position: absolute;
  top: 6%;
  left: 7%;
  right: 7%;
  height: 88%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding-top: 8%;
  border-radius: 4px;
  background: var(--cream);
  color: var(--emerald);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.85s var(--ease) 0.65s;
}

.envelope__letter-names {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 5vw, 1.4rem);
  font-style: italic;
  font-weight: 600;
  line-height: 1.1;
}

.envelope__letter-line {
  width: 42px;
  height: 1px;
  background: var(--gold-dark);
}

.envelope__letter-date {
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* Front pocket: side flaps and bottom flap, shaded to show the folds */
.envelope__pocket {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  border-radius: 8px;
  pointer-events: none;
}

.envelope__pocket::before,
.envelope__pocket::after {
  content: "";
  position: absolute;
  inset: 0;
}

.envelope__pocket::before {
  background: linear-gradient(180deg, #185a41, #0f4230);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}

.envelope__pocket::after {
  background: linear-gradient(0deg, #1b5f45, #155039);
  clip-path: polygon(0 100%, 50% 48%, 100% 100%);
}

.envelope__pocket svg,
.envelope__flap svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  opacity: 0.55;
  vector-effect: non-scaling-stroke;
}

.envelope__pocket path,
.envelope__flap path {
  vector-effect: non-scaling-stroke;
}

/* Top flap — folds back on open */
.envelope__flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56%;
  z-index: 3;
  transform-origin: 50% 0;
  transition: transform 0.65s var(--ease) 0.2s, filter 0.65s var(--ease) 0.2s,
              z-index 0s linear 0.5s;
}

.envelope__flap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #216d50, #17553e);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* Gold wax seal */
.seal {
  position: absolute;
  top: 56%;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 32% 28%, #F7E3A1 0%, var(--gold) 42%, var(--gold-dark) 100%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4),
              inset 0 -3px 6px rgba(0, 0, 0, 0.18),
              inset 0 3px 4px rgba(255, 255, 255, 0.35);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  color: var(--emerald);
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease);
  animation: seal-pulse 2.8s ease-in-out infinite;
}

.seal::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(15, 59, 42, 0.5);
  border-radius: 50%;
}

.seal::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
}

.seal__amp {
  margin: 0 0.06em;
  font-size: 0.8em;
  opacity: 0.75;
}

@keyframes seal-pulse {
  0%, 100% { scale: 1; }
  50%      { scale: 1.05; }
}

/* Opening sequence: seal lifts → flap folds back → letter slides up */
.is-opening .seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.3);
  animation: none;
}

.is-opening .envelope__flap {
  z-index: 0;
  transform: rotateX(180deg);
  filter: brightness(0.82);
}

.is-opening .envelope__letter {
  transform: translateY(-52%);
}

/* Beaded strap across the envelope; slips off as the seal lifts */
.envelope__band {
  position: absolute;
  top: 56%;
  left: -6px;
  right: -6px;
  z-index: 4;
  height: 20px;
  border-radius: 3px;
  transform: translateY(-50%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.is-opening .envelope__band {
  opacity: 0;
  transform: translateY(-50%) scaleX(0.5);
}


/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: calc(clamp(3.5rem, 13vw, 6rem) + var(--beads-height)) 0 clamp(4.5rem, 14vw, 7rem);
  text-align: center;
  background: radial-gradient(ellipse 80% 45% at 50% 0%, rgba(217, 181, 74, 0.11), transparent 70%);
}

.hero__grid {
  display: grid;
  grid-template-areas:
    "intro"
    "names"
    "photo"
    "invite";
  justify-items: center;
  gap: 1.4rem;
}

.hero__intro  { grid-area: intro; }
.hero__names  { grid-area: names; }
.hero__photo  { grid-area: photo; }
.hero__invite { grid-area: invite; }

.hero__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

/* Pair of izihlangu (shields), one for each family */
.hero__emblem {
  width: 84px;
  height: auto;
  margin-bottom: 0.35rem;
  overflow: visible;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.emblem__stick {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
}

.emblem__body {
  stroke: var(--gold);
  stroke-width: 1.4;
}

.emblem__lace {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
}

/* Cowhide: one light hide with dark patches, one dark hide with light patches */
.emblem__shield--light .emblem__body { fill: var(--cream); }
.emblem__shield--light .emblem__hide { fill: var(--bead-black); }
.emblem__shield--light .emblem__lace { stroke: var(--bead-red); }

.emblem__shield--dark .emblem__body  { fill: var(--bead-black); }
.emblem__shield--dark .emblem__hide  { fill: var(--cream); }
.emblem__shield--dark .emblem__lace  { stroke: var(--gold); }

.hero__zulu {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.2;
  color: var(--cream-muted);
}

.hero__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 13.5vw, 5.4rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  color: var(--cream);
}

.hero__amp {
  margin: 0.08em 0;
  font-size: 0.62em;
  color: var(--gold);
}

/* Arched photo with a thin gold outline */
.hero__photo {
  position: relative;
  width: min(80vw, 360px);
  margin: 1.25rem 0 1rem;
  padding: 11px;
}

.hero__photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  border-radius: 999px 999px 0 0;
  pointer-events: none;
}

/* Small motif breaking the outline at the top of the arch */
.hero__apex {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  padding: 0 8px;
  transform: translate(-50%, -50%);
  background: var(--emerald);
  color: var(--gold);
}

.hero__apex svg {
  width: 20px;
  height: 20px;
}

/* Beaded hem straddling the bottom of the frame */
.hero__beads {
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: -10px;
  z-index: 1;
  height: 20px;
}

.arch {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 999px 999px 0 0;
  background: var(--emerald-deep);
  box-shadow: var(--shadow);
}

.arch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
}

.hero__lead {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--cream-muted);
}

.hero__event {
  margin: 0.35rem auto 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--gold);
}

.hero__event .amp {
  font-style: italic;
  font-weight: 500;
}

.hero__event-sub {
  font-style: italic;
  font-weight: 500;
}

/* Keeps phrases together so lines break in sensible places */
.nowrap {
  white-space: nowrap;
}

.hero__dates {
  margin-top: 1.2rem;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
}

.hero__place {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--cream-muted);
}


/* --------------------------------------------------------------------------
   6. Countdown
   -------------------------------------------------------------------------- */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.5rem, 3vw, 1.5rem);
  max-width: 560px;
  margin: 0 auto;
}

.countdown[hidden] {
  display: none;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

/* Each number sits in a gold ring with an inner ring of beads */
.countdown__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 120px;
  aspect-ratio: 1;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 181, 74, 0.1), transparent 70%);
}

.countdown__ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px dotted rgba(217, 181, 74, 0.55);
  border-radius: 50%;
}

.countdown__value {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 7.5vw, 3rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--gold);
}

.countdown__label {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-muted);
}

.countdown__message {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  color: var(--gold);
}

.countdown__message:empty {
  display: none;
}

.countdown__intro {
  margin-bottom: 1.6rem;
  font-size: 0.95rem;
  text-align: center;
  color: var(--cream-muted);
}

.countdown__intro-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Month calendar with both celebration dates circled */
.month {
  max-width: 400px;
  margin: 0 auto clamp(2.75rem, 8vw, 3.5rem);
  padding: 1.75rem 1.1rem 1.4rem;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: rgba(18, 56, 42, 0.94);
}

.month__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.month__caption {
  margin-bottom: 1.1rem;
  text-align: center;
}

.month__name {
  display: block;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
  color: var(--cream);
}

.month__year {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--gold);
}

.month__table th {
  padding: 0 0 0.55rem;
  border-bottom: 1px solid var(--gold-faint);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.month__table td {
  position: relative;
  height: 2.7rem;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-variant-numeric: lining-nums;
  color: var(--cream-muted);
}

.month__table tbody tr:first-child td {
  height: 3.2rem; /* breathing room under the day names */
  padding-top: 0.5rem;
}

.month__table td.month__marked {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold);
}

.month__date {
  position: relative;
  z-index: 1;
}

.month__circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(130%, 3.5rem);
  height: auto;
  translate: -50% -50%;
  overflow: visible;
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.4;
  stroke-linecap: round;
  pointer-events: none;
}

/* Turn the second loop so the two don't look stamped */
.month__marked + .month__marked .month__circle {
  rotate: 150deg;
}

/* Draw the circles in, one after the other, once the calendar is on screen */
.js .month .month__circle {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.1s var(--ease) 0.7s;
}

.js .month .month__marked + .month__marked .month__circle {
  transition-delay: 1.5s;
}

.js .month.is-visible .month__circle {
  stroke-dashoffset: 0;
}

.month__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.4rem;
  margin: 1.1rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--gold-faint);
  list-style: none;
  font-size: 0.8rem;
  color: var(--cream-muted);
}

.month__legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.month__legend-date {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: lining-nums;
  color: var(--gold);
}


/* --------------------------------------------------------------------------
   7. Programme tabs
   -------------------------------------------------------------------------- */
.tabs__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tabs__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.85rem 0.75rem;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease),
              border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.tabs__tab:hover {
  border-color: var(--gold);
  background-color: var(--gold-faint);
}

.tabs__tab[aria-selected="true"] {
  border-color: var(--gold);
  background-color: var(--gold);
  color: var(--emerald);
  box-shadow: 0 10px 24px rgba(217, 181, 74, 0.2);
}

.tabs__day {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
}

.tabs__date {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.tabs__panel {
  padding: 2rem 1.1rem 2.1rem;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  text-align: center;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* Fade out the old day, fade in the new one (see initTabs in script.js) */
.tabs__panel.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.tabs__panel.is-entering {
  animation: panel-in 0.45s var(--ease) both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.day__eyebrow {
  margin-bottom: 0.35rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.day__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 7vw, 2.4rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.15;
}

.day__date {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-muted);
}

/* Time — dot on a gold line — event */
.timeline {
  --time-col: 5.6rem;
  --gap: 1.6rem;
  position: relative;
  max-width: 420px;
  margin: 1.6rem auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 1.4rem;
  bottom: 1.4rem;
  left: calc(var(--time-col) + var(--gap) / 2);
  width: 1px;
  background: var(--gold-line);
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: var(--time-col) 1fr;
  column-gap: var(--gap);
  align-items: center;
  padding: 0.8rem 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--time-col) + var(--gap) / 2);
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  background: var(--bead, var(--gold));
  transform: translate(-50%, -50%);
}

/* Each stop on the line is a different bead colour */
.timeline li:nth-child(4n + 1) { --bead: var(--bead-red); }
.timeline li:nth-child(4n + 2) { --bead: var(--cream); }
.timeline li:nth-child(4n + 3) { --bead: var(--bead-black); }
.timeline li:nth-child(4n + 4) { --bead: var(--gold); }

.timeline time {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: lining-nums;
  color: var(--gold);
}

.timeline__event {
  font-size: 0.95rem;
  line-height: 1.45;
}


/* --------------------------------------------------------------------------
   8. Venue & calendar
   -------------------------------------------------------------------------- */

/* Arch-topped card, echoing the photo frame */
.venue__card {
  max-width: 540px;
  margin: 0 auto;
  padding: 3.25rem 1rem 2rem;
  border: 1px solid var(--gold-line);
  border-radius: 270px 270px var(--radius) var(--radius);
  background: linear-gradient(180deg, rgba(217, 181, 74, 0.08), rgba(255, 255, 255, 0.01) 60%);
  text-align: center;
}

.venue__icon {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 1.1rem;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  font-size: 1.4rem;
  color: var(--gold);
}

.venue__area {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.6rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
}

.venue__detail {
  margin-top: 0.4rem;
  font-size: 1rem;
}

.venue__country {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cream-muted);
}

.venue__coords {
  margin: 0.6rem 0 1.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--gold);
}

/* Embedded Google Map in a thin gold frame */
.venue__map {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  margin-bottom: 1.75rem;
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  background: var(--emerald-deep);
  box-shadow: var(--shadow);
}

.venue__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.calendar {
  margin-top: clamp(3rem, 9vw, 4rem);
  text-align: center;
}

.calendar__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2rem);
  font-style: italic;
  font-weight: 500;
}

.calendar__buttons {
  display: grid;
  gap: 0.85rem;
  max-width: 560px;
  margin: 1.4rem auto 0;
}

.calendar__btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 72px;
  padding: 1rem 1.25rem;
  border: 1px solid var(--gold-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--cream);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease),
              transform 0.3s var(--ease);
}

.calendar__btn:hover {
  border-color: var(--gold);
  background-color: var(--gold-faint);
}

.calendar__btn:active {
  transform: scale(0.99);
}

/* Both-days download: full width under the two day buttons, gold-edged */
.calendar__btn--all {
  grid-column: 1 / -1;
  border-color: var(--gold);
}

.calendar__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gold-faint);
  font-size: 1.3rem;
  color: var(--gold);
}

.calendar__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.calendar__day {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.2;
}

.calendar__action {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}


/* --------------------------------------------------------------------------
   9. RSVP form
   -------------------------------------------------------------------------- */
.rsvp {
  display: grid;
  gap: 1.5rem;
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: rgba(16, 60, 43, 0.88);
}

.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field__label {
  display: block;
  margin-bottom: 0.55rem;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.field__optional {
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: none;
  color: var(--cream-muted);
}

.field__input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  background: rgba(10, 44, 31, 0.6);
  font-size: 1rem; /* 16px stops iOS zooming into fields */
  color: var(--cream);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

textarea.field__input {
  min-height: 110px;
  resize: vertical;
}

.field__input::placeholder {
  color: rgba(246, 240, 223, 0.5);
}

.field__input:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 181, 74, 0.22);
}

.field__input[aria-invalid="true"],
.field[aria-invalid="true"] .choice {
  border-color: var(--error);
}

.field__hint {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--cream-muted);
}

.field__error {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--error);
}

.field__error:empty {
  display: none;
}

/* Guest-count stepper */
.stepper {
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  gap: 0.5rem;
}

.stepper__btn {
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--gold);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.stepper__btn:hover {
  border-color: var(--gold);
  background-color: var(--gold-faint);
}

.stepper__input {
  text-align: center;
  font-weight: 600;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

/* Day checkboxes */
.choices {
  display: grid;
  gap: 0.65rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.choice:hover,
.choice:has(input:checked) {
  border-color: var(--gold);
  background-color: var(--gold-faint);
}

.choice input {
  display: grid;
  place-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin: 0;
  border: 1.5px solid var(--gold);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.2s ease;
}

.choice input::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--emerald);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
  transform: scale(0);
  transition: transform 0.2s var(--ease);
}

.choice input:checked {
  background-color: var(--gold);
}

.choice input:checked::before {
  transform: scale(1);
}

.choice input:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

.choice__text {
  font-size: 0.92rem;
  line-height: 1.4;
}

.choice__text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 600;
  color: var(--gold);
}

.rsvp__status {
  font-size: 0.92rem;
  text-align: center;
  color: var(--gold-light);
}

.rsvp__status:empty {
  display: none;
}


/* --------------------------------------------------------------------------
   10. Footer
   -------------------------------------------------------------------------- */
.footer {
  position: relative;
  overflow: hidden;
  /* Extra bottom room so the floating music button never covers the credit */
  padding: calc(clamp(4.5rem, 14vw, 7rem) + var(--beads-height)) 0 calc(5.5rem + env(safe-area-inset-bottom));
  text-align: center;
  background-color: rgba(4, 22, 15, 0.5);
  border-top: 1px solid var(--gold-faint);
}

.footer__monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin-bottom: 1.6rem;
  border: 1px solid var(--gold);
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px var(--emerald-deep), inset 0 0 0 6px var(--gold-line);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-style: italic;
  font-weight: 600;
  color: var(--gold);
}

.footer__monogram span {
  margin: 0 0.05em;
  font-size: 0.8em;
}

.footer__zulu {
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
}

.footer__message {
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.12;
}

.footer__names {
  margin-top: 1.1rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.footer__credit {
  margin-top: 3.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--cream-muted);
}

/* Own line under the credit, centred, with a comfortable tap area */
.footer__site {
  display: table;
  margin: 0.2rem auto 0;
  padding: 0.3rem 0.5rem;
  text-decoration: none;
}

.footer__site:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* --------------------------------------------------------------------------
   11. Music toggle
   -------------------------------------------------------------------------- */
.music-toggle {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 50;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(10, 44, 31, 0.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--gold);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  -webkit-tap-highlight-color: transparent;
  /* Hidden until the invitation is opened (and only if music.mp3 exists) */
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), visibility 0s linear 0.5s;
}

.music-toggle.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

/* Slowly turning dashed ring while music plays */
.music-toggle::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px dashed var(--gold-line);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.music-toggle[aria-pressed="true"]::before {
  opacity: 1;
  animation: slow-spin 10s linear infinite;
}

.music-toggle__bars {
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}

.music-toggle__bars span {
  width: 3px;
  height: 30%;
  border-radius: 2px;
  background: currentColor;
  animation: equalise 1s ease-in-out infinite;
}

.music-toggle__bars span:nth-child(2) { animation-delay: 0.2s; }
.music-toggle__bars span:nth-child(3) { animation-delay: 0.4s; }
.music-toggle__bars span:nth-child(4) { animation-delay: 0.1s; }

.music-toggle[aria-pressed="true"] .music-toggle__note { display: none; }
.music-toggle[aria-pressed="true"] .music-toggle__bars { display: flex; }

@keyframes equalise {
  0%, 100% { height: 30%; }
  50%      { height: 100%; }
}


/* --------------------------------------------------------------------------
   12. Scroll reveal — elements fade/slide in as they enter the viewport
   -------------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}

.js .reveal--zoom {
  transform: scale(0.95);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}


/* --------------------------------------------------------------------------
   13. Larger screens
   -------------------------------------------------------------------------- */
@media (min-width: 560px) {
  .choices {
    grid-template-columns: 1fr 1fr;
  }

  .tabs__panel {
    padding: 2.5rem 2rem 2.75rem;
  }

  .rsvp {
    padding: 2.5rem 2.25rem;
  }

  .venue__card {
    padding: 3.5rem 2rem 2.5rem;
  }

  .timeline {
    --time-col: 6.5rem;
  }
}

@media (min-width: 760px) {
  .calendar__buttons {
    grid-template-columns: 1fr 1fr;
    max-width: 760px;
  }
}

@media (min-width: 900px) {
  .hero {
    padding: calc(6rem + var(--beads-height)) 0 7rem;
  }

  /* Photo on the left, words on the right */
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr auto 1fr;
    grid-template-areas:
      "photo intro"
      "photo names"
      "photo invite";
    column-gap: clamp(3rem, 6vw, 6rem);
    row-gap: 1.6rem;
    align-items: center;
  }

  .hero__intro  { align-self: end; }
  .hero__invite { align-self: start; }

  .hero__photo {
    width: min(100%, 420px);
    margin: 0;
    justify-self: end;
  }

  .rings {
    opacity: 0.12;
  }
}


/* --------------------------------------------------------------------------
   14. Reduced motion — keep everything visible, skip the movement
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
