/* ==========================================================================
   Umhlonyane kaZamaCofu Hlambisa · Digital Invitation
   style.css · tokens at the top, then sections in page order
   ========================================================================== */

:root {
  /* Palette: night earth, cream paper, ochre gold, red clay, indigo bead */
  --ink: #17110d;
  --ink-2: #221912;
  --ink-3: #2e2219;
  --paper: #fbf6ee;
  --cream: #f6efe3;
  --sand: #f1e6d4;
  --sand-deep: #e2cfae;
  --gold: #c9a04a;
  --gold-soft: #e3c98a;
  --clay: #9a3f2b;
  --clay-deep: #5f2318;
  --indigo: #2b3a5c;

  --text: #2a1f18;
  --muted: #6b5a4c;
  --line: rgba(42, 31, 24, 0.14);
  --on-dark: #f6efe3;
  --on-dark-muted: rgba(246, 239, 227, 0.72);
  --error: #b3261e;

  /* Type: Fraunces (modern editorial serif) for display, Jost for labels */
  --f-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --f-serif: "Cormorant Garamond", Georgia, serif;
  --f-sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-hand: "Caveat", "Cormorant Garamond", cursive;

  /* Shape & motion */
  --radius: 20px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gutter: 20px;

  /* Faint diamond lattice used on dark sections */
  --weave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M22 2 42 22 22 42 2 22Z' fill='none' stroke='%23C9A04A' stroke-opacity='.07'/%3E%3Ccircle cx='22' cy='22' r='1.3' fill='%23C9A04A' fill-opacity='.16'/%3E%3C/svg%3E");

  /* Fine film grain laid over the dark sections for a printed, tactile feel */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .85 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* Bead divider under section headings: thread, then red · gold · blue · gold · red beads */
  --bead-divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='12' viewBox='0 0 150 12'%3E%3Cpath d='M0 6h46M104 6h46' stroke='%23C9A04A' stroke-opacity='.6'/%3E%3Ccircle cx='55' cy='6' r='3.6' fill='%23A8452E'/%3E%3Ccircle cx='65' cy='6' r='3.6' fill='%23C9A04A'/%3E%3Cpath d='M75 .8 80.2 6 75 11.2 69.8 6Z' fill='%23324B86'/%3E%3Ccircle cx='85' cy='6' r='3.6' fill='%23C9A04A'/%3E%3Ccircle cx='95' cy='6' r='3.6' fill='%23A8452E'/%3E%3C/svg%3E");

  /* One strand of beads (repeats downwards): white · red · white · blue · gold on a thread */
  --bead-strand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='45' viewBox='0 0 10 45'%3E%3Cpath d='M5 0v45' stroke='%23C9A04A' stroke-opacity='.45' stroke-width='.8'/%3E%3Ccircle cx='5' cy='4.5' r='3.4' fill='%23F6EFE3'/%3E%3Ccircle cx='5' cy='13.5' r='3.4' fill='%23B4472E'/%3E%3Ccircle cx='5' cy='22.5' r='3.4' fill='%23F6EFE3'/%3E%3Ccircle cx='5' cy='31.5' r='3.4' fill='%23324B86'/%3E%3Ccircle cx='5' cy='40.5' r='3.4' fill='%23D9AE55'/%3E%3C/svg%3E");
}

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

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

body {
  margin: 0;
  font-family: var(--f-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

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

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

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

.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

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

/* Beadwork band */
.band {
  height: 22px;
  background: url("../images/beadwork.svg") repeat-x center / auto 22px;
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: clamp(64px, 12vw, 112px) var(--gutter);
}

.paper {
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(201, 160, 74, 0.08), transparent 70%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(154, 63, 43, 0.06), transparent 70%),
    var(--paper);
}

.sand {
  background: var(--sand);
}

.dark {
  background:
    var(--grain),
    radial-gradient(ellipse 70% 55% at 50% 50%, rgba(201, 160, 74, 0.1), transparent 70%),
    var(--weave),
    var(--ink);
  color: var(--on-dark);
}

.clay {
  background:
    var(--grain),
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201, 160, 74, 0.18), transparent 70%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(23, 17, 13, 0.35), transparent 70%),
    var(--weave),
    var(--clay-deep);
  color: var(--on-dark);
}

/* Beaded triangle edge (like amacansi / beadwork triangles) where a section meets
   its neighbour: the section overlaps the neighbour by one triangle height and a
   mask cuts the triangles, so the neighbour's colour shows between them. */
.edge-top,
.edge-bottom {
  --tri: 16px;
  --tri-w: 34px;
  z-index: 1;
  -webkit-mask:
    var(--m-top, linear-gradient(#0000 0 0)),
    var(--m-bottom, linear-gradient(#0000 0 0)),
    linear-gradient(#000 0 0) 0 var(--pt, 0px) / 100% calc(100% - var(--pt, 0px) - var(--pb, 0px)) no-repeat;
  mask:
    var(--m-top, linear-gradient(#0000 0 0)),
    var(--m-bottom, linear-gradient(#0000 0 0)),
    linear-gradient(#000 0 0) 0 var(--pt, 0px) / 100% calc(100% - var(--pt, 0px) - var(--pb, 0px)) no-repeat;
}

.edge-top {
  --pt: var(--tri);
  --m-top: conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) 50% 0 / var(--tri-w) var(--tri) repeat-x;
  margin-top: calc(var(--tri) * -1);
  padding-top: calc(clamp(64px, 12vw, 112px) + var(--tri));
}

.edge-bottom {
  --pb: var(--tri);
  --m-bottom: conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 50% 100% / var(--tri-w) var(--tri) repeat-x;
  margin-bottom: calc(var(--tri) * -1);
  padding-bottom: calc(clamp(64px, 12vw, 112px) + var(--tri));
}

/* A row of small gold beads running just inside each triangle edge */
.edge-top::before,
.edge-bottom::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  background: radial-gradient(circle, var(--gold) 0 2px, transparent 2.6px) 50% 50% / calc(var(--tri-w) / 2) 6px repeat-x;
  opacity: 0.55;
  pointer-events: none;
}

.edge-top::before {
  top: calc(var(--tri) + 10px);
}

.edge-bottom::after {
  bottom: calc(var(--tri) + 10px);
}

.section-head {
  text-align: center;
  margin-bottom: clamp(36px, 7vw, 56px);
}

.section-head h2 {
  margin-top: 12px;
  font-family: var(--f-display);
  font-size: clamp(2.1rem, 8vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

/* Even line lengths, so no heading ends with one word on its own */
.section-head h2,
.invite-heading,
.tribute-heading,
.zulu-line {
  text-wrap: balance;
}

/* One word of each heading in a soft italic accent */
.section-head h2 em,
.invite-heading em,
.tribute-heading em {
  font-style: italic;
  font-weight: 300;
  color: var(--clay);
}

.dark .section-head h2 em,
.clay .section-head h2 em,
.tribute-heading em {
  color: var(--gold-soft);
}

/* Row of beads under every section heading */
.section-head::after {
  content: "";
  display: block;
  width: 150px;
  height: 12px;
  margin: 22px auto 0;
  background: var(--bead-divider) center / contain no-repeat;
}

.section-lead {
  margin-top: 14px;
  font-family: var(--f-serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--on-dark-muted);
}

.section-lead strong {
  font-style: normal;
  font-weight: 600;
  color: var(--gold-soft);
}

/* Scroll reveal: only hidden when JS can reveal it again */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.9s var(--ease) var(--d, 0ms),
    transform 0.9s var(--ease) var(--d, 0ms);
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 24px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--f-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.25s var(--ease),
    background-color 0.25s,
    color 0.25s,
    box-shadow 0.25s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -12px rgba(23, 17, 13, 0.6);
}

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

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

.btn-ghost:hover {
  background: var(--ink);
  color: var(--cream);
}

.btn-clay {
  border-color: var(--clay);
  background: var(--clay);
  color: var(--cream);
}

.btn-clay:hover {
  background: var(--clay-deep);
  border-color: var(--clay-deep);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   1. ENVELOPE
   ========================================================================== */
.envelope-screen {
  display: none;
}

.js .envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px var(--gutter);
  overflow: hidden;
  background:
    var(--grain),
    radial-gradient(ellipse 60% 45% at 50% 45%, rgba(201, 160, 74, 0.2), transparent 70%),
    var(--weave),
    var(--ink);
  color: var(--on-dark);
  text-align: center;
  transition:
    opacity 1s var(--ease),
    visibility 1s;
}

.envelope-screen.is-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.env-stage {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
}

.envelope-screen .strands {
  top: 0;
}

.envelope-screen.is-opening .strands {
  opacity: 0;
  transition: opacity 0.6s;
}

.env-kicker {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  transition: opacity 0.5s;
}

/* "Isimemo Somhlonyane" on the first line, "kaZamaCofu" on the second */
.env-kicker .hl {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-soft);
}

.envelope {
  position: relative;
  width: 100%;
  aspect-ratio: 1.45;
  margin: clamp(56px, 12vh, 96px) auto 30px;
  perspective: 1400px;
  cursor: pointer;
  animation: env-float 5s ease-in-out infinite;
}

.env-back {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(160deg, #d9c39d, #cdb48a);
  box-shadow: 0 34px 60px -24px rgba(0, 0, 0, 0.8);
}

/* Card inside the envelope */
.env-letter {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 6%;
  height: 88%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7% 8% 0;
  border-radius: 4px;
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box,
    linear-gradient(135deg, var(--gold-soft), var(--gold)) border-box;
  border: 1.5px solid transparent;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: transform 1.1s var(--ease) 0.6s;
}

.env-letter::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(201, 160, 74, 0.45);
  border-radius: 2px;
  pointer-events: none;
}

.env-letter-eyebrow {
  font-size: clamp(0.5rem, 1.7vw, 0.62rem);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--clay);
}

.env-letter-pre {
  margin-top: 4%;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(0.8rem, 2.6vw, 0.98rem);
  color: var(--muted);
}

.env-letter-name {
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.env-letter-medallion {
  width: 15%;
  margin-top: 3%;
  color: var(--gold);
}

.env-letter-medallion svg {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.env-pocket {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.12));
}

.env-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9%;
  z-index: 3;
  height: 16px;
  background: url("../images/beadwork.svg") repeat-x center / auto 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.flap-shadow {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 58%;
  z-index: 3;
  filter: blur(4px);
  opacity: 0.35;
  transition: opacity 0.4s;
}

.flap-shadow i {
  position: absolute;
  inset: 0;
  transform: translateY(4px);
  background: #000;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.env-flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 58%;
  z-index: 4;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition:
    transform 0.9s cubic-bezier(0.6, 0.05, 0.3, 1),
    z-index 0s 0.45s;
}

.flap-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flap-front {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, #e9d8b9, #dcc6a1);
  border-radius: 6px 6px 0 0;
}

/* Inside of the flap: a beadwork liner */
.flap-back {
  transform: rotateX(180deg);
  clip-path: polygon(0 100%, 100% 100%, 50% 0);
  background:
    linear-gradient(rgba(23, 17, 13, 0.15), rgba(23, 17, 13, 0.15)),
    url("../images/beadwork.svg") repeat center / auto 18px;
}

/* Wax seal */
.env-seal {
  position: absolute;
  left: 50%;
  top: 58%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: clamp(66px, 19vw, 82px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 34% 28%, #c0583f, #8f3524 52%, #5c1f15);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.28),
    inset 0 -4px 8px rgba(0, 0, 0, 0.35),
    0 8px 16px rgba(0, 0, 0, 0.45);
  color: var(--gold-soft);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition:
    transform 0.45s var(--ease),
    opacity 0.45s;
}

.env-seal svg {
  position: absolute;
  inset: 6%;
  width: 88%;
  height: 88%;
  opacity: 0.85;
}

.env-seal span {
  position: relative;
  font-family: var(--f-display);
  font-size: clamp(1rem, 4.4vw, 1.3rem);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

/* Gentle pulse inviting the tap */
.env-seal::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1.5px solid var(--gold-soft);
  border-radius: 50%;
  opacity: 0;
  animation: seal-pulse 2.4s ease-out infinite;
}

.env-seal:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.env-to {
  font-family: var(--f-serif);
  font-size: 1.12rem;
  font-style: italic;
  color: var(--on-dark-muted);
  transition: opacity 0.5s;
}

.env-to strong {
  display: block;
  margin-top: 2px;
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--cream);
}

.env-hint {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 22px;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  transition: opacity 0.5s;
  animation: hint-breathe 2.4s ease-in-out infinite;
}

/* Opening sequence */
.envelope.is-open {
  animation: none;
  cursor: default;
}

.envelope.is-open .env-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4) rotate(-20deg);
  pointer-events: none;
}

.envelope.is-open .env-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

.envelope.is-open .flap-shadow {
  opacity: 0;
}

.envelope.is-open .env-letter {
  transform: translateY(-56%);
}

.envelope-screen.is-opening .env-kicker,
.envelope-screen.is-opening .env-hint,
.envelope-screen.is-opening .env-to {
  opacity: 0;
  animation: none;
}

@keyframes env-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes seal-pulse {
  0% {
    opacity: 0.7;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}

@keyframes hint-breathe {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* ==========================================================================
   Music button: play / pause, beside the candle in the footer
   ========================================================================== */
.music-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid rgba(201, 160, 74, 0.55);
  border-radius: 50%;
  background: rgba(23, 17, 13, 0.85);
  color: var(--gold-soft);
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.6);
}

/* Shows ▶ while paused and ⏸ while playing */
.music-btn .icon {
  width: 22px;
  height: 22px;
}

.music-btn .icon-pause {
  display: none;
}

.music-btn[aria-pressed="true"] .icon-pause {
  display: block;
}

.music-btn[aria-pressed="true"] .icon-play {
  display: none;
}

/* Soft gold ring pulses while the song is playing */
.music-btn::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1.5px solid var(--gold-soft);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.music-btn[aria-pressed="true"]::after {
  animation: seal-pulse 2.4s ease-out infinite;
}

/* ==========================================================================
   2. HERO
   ========================================================================== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background:
    var(--grain),
    radial-gradient(ellipse 70% 45% at 50% 34%, rgba(201, 160, 74, 0.22), transparent 70%),
    radial-gradient(ellipse 90% 50% at 50% 110%, rgba(154, 63, 43, 0.32), transparent 70%),
    var(--weave),
    var(--ink);
  color: var(--on-dark);
  text-align: center;
}

/* Hanging bead strands at the sides of the hero, swaying gently */
.strands {
  position: absolute;
  top: 22px; /* hang from just under the beadwork band */
  z-index: 0;
  display: flex;
  gap: 9px;
  pointer-events: none;
}

.strands-left {
  left: clamp(8px, 3vw, 48px);
}

.strands-right {
  right: clamp(8px, 3vw, 48px);
  flex-direction: row-reverse;
}

.strands i {
  position: relative;
  display: block;
  width: 10px;
  height: var(--h, 160px);
  background: var(--bead-strand) center top / 10px 45px repeat-y;
  transform-origin: 50% 0;
  animation: strand-sway var(--t, 6s) ease-in-out var(--delay, 0s) infinite alternate;
  opacity: 0.9;
}

/* A small beaded drop at the end of each strand */
.strands i::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 9px;
  height: 12px;
  margin-left: -4.5px;
  background: var(--gold);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

@keyframes strand-sway {
  from {
    transform: rotate(-1.6deg);
  }
  to {
    transform: rotate(1.6deg);
  }
}

/* Ihawu (shield) and ukhamba (clay pot) standing on the bottom beadwork band, either
   side of the scroll cue. --still-h is the shield's height; the pot scales with it.
   On phones it stays shorter than the gap under the date line, so nothing touches the text. */
.hero-still {
  --still-h: clamp(92px, 26vw, 250px);
  position: absolute;
  bottom: 22px;
  z-index: 0;
  display: flex;
  align-items: flex-end;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.hero-still-left {
  left: clamp(8px, 3vw, 48px);
}

.hero-still-right {
  right: clamp(8px, 3vw, 48px);
  flex-direction: row-reverse;
}

.still-ihawu {
  width: calc(var(--still-h) / 2);
  height: var(--still-h);
  transform-origin: 50% 100%;
  transform: rotate(-6deg);
}

.hero-still-right .still-ihawu {
  transform: rotate(6deg) scaleX(-1);
}

/* The pot stands in front of the shield, overlapping it slightly */
.still-ukhamba {
  position: relative;
  width: calc(var(--still-h) * 0.62);
  height: calc(var(--still-h) * 0.62);
  margin-left: calc(var(--still-h) * -0.14);
}

.hero-still-right .still-ukhamba {
  margin-left: 0;
  margin-right: calc(var(--still-h) * -0.14);
}

.hero-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px var(--gutter) 40px;
}

/* Hero items rise in once the envelope opens */
.js .hero-rise {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 1.1s var(--ease) var(--d, 0ms),
    transform 1.1s var(--ease) var(--d, 0ms);
}

.js .hero.is-awake .hero-rise {
  opacity: 1;
  transform: none;
}

.hero-pre {
  margin-top: 18px;
  font-family: var(--f-serif);
  font-size: clamp(1.15rem, 4.4vw, 1.4rem);
  font-style: italic;
  color: var(--on-dark-muted);
}

.portrait {
  position: relative;
  width: min(66vw, 290px);
  aspect-ratio: 1;
  margin: 22px auto 26px;
}

.portrait-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--gold);
  animation: spin 140s linear infinite;
}

.portrait-photo {
  position: absolute;
  inset: 17.5%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, #7a3322, var(--ink-2) 72%);
  box-shadow:
    0 0 0 5px var(--ink),
    0 0 0 6px rgba(201, 160, 74, 0.55),
    0 0 70px rgba(201, 160, 74, 0.28);
}

.portrait-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-fallback {
  font-family: var(--f-display);
  font-size: clamp(3.4rem, 15vw, 4.8rem);
  line-height: 1;
  color: var(--gold-soft);
  text-shadow: 0 0 28px rgba(201, 160, 74, 0.45);
}

.hero-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  outline: none;
}

.hero-first {
  font-family: var(--f-display);
  font-size: clamp(3.3rem, 15.5vw, 6rem);
  font-weight: 350;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--cream);
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}

.hero-last {
  margin-top: 4px;
  font-family: var(--f-serif);
  font-size: clamp(1.5rem, 6.6vw, 2.2rem);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
}

.hero-ceremony {
  margin-top: 24px;
  padding: 8px 20px;
  border: 1px solid rgba(201, 160, 74, 0.55);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.hero-quote {
  max-width: 30ch;
  margin: 22px 0 0;
  font-family: var(--f-serif);
  font-size: clamp(1.2rem, 4.6vw, 1.45rem);
  font-style: italic;
  line-height: 1.45;
  color: var(--cream);
}

.hero-date {
  margin-top: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.scroll-cue {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: 30px;
  border: 1px solid rgba(246, 239, 227, 0.25);
  border-radius: 50%;
  color: var(--cream);
}

.hero.is-awake .scroll-cue .icon {
  animation: cue-bob 2.2s ease-in-out infinite;
}

@keyframes cue-bob {
  50% {
    transform: translateY(4px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Floating gold motes, like sparkles at a celebration */
.motes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.motes span {
  position: absolute;
  bottom: -10px;
  width: var(--s, 4px);
  height: var(--s, 4px);
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 10px 2px rgba(227, 201, 138, 0.5);
  opacity: 0;
  animation: mote-rise var(--t, 14s) linear var(--delay, 0s) infinite;
}

@keyframes mote-rise {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  12% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: translate(var(--x, 20px), -105vh);
  }
}

/* ==========================================================================
   3. INVITATION
   ========================================================================== */
/* Arch-topped card, like the doorway of an iqhugwane (beehive hut) */
.frame {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(56px, 15vw, 88px) clamp(24px, 7vw, 60px) clamp(44px, 9vw, 64px);
  border: 1px solid rgba(201, 160, 74, 0.7);
  border-radius: 50% 50% 3px 3px / 200px 200px 3px 3px;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(201, 160, 74, 0.12), transparent 70%),
    linear-gradient(180deg, #fffdf8, rgba(255, 253, 248, 0.7));
  box-shadow: 0 40px 70px -46px rgba(23, 17, 13, 0.45);
  text-align: center;
}

.frame::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(201, 160, 74, 0.32);
  border-radius: 50% 50% 2px 2px / 191px 191px 2px 2px;
  pointer-events: none;
}

/* Small beadwork triangles in each corner */
.frame-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--clay) 0 50%, transparent 50%);
}

.frame-corner::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--gold) 0 50%, transparent 50%);
}

.frame-corner.tl {
  left: -1px;
  top: -1px;
}

.frame-corner.tr {
  right: -1px;
  top: -1px;
  transform: scaleX(-1);
}

.frame-corner.bl {
  left: -1px;
  bottom: -1px;
  transform: scaleY(-1);
}

.frame-corner.br {
  right: -1px;
  bottom: -1px;
  transform: scale(-1);
}

.medallion {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  color: var(--clay);
}

.zulu-line {
  font-family: var(--f-serif);
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.35;
  color: var(--clay);
}

.invite-heading {
  margin-top: 18px;
  font-family: var(--f-display);
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.invite-body {
  max-width: 48ch;
  margin: 20px auto 0;
  font-size: 1.04rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--muted);
}

.invite-sign {
  margin-top: 26px;
  font-family: var(--f-hand);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--clay);
}

/* ==========================================================================
   4. WHEN & WHERE
   ========================================================================== */
.sand .eyebrow {
  color: var(--clay);
}

.sand .section-head h2 {
  color: var(--ink);
}

.detail-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 24px 50px -30px rgba(23, 17, 13, 0.45);
}

.detail-card::before {
  content: "";
  display: block;
  height: 14px;
  background: url("../images/beadwork.svg") repeat-x center / auto 14px;
}

.detail {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 24px 24px;
}

.detail + .detail {
  border-top: 1px dashed rgba(201, 160, 74, 0.55);
}

.detail-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  background: var(--clay);
  color: var(--cream);
  box-shadow: 0 0 0 4px rgba(154, 63, 43, 0.12);
}

.detail h3 {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--clay);
}

.detail-main {
  margin-top: 4px;
  font-family: var(--f-display);
  font-size: 1.4rem;
  line-height: 1.25;
  color: var(--ink);
}

.detail-sub {
  margin-top: 2px;
  font-size: 0.95rem;
  color: var(--muted);
}

.is-pending {
  color: var(--muted) !important;
  font-style: italic;
}

/* Live map of the venue pin */
.map-card {
  margin: 20px 0 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 24px 50px -30px rgba(23, 17, 13, 0.45);
}

.map-card::before {
  content: "";
  display: block;
  height: 14px;
  background: url("../images/beadwork.svg") repeat-x center / auto 14px;
}

.map-card iframe {
  display: block;
  width: 100%;
  height: clamp(240px, 62vw, 340px);
  border: 0;
  background: var(--sand-deep);
}

.map-card figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 0.92rem;
  color: var(--muted);
}

.map-card figcaption .icon {
  color: var(--clay);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

/* ==========================================================================
   5. COUNTDOWN: isihlangu (shield) tiles
   ========================================================================== */
.countdown .section-head h2 {
  font-size: clamp(1.6rem, 5.6vw, 2.3rem);
}

/* Two crossed amahawu (shields) above the heading */
.crest {
  position: relative;
  width: 180px;
  height: 150px;
  margin: 0 auto 20px;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55));
}

/* Wide angle so both shields read as a clear X; the back one is a little darker */
.crest img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78px;
  height: 156px;
  margin: -78px 0 0 -39px;
  transform: rotate(-42deg);
  filter: brightness(0.78);
}

.crest img + img {
  transform: rotate(42deg) scaleX(-1);
  filter: none;
}

.shields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 3vw, 26px);
  max-width: 580px;
  margin: 0 auto;
}

.shield {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* A perfect circle with a soft glow, framed by a ring of beads */
.shield-num {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 124px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, rgba(227, 201, 138, 0.16), rgba(227, 201, 138, 0) 62%),
    rgba(246, 239, 227, 0.03);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.35),
    0 10px 24px -14px rgba(0, 0, 0, 0.8);
  font-family: var(--f-display);
  font-size: clamp(1.45rem, 6.6vw, 2.3rem);
  font-weight: 400;
  line-height: 1;
  color: var(--cream);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Bead ring: thin gold outer line, 48 evenly spaced gold beads (4 red and 4 blue accents), thin inner line.
   It turns very slowly; the number itself stays still. */
.shield-num::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='49.2' fill='none' stroke='%23C9A04A' stroke-opacity='.8' stroke-width='.9'/%3E%3Ccircle cx='50' cy='50' r='43.5' pathLength='48' fill='none' stroke='%23E3C98A' stroke-opacity='.85' stroke-width='3.4' stroke-linecap='round' stroke-dasharray='0 1'/%3E%3Ccircle cx='50' cy='50' r='43.5' pathLength='4' fill='none' stroke='%23B4472E' stroke-width='3.9' stroke-linecap='round' stroke-dasharray='0 1'/%3E%3Ccircle cx='50' cy='50' r='43.5' pathLength='4' fill='none' stroke='%234F6FB8' stroke-width='3.9' stroke-linecap='round' stroke-dasharray='0 1' stroke-dashoffset='.5'/%3E%3Ccircle cx='50' cy='50' r='37.8' fill='none' stroke='%23C9A04A' stroke-opacity='.4' stroke-width='.7'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  animation: spin 120s linear infinite;
  pointer-events: none;
}

.shield-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 16px;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  line-height: 1.5;
}

.shield-label span {
  font-family: var(--f-serif);
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--gold-soft);
}

.countdown-note {
  font-family: var(--f-serif);
  font-size: 1.3rem;
  font-style: italic;
  text-align: center;
  color: var(--gold-soft);
}

.shields[hidden] + .countdown-note {
  margin-top: 0;
}

/* ==========================================================================
   6. GOOD TO KNOW + PROGRAMME
   ========================================================================== */
.paper .eyebrow {
  color: var(--clay);
}

.paper .section-head h2 {
  color: var(--ink);
}

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

.note {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
}

.note-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  color: var(--cream);
}

/* Diamond badge, like a bead */
.note-icon::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 6px;
  background: var(--ink);
  transform: rotate(45deg);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px rgba(201, 160, 74, 0.7);
}

.note-icon .icon {
  position: relative;
  width: 1.1em;
  height: 1.1em;
  color: var(--gold-soft);
}

.note strong {
  display: block;
  font-family: var(--f-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--ink);
}

.note p {
  margin-top: 2px;
  font-size: 0.97rem;
  color: var(--muted);
}

.programme {
  margin-top: clamp(40px, 8vw, 56px);
  text-align: center;
}

/* Ukhamba (clay pot) above the programme heading */
.programme-ukhamba {
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  filter: drop-shadow(0 10px 10px rgba(23, 17, 13, 0.28));
}

.programme h3 {
  font-family: var(--f-display);
  font-size: 1.5rem;
  color: var(--ink);
}

.programme h3 span {
  color: var(--clay);
}

.programme-list {
  position: relative;
  max-width: 420px;
  margin: 24px auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.programme-list::before {
  content: "";
  position: absolute;
  left: 76px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: rgba(201, 160, 74, 0.6);
}

.programme-list li {
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 30px;
  padding: 10px 0;
}

.programme-list li::before {
  content: "";
  position: absolute;
  left: 72px;
  top: 18px;
  width: 9px;
  height: 9px;
  background: var(--clay);
  transform: rotate(45deg);
}

.programme-list time {
  font-weight: 500;
  color: var(--clay);
  font-variant-numeric: tabular-nums;
}

.programme-list strong {
  display: block;
  font-weight: 500;
  color: var(--ink);
}

.programme-list span {
  font-size: 0.92rem;
  color: var(--muted);
}

.programme-pending {
  margin-top: 12px;
  font-family: var(--f-serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--muted);
}

/* ==========================================================================
   7. RSVP
   ========================================================================== */
.rsvp .section-head h2 {
  color: var(--cream);
}

.rsvp-card {
  padding: clamp(24px, 6vw, 40px);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}

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

.field label,
.field legend,
.field .label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

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

.field input[type="text"],
.field input[type="tel"],
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(42, 31, 24, 0.22);
  border-radius: 12px;
  background: #fffdf9;
  font-size: 1rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.field textarea {
  resize: vertical;
  min-height: 112px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(107, 90, 76, 0.65);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 160, 74, 0.22);
}

.field.has-error input,
.field.has-error .choice-box {
  border-color: var(--error);
}

.field-error {
  margin-top: 6px;
  font-size: 0.86rem;
  color: var(--error);
}

.field-error:empty {
  display: none;
}

.field-hint {
  margin-top: 6px;
  font-size: 0.86rem;
  color: var(--muted);
}

/* Yes / No choice cards */
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice {
  position: relative;
  display: block;
  margin: 0 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  height: 100%;
  padding: 16px;
  border: 1px solid rgba(42, 31, 24, 0.22);
  border-radius: 14px;
  background: #fffdf9;
  transition:
    border-color 0.2s,
    background-color 0.2s,
    box-shadow 0.2s;
}

.choice-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  border: 1px solid rgba(42, 31, 24, 0.25);
  border-radius: 50%;
  color: transparent;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.choice-mark .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.choice-zu {
  font-family: var(--f-serif);
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.choice-en {
  font-size: 0.88rem;
  color: var(--muted);
}

.choice input:checked + .choice-box {
  border-color: var(--clay);
  background: rgba(154, 63, 43, 0.06);
  box-shadow: 0 0 0 3px rgba(154, 63, 43, 0.12);
}

.choice input:checked + .choice-box .choice-mark {
  border-color: var(--clay);
  background: var(--clay);
  color: var(--cream);
}

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

/* Guest stepper */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(42, 31, 24, 0.22);
  border-radius: 999px;
  background: #fffdf9;
}

.stepper-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--cream);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s;
}

.stepper-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.stepper-value {
  min-width: 48px;
  font-family: var(--f-display);
  font-size: 1.5rem;
  text-align: center;
}

.form-status {
  margin-top: 14px;
  font-size: 0.92rem;
  text-align: center;
  color: var(--muted);
}

.form-status:empty {
  display: none;
}

.rsvp-done {
  text-align: center;
}

.rsvp-done h3 {
  font-family: var(--f-display);
  font-size: 2rem;
  color: var(--ink);
}

.rsvp-done p {
  max-width: 40ch;
  margin: 10px auto 22px;
  color: var(--muted);
}

.rsvp-done:focus {
  outline: none;
}

/* Under the send button: who the WhatsApp RSVP goes to */
.rsvp-send-to {
  margin-top: 12px;
  font-size: 0.86rem;
  text-align: center;
  color: var(--muted);
}

/* RSVP contacts under the form, tap a number to call */
.rsvp-contact {
  max-width: 420px;
  margin: 30px auto 0;
  text-align: center;
  color: var(--on-dark-muted);
}

.rsvp-contact-title {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.rsvp-contact ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.rsvp-contact li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 18px;
  border: 1px solid rgba(227, 201, 138, 0.3);
  border-radius: 14px;
  background: rgba(23, 17, 13, 0.25);
  text-align: left;
}

.rsvp-contact-name {
  font-family: var(--f-display);
  font-size: 1.1rem;
  color: var(--cream);
}

.rsvp-contact a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--gold-soft);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.rsvp-contact a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   8. FOOTER: note from the family
   ========================================================================== */
.tribute {
  position: relative;
  padding: 0 var(--gutter) max(48px, env(safe-area-inset-bottom));
  background:
    var(--grain),
    radial-gradient(ellipse 60% 30% at 50% 12%, rgba(227, 201, 138, 0.22), transparent 70%),
    var(--weave),
    var(--ink);
  color: var(--on-dark);
  text-align: center;
}

.tribute .band {
  margin: 0 calc(var(--gutter) * -1);
}

.tribute .container {
  padding-top: clamp(64px, 12vw, 104px);
}

/* Candle */
.candle {
  position: relative;
  width: 60px;
  height: 150px;
  margin: 0 auto 30px;
}

/* Candle stays centred; the play / pause button sits to its right, level with the wax */
.candle-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  margin-bottom: 30px;
}

.candle-row .candle {
  grid-column: 2;
  margin: 0;
}

.candle-row .music-btn {
  grid-column: 3;
  justify-self: start;
  margin: 0 0 21px 22px;
}

.candle-wax {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 38px;
  height: 92px;
  transform: translateX(-50%);
  border-radius: 6px 6px 4px 4px;
  background: linear-gradient(90deg, #e8dcc5, #fffaf0 40%, #efe4cf 70%, #d9caa9);
  box-shadow: inset 0 -10px 16px rgba(154, 63, 43, 0.15);
}

/* A beaded ring around the candle */
.candle-wax::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: 18px;
  height: 10px;
  background: url("../images/beadwork.svg") repeat-x center / auto 10px;
  border-radius: 2px;
}

.candle-wick {
  position: absolute;
  left: 50%;
  bottom: 90px;
  width: 2px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 1px;
  background: #3a2a1e;
}

.candle-flame {
  position: absolute;
  left: 50%;
  bottom: 96px;
  width: 16px;
  height: 36px;
  margin-left: -8px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 80%, #fff 0 18%, #ffe7a3 32%, #f5b453 60%, rgba(214, 101, 42, 0.85) 82%, transparent 100%);
  transform-origin: 50% 90%;
  animation: flicker 2.6s ease-in-out infinite;
  filter: blur(0.3px);
}

.candle-glow {
  position: absolute;
  left: 50%;
  bottom: 70px;
  width: 150px;
  height: 150px;
  margin-left: -75px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 140, 0.4), rgba(255, 214, 140, 0) 65%);
  animation: glow 2.6s ease-in-out infinite;
}

@keyframes flicker {
  0%,
  100% {
    transform: rotate(-2deg) scaleY(1);
  }
  25% {
    transform: rotate(2deg) scaleY(1.06);
  }
  50% {
    transform: rotate(-1deg) scaleY(0.94);
  }
  75% {
    transform: rotate(1.5deg) scaleY(1.03);
  }
}

@keyframes glow {
  50% {
    opacity: 0.75;
    transform: scale(0.95);
  }
}

.tribute-heading {
  margin-top: 12px;
  font-family: var(--f-display);
  font-size: clamp(2rem, 7.4vw, 2.8rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--cream);
}

/* The letter */
.letter {
  position: relative;
  max-width: 560px;
  margin: 36px auto 0;
  padding: clamp(30px, 7vw, 48px) clamp(22px, 6vw, 44px) clamp(28px, 6vw, 40px);
  border-radius: 6px;
  background:
    linear-gradient(transparent 49.6%, rgba(201, 160, 74, 0.1) 50%, transparent 50.4%),
    var(--paper);
  color: var(--text);
  text-align: left;
  box-shadow: 0 40px 70px -36px rgba(0, 0, 0, 0.85);
  transform: rotate(-0.6deg);
}

.js .letter.reveal.is-in {
  transform: rotate(-0.6deg);
}

/* A little beaded tab "holding" the letter */
.letter::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -10px;
  width: 110px;
  height: 20px;
  transform: translateX(-50%) rotate(1.5deg);
  background: url("../images/beadwork.svg") repeat-x center / auto 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.letter-greet {
  font-family: var(--f-hand);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--clay);
}

.letter-body p {
  margin-top: 14px;
  font-family: var(--f-serif);
  font-size: 1.22rem;
  line-height: 1.65;
  color: var(--text);
}

.letter-zulu {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed rgba(201, 160, 74, 0.6);
  font-family: var(--f-serif);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.4;
  color: var(--clay-deep);
}

.letter-zulu-en {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

.letter-signoff {
  margin-top: 24px;
  font-size: 0.95rem;
  color: var(--muted);
}

.letter-signature {
  font-family: var(--f-hand);
  font-size: clamp(1.7rem, 7vw, 2.1rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

/* Inline so it stays beside the last word if the signature wraps */
.letter-heart {
  display: inline-block;
  margin-left: 8px;
  vertical-align: -0.05em;
  width: 26px;
  height: 26px;
  fill: var(--clay);
  stroke: var(--clay);
  animation: heartbeat 2.4s ease-in-out infinite;
}

@keyframes heartbeat {
  0%,
  60%,
  100% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.15);
  }
  40% {
    transform: scale(0.98);
  }
}

.letter-signature-en {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--clay);
}

/* Closing line in soft gold italic, with a light sheen */
.closing-line {
  margin-top: clamp(48px, 10vw, 72px);
  font-family: var(--f-display);
  font-size: clamp(2.2rem, 10vw, 3.6rem);
  font-style: italic;
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--gold-soft);
  background: linear-gradient(100deg, var(--gold) 0%, #f3dfae 45%, var(--gold) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-wrap: balance;
}

.credit {
  margin-top: 28px;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(246, 239, 227, 0.45);
}

/* ==========================================================================
   Wider screens
   ========================================================================== */
@media (min-width: 640px) {
  /* Date, Time, Venue, Theme as a 2 × 2 grid */
  .detail-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-card::before {
    grid-column: 1 / -1;
  }

  .detail {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 20px 34px;
  }

  .detail + .detail {
    border-top: 0;
  }

  .detail:nth-child(even) {
    border-left: 1px dashed rgba(201, 160, 74, 0.55);
  }

  .detail:nth-child(n + 3) {
    border-top: 1px dashed rgba(201, 160, 74, 0.55);
  }

  .notes {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .note {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  .motes {
    display: none;
  }
}
