/* ── Mfashigihe wedding — "Midnight Keepsake" theme ──────────────────────
   Dark espresso night backdrop · floating cream card · gold-foil type ·
   igiseke coil-render hero (see igiseke.js). Mobile-first (QR guests). */

:root {
  --night-a: #3a2517;
  --night-b: #241710;
  --night-c: #17100b;
  --card-a: #fffdf6;
  --card-b: #f8efdc;
  --ink: #2b2018;
  --muted: #8a7355;        /* warm grey on cream */
  --muted-dark: #cdb58f;   /* warm grey on night */
  --terra: #a23b22;
  --terra-deep: #7f2c18;
  --gold: #c8962f;
  --gold-deep: #a9781f;
  --gold-light: #e8c26a;
  --line: #e7d9bd;
  --foil: linear-gradient(100deg, #8a5a1c 0%, #e9c876 30%, #c8962f 52%, #f3ddab 68%, #a9781f 100%);
  --card-shadow: 0 24px 50px rgba(0, 0, 0, 0.5), 0 2px 0 rgba(255, 255, 255, 0.6) inset, 0 0 0 1px rgba(200, 150, 47, 0.35);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: #f3e9d6;
  background: radial-gradient(140% 100% at 50% -10%, var(--night-a) 0%, var(--night-b) 55%, var(--night-c) 100%) fixed var(--night-c);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--gold-light); }
a:hover { color: #f3ddab; }

.wrap {
  position: relative;
  z-index: 2;
  max-width: 430px;
  margin: 0 auto;
  /* Tight on phones so basket + card fit the first viewport; airy on larger screens. */
  padding: clamp(28px, 9vw, 52px) 22px 44px;
}

/* ── Floating decor shapes (behind content) ─────────────────── */
.floats { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.fl { position: absolute; animation: floaty var(--dur, 6s) ease-in-out var(--del, 0s) infinite alternate; }
.fl.diamond { transform: rotate(45deg); border-radius: 2px; }
.fl.circle { border-radius: 50%; }
@keyframes floaty { from { translate: 0 0; } to { translate: 0 -16px; } }

/* ── Type ───────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; margin: 0; }

.eyebrow {
  margin: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--gold-deep);
}
.eyebrow.on-dark { color: var(--gold); }

.display {
  font-family: var(--serif);
  font-weight: 600;
  /* Sized so "Pascaline & Nicolas" stays on ONE line down to ~320px wide. */
  font-size: clamp(1.9rem, 9vw, 2.6rem);
  line-height: 1.04;
  text-align: center;
  margin: 12px 0 0;
}
.foil {
  background: var(--foil);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--gold);
}

.kinya {
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--gold-deep);
  margin: 8px 0 0;
}
.kinya.on-dark { color: var(--gold-light); }
.kinya small {
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
  color: var(--muted);
}
.kinya.on-dark small { color: var(--muted-dark); }

.meta-date { margin: 0; font-family: var(--serif); font-size: 1.2rem; text-align: center; color: var(--ink); }
.meta-venue { margin: 2px 0 0; font-size: 0.75rem; letter-spacing: 0.08em; text-align: center; color: var(--muted); }

.hint { margin: 20px 0 0; font-size: 0.72rem; color: var(--muted); text-align: center; line-height: 1.5; }
.hint.on-dark { color: var(--muted-dark); }

.hashtag {
  margin: 26px 0 0;
  text-align: center;
  font-size: 0.69rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  min-height: 1em;
}

/* ── Igiseke scene ──────────────────────────────────────────── */
.scene { position: relative; display: flex; flex-direction: column; align-items: center; }
.glow {
  position: absolute; top: 0; left: 50%;
  width: 360px; height: 360px; margin-left: -180px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(232, 194, 106, 0.22), rgba(232, 194, 106, 0));
}
.halo {
  position: absolute; top: 30px; left: 50%;
  width: 290px; height: 290px; margin-left: -145px;
  border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(200, 150, 47, 0.3);
}
.basket-mount { position: relative; z-index: 3; }
.shadow-e {
  width: 190px; height: 18px; margin-top: -10px;
  border-radius: 50%; filter: blur(7px);
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}

/* Phones: shrink the scene so basket + full card share the first viewport.
   (index.html renders the basket smaller under the same breakpoint; the
   vertical-rhythm trims live at the END of this file so they win the cascade.) */
@media (max-width: 600px) {
  .glow { width: 290px; height: 290px; margin-left: -145px; }
  .halo { width: 232px; height: 232px; margin-left: -116px; top: 24px; }
  .shadow-e { width: 160px; }
}

/* ── The card ───────────────────────────────────────────────── */
.card {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: -34px;
  background: linear-gradient(180deg, var(--card-a), var(--card-b));
  border-radius: 26px;
  padding: clamp(40px, 11vw, 56px) 20px 28px;
  box-shadow: var(--card-shadow);
  color: var(--ink);
  transition: transform 0.18s ease;
  will-change: transform;
}
.card.compact { margin-top: 0; padding: 20px; }

/* ── Ornament divider ───────────────────────────────────────── */
.ornament { display: flex; align-items: center; gap: 12px; margin: 22px 0; }
.ornament::before, .ornament::after { content: ""; height: 1px; flex: 1; }
.ornament::before { background: linear-gradient(to right, transparent, var(--gold)); }
.ornament::after { background: linear-gradient(to left, transparent, var(--gold)); }
.ornament i { width: 8px; height: 8px; background: var(--terra); transform: rotate(45deg); display: inline-block; }
.ornament.gold i { background: var(--gold); }

/* ── Countdown ──────────────────────────────────────────────── */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 22px; }
.cell { text-align: center; padding: 4px 0; }
.cell + .cell { border-left: 1px solid var(--line); }
.cell .num {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--terra-deep);
}
.cell .lbl {
  display: block;
  margin-top: 6px;
  font-size: 0.5rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 18px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--gold), var(--gold-deep));
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(200, 150, 47, 0.35), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
  transition: filter 0.2s ease, transform 0.06s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.ghost {
  background: transparent;
  color: var(--gold-light);
  border: 1.5px solid rgba(200, 150, 47, 0.55);
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(200, 150, 47, 0.08); filter: none; }

/* ── Testing callout ────────────────────────────────────────── */
.testing { margin-top: 18px; text-align: center; }
.testing .btn { padding: 12px 18px; font-size: 0.9rem; }
.test-badge {
  display: inline-block;
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}

/* ── Upload (photos page) ───────────────────────────────────── */
.upload { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.helper { margin: 0; font-size: 0.72rem; color: var(--muted-dark); text-align: center; }

.status { margin-top: 12px; text-align: center; font-size: 0.85rem; color: var(--muted-dark); min-height: 1.2em; }
.status:empty { margin: 0; min-height: 0; } /* don't reserve space before an upload starts */
.bar {
  height: 6px; width: 100%;
  background: rgba(243, 233, 214, 0.14);
  border-radius: 999px; overflow: hidden;
  margin-top: 10px; display: none;
}
.bar.show { display: block; }
.bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width 0.2s ease; }

/* ── Photo wall ─────────────────────────────────────────────── */
.wall-title { text-align: center; font-size: 1.5rem; color: #f3e9d6; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(200, 150, 47, 0.3);
  padding: 0; margin: 0;
  background: #2f2015;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.tile:active img { transform: scale(0.97); }
.tile .pending {
  position: absolute; inset: auto 6px 6px auto;
  background: rgba(23, 16, 11, 0.85); color: var(--gold-light);
  border: 1px solid rgba(200, 150, 47, 0.4);
  font-size: 0.56rem; letter-spacing: 0.05em; padding: 3px 6px; border-radius: 6px;
}
.empty { text-align: center; color: var(--muted-dark); padding: 36px 10px; font-size: 0.9rem; }

/* ── Lightbox ───────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(15, 10, 7, 0.96);
  display: none; align-items: center; justify-content: center; flex-direction: column;
  padding: 16px; z-index: 50;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 78vh; border-radius: 10px; object-fit: contain; box-shadow: 0 0 0 1px rgba(200, 150, 47, 0.55); }
.lightbox .caption { color: #f6ecd9; text-align: center; margin-top: 14px; font-family: var(--serif); font-size: 1.25rem; }
.lightbox .who { color: var(--muted-dark); font-size: 0.85rem; }
.lightbox .close {
  position: absolute; top: 14px; right: 16px; color: #fff;
  background: rgba(255, 255, 255, 0.14); border: 0; width: 44px; height: 44px;
  border-radius: 50%; font-size: 1.4rem; cursor: pointer;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--card-a); color: var(--ink); padding: 12px 18px; border-radius: 999px;
  font-size: 0.9rem; opacity: 0; pointer-events: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  transition: opacity 0.2s ease, transform 0.2s ease; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Form fields (admin) ────────────────────────────────────── */
.field { margin-bottom: 12px; }
.field input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  font: inherit;
  color: var(--ink);
  background: #fffefa;
}
.field input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

.footer-note { margin-top: 36px; text-align: center; color: var(--muted-dark); font-size: 0.8rem; }

/* ── Seating-plan link on the landing card ──────────────────── */
.seat-cta { margin-top: 14px; text-align: center; }
.seat-cta .btn { padding: 11px 18px; font-size: 0.86rem; color: var(--gold-deep); border-color: rgba(200, 150, 47, 0.5); }

/* Phones: tighten vertical rhythm (decor + whitespace only, text untouched)
   so the whole card fits the first viewport. Must stay last in the file —
   these override same-specificity component rules above via source order. */
@media (max-width: 600px) {
  .wrap { padding-top: 28px; }
  .card { padding-bottom: 24px; }
  .ornament { margin: 18px 0; }
  .countdown { margin-top: 18px; }
  .hint { margin-top: 16px; }
  .testing { margin-top: 12px; }
  .hashtag { margin-top: 20px; }
  /* photos page */
  .upload { margin-top: 20px; }
  .empty { padding: 22px 10px; }
  .footer-note { margin-top: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .fl { animation: none; }
  .card { transition: none; }
}

[hidden] { display: none !important; }
