/* ==========================================================
   SLAP · Virtual try-on
   Self-contained styles (does not depend on style.css)
   ========================================================== */

:root {
  --burgundy: #6B1D35;
  --burgundy-dark: #4A1425;
  --cream: #F5EDE3;
  --cream-dark: #E8DDD0;
  --cream-light: #FBF6F0;
  --gold: #D6BEA1;
  --text: #2A2A2A;
  --muted: #8A8580;
  --ink: #140A0E;

  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body[data-view="stage"] { background: #000; overflow: hidden; }

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

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

/* ---------- Focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--burgundy);
  outline-offset: 3px;
  border-radius: 999px;
}
.view--stage :focus-visible,
.debug :focus-visible { outline-color: var(--cream); }

/* ---------- Views ---------- */
.view:not([hidden]) { animation: view-in 0.45s var(--ease) both; }
@keyframes view-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 32px;
  border: 1px solid var(--burgundy);
  border-radius: 999px;
  background: var(--burgundy);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, transform 0.4s var(--ease), box-shadow 0.3s;
  box-shadow: 0 10px 24px -12px rgba(74, 20, 37, 0.55);
}
.btn:hover { background: var(--burgundy-dark); border-color: var(--burgundy-dark); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.btn--outline {
  background: transparent;
  color: var(--burgundy);
  box-shadow: none;
}
.btn--outline:hover { background: rgba(107, 29, 53, 0.06); color: var(--burgundy-dark); }

.btn--small {
  min-height: 44px;
  padding: 0 22px;
  font-size: 0.6875rem;
  box-shadow: none;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--burgundy);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: rgba(107, 29, 53, 0.35);
  text-underline-offset: 5px;
  cursor: pointer;
  transition: text-decoration-color 0.3s, color 0.3s;
}
.btn-link:hover { color: var(--burgundy-dark); text-decoration-color: currentColor; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(245, 237, 227, 0.22);
  border-radius: 50%;
  background: rgba(20, 10, 14, 0.42);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s var(--ease), opacity 0.3s;
}
.icon-btn:hover { background: rgba(20, 10, 14, 0.6); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.icon-btn--light {
  border-color: rgba(107, 29, 53, 0.16);
  background: rgba(255, 255, 255, 0.45);
  color: var(--burgundy);
}
.icon-btn--light:hover { background: rgba(255, 255, 255, 0.75); }

/* ---------- Shared type ---------- */
.eyebrow {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--burgundy);
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 11vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--burgundy-dark);
}
.display em { font-style: italic; font-weight: 400; color: var(--burgundy); }

.lead {
  margin: 0;
  max-width: 30ch;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--muted);
}

/* ==========================================================
   Landing
   ========================================================== */
.view--landing {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding:
    calc(var(--safe-t) + 68px)
    calc(var(--safe-r) + 20px)
    calc(var(--safe-b) + 28px)
    calc(var(--safe-l) + 20px);
  background:
    radial-gradient(120% 70% at 50% 0%, var(--cream-light) 0%, rgba(251, 246, 240, 0) 60%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
}

.landing__close {
  position: absolute;
  top: calc(var(--safe-t) + 14px);
  right: calc(var(--safe-r) + 16px);
}

.landing__inner {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.landing__logo {
  display: block;
  width: 96px;
  height: 96px;
  margin-bottom: 6px;
  border-radius: 50%;
  outline: 1px solid var(--gold);
  outline-offset: 6px;
  box-shadow: 0 14px 34px -14px rgba(74, 20, 37, 0.65);
}

.landing__rule {
  display: block;
  width: 40px;
  height: 1px;
  margin: 14px 0 6px;
  background: var(--gold);
}

.landing__actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.landing__actions .btn { width: 100%; max-width: 320px; }

.fineprint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 6px 0 0;
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--muted);
}
.fineprint svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* In-app browser notice */
.inapp {
  width: 100%;
  max-width: 340px;
  margin-top: 8px;
  padding: 16px 18px;
  border: 1px solid var(--gold);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.inapp p { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--text); }

@media (max-height: 620px) {
  .landing__logo { width: 72px; height: 72px; }
  .landing__rule { margin: 8px 0 2px; }
}

/* ==========================================================
   Camera stage
   ========================================================== */
.view--stage {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  background: #000;
  color: var(--cream);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.stage__media { position: absolute; inset: 0; }
/* The whole camera picture, letterboxed like the Camera app's photo mode (bands are the stage's black). */
.stage__media video,
.stage__media canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 40%; /* a little high: header above, zoom + shutter over the lower edge */
}
.stage__media video,
.stage__media canvas { transition: opacity 0.3s var(--ease); }
.stage__media.is-settling video,
.stage__media.is-settling canvas { opacity: 0; } /* first frames can paint at the wrong size */
.stage__media.is-mirrored video,
.stage__media.is-mirrored canvas { transform: scaleX(-1); }
.stage__media canvas { pointer-events: none; }

.stage__top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-t) + 12px) calc(var(--safe-r) + 16px) 24px calc(var(--safe-l) + 16px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.38) 0%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}
.stage__top > * { pointer-events: auto; }

.stage__brand {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.status {
  position: absolute;
  left: 50%;
  top: calc(var(--safe-t) + 17px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 140px);
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(20, 10, 14, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--cream);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: opacity 0.35s, transform 0.45s var(--ease);
}
.status.is-hidden { opacity: 0; transform: translate(-50%, -6px); pointer-events: none; }
.status__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1); } }

.stage__bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  animation: rise 0.6s var(--ease) both;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Zoom buttons (0.5 / 1× / 2 / 5), built from what the camera reports */
.zoom {
  display: flex;
  gap: 4px;
  width: max-content;
  margin: 0 auto 14px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(20, 10, 14, 0.45);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.zoom__btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--cream);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.zoom__btn:active { transform: scale(0.92); }
.zoom__btn.is-active {
  background: rgba(245, 237, 227, 0.16);
  color: var(--gold);
  font-weight: 600;
}
.zoom__btn.is-active::after { content: "×"; }

.stage__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 calc(var(--safe-r) + 28px) 16px calc(var(--safe-l) + 28px);
}
.stage__row > :first-child { justify-self: start; }
.stage__row > :last-child { justify-self: end; }

.shutter {
  position: relative;
  width: 76px;
  height: 76px;
  padding: 0;
  border: 3px solid var(--cream);
  border-radius: 50%;
  background: rgba(245, 237, 227, 0.12);
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s var(--ease);
}
.shutter span {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--cream);
  transition: transform 0.25s var(--ease), background-color 0.3s;
}
.shutter:hover span { background: #fff; }
.shutter:active span { transform: scale(0.88); }
.shutter:focus-visible { outline-offset: 4px; }

/* Colour sheet */
.sheet {
  padding: 14px calc(var(--safe-r) + 16px) calc(var(--safe-b) + 14px) calc(var(--safe-l) + 16px);
  border-radius: 26px 26px 0 0;
  background: rgba(245, 237, 227, 0.9);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  color: var(--text);
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.18);
}
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto 6px;
}

.product-line {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}
.product-line__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
  color: var(--burgundy-dark);
}
.product-line__price {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.shop-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burgundy);
  text-decoration: underline;
  text-decoration-color: rgba(107, 29, 53, 0.35);
  text-underline-offset: 5px;
  white-space: nowrap;
}
.shop-link:hover { text-decoration-color: currentColor; }

.swatches {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  max-width: 420px;
  margin: 0 auto;
}
.swatch {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}
.swatch::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 -6px 10px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(42, 42, 42, 0.18);
  transition: transform 0.35s var(--ease);
}
.swatch::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s, transform 0.4s var(--ease);
}
.swatch:hover::before { transform: scale(1.06); }
.swatch[aria-checked="true"]::after { opacity: 1; transform: none; }
.swatch[aria-checked="true"]::before { transform: scale(0.9); }
.swatch:focus-visible { outline-offset: 1px; outline-color: var(--burgundy); }

.flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.flash.is-on { animation: flash 0.42s ease-out; }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }

/* ==========================================================
   Result
   ========================================================== */
.view--result {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    calc(var(--safe-t) + 12px)
    calc(var(--safe-r) + 16px)
    calc(var(--safe-b) + 24px)
    calc(var(--safe-l) + 16px);
  background:
    radial-gradient(120% 60% at 50% 0%, var(--cream-light) 0%, rgba(251, 246, 240, 0) 60%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%);
}

.result__top {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.result__eyebrow { text-align: center; }

.result__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 520px;
}
.result__frame {
  padding: 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(214, 190, 161, 0.7);
  box-shadow: 0 30px 60px -28px rgba(74, 20, 37, 0.5);
}
.result__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 56vh;
  max-height: 56dvh;
  border-radius: 17px;
  background: var(--cream-dark);
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
}
.result__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 16px;
  text-align: center;
}
.result__tagline {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
  color: var(--burgundy-dark);
}
.result__handle {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.result__product {
  margin: 14px 0 6px;
  justify-content: center;
}
.result__swatches { width: 100%; max-width: 360px; margin: 0 auto 6px; }

.result__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin-top: 12px;
}
.result__actions.is-single { grid-template-columns: 1fr; }
.result__actions .btn { padding: 0 16px; }

.hint {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
}

.result__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 6px;
  margin-top: 8px;
}
.result__links .dot { color: var(--gold); }

/* ==========================================================
   Overlays: message dialog, busy state
   ========================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 16px calc(var(--safe-r) + 16px) calc(var(--safe-b) + 16px) calc(var(--safe-l) + 16px);
  background: rgba(20, 10, 14, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: view-in 0.3s ease both;
}
@media (min-width: 640px) { .overlay { place-items: center; } }

.overlay__card {
  width: 100%;
  max-width: 420px;
  padding: 30px 24px 20px;
  border-radius: 26px;
  background: var(--cream);
  color: var(--text);
  text-align: center;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
  animation: rise 0.45s var(--ease) both;
}
.overlay__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--burgundy-dark);
}
.overlay__text {
  margin: 0 auto 20px;
  max-width: 34ch;
  font-size: 0.9375rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--text);
}
.overlay__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.overlay__actions .btn { width: 100%; max-width: 320px; }

.busy {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: rgba(245, 237, 227, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: view-in 0.3s ease both;
}
.busy p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-style: italic;
  color: var(--burgundy-dark);
}
.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(107, 29, 53, 0.15);
  border-top-color: var(--burgundy);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================
   Debug panel (?debug=1)
   ========================================================== */
.debug {
  position: fixed;
  z-index: 50;
  top: calc(var(--safe-t) + 66px);
  left: calc(var(--safe-l) + 8px);
  width: 236px;
  max-height: calc(100dvh - var(--safe-t) - 80px);
  overflow: auto;
  padding: 8px 12px 10px;
  border-radius: 14px;
  background: rgba(15, 8, 11, 0.74);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--cream);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.debug summary {
  cursor: pointer;
  padding: 4px 0;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold);
}
.debug label { display: block; margin-top: 8px; }
.debug label span { display: flex; justify-content: space-between; }
.debug output { color: var(--gold); }
.debug input[type="range"] { width: 100%; margin: 4px 0 0; accent-color: var(--gold); }
.debug__check { display: flex !important; align-items: center; gap: 8px; }
.debug__check input { accent-color: var(--gold); width: 16px; height: 16px; margin: 0; }
.debug dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(245, 237, 227, 0.15);
}
.debug dt { color: rgba(245, 237, 227, 0.6); }
.debug dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.debug__head {
  margin: 12px 0 0;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(245, 237, 227, 0.6);
  text-transform: uppercase;
  font-size: 10px;
}
.debug__group.is-off { opacity: 0.45; }
.debug input:disabled { opacity: 0.5; }
.debug__note {
  margin: 8px 0 0;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(214, 190, 161, 0.18);
  color: var(--gold);
}

/* ---------- No-JS ---------- */
.noscript {
  position: fixed;
  inset: auto 16px calc(var(--safe-b) + 16px) 16px;
  z-index: 60;
  margin: 0 auto;
  max-width: 420px;
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--burgundy-dark);
  color: var(--cream);
  font-size: 0.875rem;
  text-align: center;
}
.noscript a { color: var(--gold); }

/* ==========================================================
   Stage loader (camera open, tracker or bracelet still loading)
   ========================================================== */
.stage__loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 10, 14, 0.52);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: opacity 0.45s var(--ease);
}
.stage__loader.is-hidden { opacity: 0; pointer-events: none; }
.loader {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 320px;
  text-align: center;
  color: var(--cream);
}
.loader__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  margin-bottom: 10px;
  border-radius: 50%;
}
.loader__ring::before,
.loader__ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
/* Soft gold halo that breathes */
.loader__ring::before {
  inset: -22px;
  background: radial-gradient(circle, rgba(214, 190, 161, 0.3) 0%, rgba(214, 190, 161, 0) 68%);
  animation: loader-breathe 2.4s ease-in-out infinite;
}
/* Rotating gold arc */
.loader__ring::after {
  border: 2px solid rgba(245, 237, 227, 0.16);
  border-top-color: var(--gold);
  border-right-color: rgba(214, 190, 161, 0.5);
  animation: spin 1.1s linear infinite;
}
.loader__logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.loader__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1.15;
}
.loader__title em { font-style: italic; color: var(--gold); }
.loader__sub {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 237, 227, 0.8);
}
.loader__bar {
  width: 180px;
  height: 2px;
  margin-top: 4px;
  border-radius: 2px;
  background: rgba(245, 237, 227, 0.18);
  overflow: hidden;
}
.loader__fill {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--gold);
  transition: width 0.35s var(--ease);
}
.loader__hint {
  margin: 6px 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(245, 237, 227, 0.6);
}
@keyframes loader-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .status__dot { animation: none; opacity: 1; }
  .loader__ring::before { animation: none; opacity: 0.85; }
  .loader__ring::after { animation: none; }
}
