/* Pages client de la carte de fidélité (/f/... et /t).
   Mobile d'abord. Les couleurs viennent du restaurant, via les variables posées par le serveur :
   --bg (fond), --fg (texte), --label (textes secondaires), --stamp (tampons et boutons). */

@font-face {
  font-family: Outfit;
  src: url("../fonts/outfit-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Outfit;
  src: url("../fonts/outfit-latin-ext-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Valeurs de repli si le serveur n'a pas posé de couleurs. */
  --bg: #0F1B2D;
  --fg: #FFFFFF;
  --label: #A9B8CC;
  --stamp: #4DB4FF;
  --surface: color-mix(in srgb, var(--fg) 8%, transparent);
  --line: color-mix(in srgb, var(--fg) 22%, transparent);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

/* L'attribut hidden doit toujours gagner, même sur un élément stylé (ex. bouton « Scanner »). */
[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  /* Les confettis de la récompense peuvent dépasser un instant : jamais de défilement horizontal. */
  overflow-x: clip;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: Outfit, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--stamp);
  outline-offset: 3px;
}

.shell {
  flex: 1;
  width: min(100%, 460px);
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) 16px 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- En-tête du restaurant ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.brand-logo,
.brand-initial {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
}

.brand-logo {
  object-fit: cover;
  background: var(--fg);
}

.brand-initial {
  display: grid;
  place-items: center;
  background: var(--stamp);
  color: var(--bg);
  font-size: 1.6rem;
  font-weight: 700;
}

.brand-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Lien « Espace pro » (en haut à droite, dans le flux : ne recouvre rien) ---------- */

.pro-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: -0.25rem;
}

.pro-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
}

.pro-link:hover {
  background: color-mix(in srgb, var(--fg) 14%, transparent);
}

/* ---------- Blocs ---------- */

.panel {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 7vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.lead {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.rule {
  margin: 0 0 1rem;
  color: var(--stamp);
  font-size: 1.15rem;
  font-weight: 600;
}

.steps,
.plain-list {
  margin: 0;
  padding-left: 1.3rem;
}

.steps li,
.plain-list li {
  margin: 0.35rem 0;
}

.hint {
  margin: 1rem 0 0;
  color: var(--label);
  font-size: 0.92rem;
}

.notice,
.alert {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-weight: 500;
}

.notice {
  border: 1px solid var(--line);
  background: var(--surface);
}

.alert {
  border: 2px solid #E5484D;
  background: #FFF1F1;
  color: #5C1114;
}

.alert a,
.notice a {
  font-weight: 600;
}

/* ---------- Formulaire ---------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field label {
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 0.9rem;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #FFFFFF;
  color: #111111;
  font: inherit;
  font-size: 1.1rem; /* 16 px minimum : évite le zoom automatique sur iPhone */
}

.field input[aria-invalid="true"] {
  border-color: #E5484D;
}

.field-error {
  margin: 0;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: #FFF1F1;
  color: #8A1C21;
  font-size: 0.92rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.98rem;
}

.check input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0.1rem 0 0;
  accent-color: var(--stamp);
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  margin-top: 0.25rem;
  padding: 0.8rem 1.2rem;
  border: 0;
  border-radius: 12px;
  background: var(--stamp);
  color: var(--bg);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-secondary {
  border: 2px solid var(--fg);
  background: transparent;
  color: var(--fg);
}

.btn-danger {
  background: #D93036;
  color: #FFFFFF;
}

.link {
  display: block;
  margin-top: 0.9rem;
  text-align: center;
}

/* ---------- Carte web ---------- */

.loyalty-card {
  text-align: center;
}

.hello {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.stamps svg {
  display: block;
  width: 100%;
  height: auto;
}

.count {
  margin: 0.75rem 0 0.25rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.count-label {
  display: block;
  color: var(--label);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reward {
  margin: 0 0 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--stamp);
  color: var(--bg);
  font-weight: 700;
}

.next {
  margin: 0;
  color: var(--label);
}

.wallet-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.wallet-btn img {
  display: block;
  height: 50px;
  width: auto;
}

.small-links {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.92rem;
}

.small-links a {
  color: var(--label);
}

/* Le QR « ouvre ta carte sur ton téléphone » ne sert que sur ordinateur. */
.desktop-only {
  display: none;
  text-align: center;
}

.qr svg {
  display: block;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: 8px;
}

@media (pointer: fine) and (min-width: 720px) {
  .desktop-only {
    display: block;
  }
}

/* ---------- Résultat du tag (/t) ---------- */

.tap {
  text-align: center;
}

.tap-icon {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0.5rem auto 1rem;
  border-radius: 50%;
  background: var(--stamp);
  color: var(--bg);
  font-size: 2.6rem;
  font-weight: 700;
  animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.tap-wait .tap-icon,
.tap-info .tap-icon {
  background: var(--surface);
  color: var(--fg);
}

.tap h1 {
  font-size: clamp(1.9rem, 9vw, 2.5rem);
}

.tap .stamps {
  margin: 1rem 0;
}

@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tap-icon {
    animation: none;
  }
}

/* ---------- Photo de fond du restaurant ----------
   Photo plein écran derrière la page, avec un voile sombre automatique (.45 en haut, .65 en bas) ;
   les blocs reprennent la couleur de la carte (72 %) avec un flou léger : le texte reste lisible
   (contraste d'au moins 4,5:1) quelle que soit la photo. Avec un habillage (skin), la photo remplace
   seulement l'image de fond de l'habillage : sa feuille de style, ses polices et son verre restent. */

.photo-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

.photo-backdrop img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.65));
}

body.has-photo:not(.skin) .panel,
body.has-photo:not(.skin) .brand,
body.has-photo:not(.skin) .pro-link {
  border: 1px solid color-mix(in srgb, var(--fg) 24%, transparent);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
}

body.has-photo:not(.skin) .brand {
  width: fit-content;
  padding: 0.4rem 1.1rem 0.4rem 0.45rem;
  border-radius: 999px;
}

body.has-photo:not(.skin) .credit,
body.has-photo:not(.skin) .credit a {
  color: #FFFFFF;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

/* ---------- Animation « coup de tampon » ----------
   Durée totale : 1,4 s. Impact à 0,45 s (32 %). Rien ne joue sans l'attribut data-tampon
   (posé par le serveur sur la page du tag, par tampon.js sur la carte quand les tampons ont augmenté).
   Seuls transform, opacity (et un léger flou) sont animés. */

.tampon-scene {
  position: relative;
}

.tampon-stamper,
.tampon-shadow,
.tampon-burst,
.tampon-confetti {
  position: absolute;
  pointer-events: none;
}

.tampon-scene .tampon-stamper {
  left: var(--hit-x);
  top: var(--hit-y);
  z-index: 2;
  width: var(--stamper-w, 15%);
  height: auto;
  overflow: visible;
  opacity: 0;
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

/* Ombre portée sur la carte : douce pendant la descente, se resserre à l'impact. */
.tampon-shadow {
  left: var(--hit-x);
  top: var(--hit-y);
  z-index: 1;
  width: var(--stamper-w, 15%);
  aspect-ratio: 3.2;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 70%);
  opacity: 0;
  transform: translate(-50%, -30%) scale(1.8);
}

.tampon-burst {
  left: var(--hit-x);
  top: var(--hit-y);
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 224, 138, 0.95) 0%, rgba(245, 200, 76, 0.45) 38%, rgba(245, 200, 76, 0) 68%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
}

.tampon-confetti {
  inset: 0;
  z-index: 3;
}

.tampon-confetti i {
  position: absolute;
  left: var(--hit-x);
  top: var(--hit-y);
  width: 7px;
  height: 11px;
  margin: -5px 0 0 -3px;
  border-radius: 2px;
  background: var(--c);
  opacity: 0;
}

.stamp-last {
  transform-box: fill-box;
  transform-origin: center;
}

.ink-ring {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

[data-tampon] {
  animation: tampon-shake 0.3s 0.45s ease-out both;
}

[data-tampon] .tampon-scene .tampon-stamper {
  animation: tampon-stamper 1.4s linear both;
}

[data-tampon] .tampon-shadow {
  animation: tampon-shadow 1.4s linear both;
}

[data-tampon] .stamp-last {
  animation: tampon-ink 0.5s 0.45s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

[data-tampon] .ink-ring {
  animation: tampon-ring 0.7s 0.45s ease-out both;
}

[data-tampon="reward"] {
  animation-name: tampon-shake-strong;
}

[data-tampon="reward"] .tampon-burst {
  animation: tampon-burst 0.85s 0.45s ease-out both;
}

[data-tampon="reward"] .tampon-confetti i {
  animation: tampon-confetti 0.95s 0.45s cubic-bezier(0.2, 0.7, 0.4, 1) both;
}

@keyframes tampon-stamper {
  0% {
    opacity: 0;
    transform: translate(-50%, -100%) translateY(-150%) rotate(-7deg);
    animation-timing-function: cubic-bezier(0.55, 0, 0.9, 0.5);
  }

  8% {
    opacity: 1;
  }

  32% {
    opacity: 1;
    transform: translate(-50%, -100%) translateY(0) rotate(0deg) scale(1, 1);
    animation-timing-function: ease-out;
  }

  37% {
    transform: translate(-50%, -100%) translateY(0) scale(1.05, 0.9);
    animation-timing-function: ease-out;
  }

  44% {
    transform: translate(-50%, -100%) translateY(-4%) scale(1, 1);
    animation-timing-function: cubic-bezier(0.4, 0, 0.7, 1);
  }

  74% {
    opacity: 1;
  }

  80%,
  100% {
    opacity: 0;
    transform: translate(-50%, -100%) translateY(-170%) rotate(5deg);
  }
}

@keyframes tampon-shadow {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(2); }
  30% { opacity: 0.3; transform: translate(-50%, -30%) scale(1.25); }
  33% { opacity: 0.6; transform: translate(-50%, -30%) scale(0.95); }
  44% { opacity: 0.45; transform: translate(-50%, -30%) scale(1); }
  76% { opacity: 0.1; transform: translate(-50%, -30%) scale(1.8); }
  82%, 100% { opacity: 0; transform: translate(-50%, -30%) scale(2); }
}

@keyframes tampon-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, 0); }
  75% { transform: translate(-1px, 1px); }
}

@keyframes tampon-shake-strong {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -1px); }
  60% { transform: translate(-2px, 1px); }
  80% { transform: translate(1px, 0); }
}

@keyframes tampon-ink {
  from {
    opacity: 0;
    transform: scale(1.3);
    filter: blur(3px);
  }

  60% {
    opacity: 1;
  }

  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes tampon-ring {
  0% { opacity: 0; transform: scale(0.7); }
  20% { opacity: 0.75; }
  100% { opacity: 0; transform: scale(1.55); }
}

@keyframes tampon-burst {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

@keyframes tampon-confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(0.6); }
  45% { opacity: 1; transform: translate(var(--dx), var(--dy)) rotate(calc(var(--r) * 0.5)) scale(1); }
  100% { opacity: 0; transform: translate(calc(var(--dx) * 1.2), calc(var(--dy) + 70px)) rotate(var(--r)) scale(0.9); }
}

@keyframes tampon-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mouvement réduit : ni tampon encreur, ni secousse, ni confettis ; le nouveau tampon apparaît en fondu. */
@media (prefers-reduced-motion: reduce) {
  [data-tampon],
  [data-tampon="reward"] {
    animation: none;
  }

  [data-tampon] .tampon-scene .tampon-stamper,
  [data-tampon] .tampon-shadow,
  [data-tampon] .tampon-burst,
  [data-tampon] .tampon-confetti,
  [data-tampon] .ink-ring {
    display: none;
  }

  [data-tampon] .stamp-last {
    animation: tampon-fade 0.6s 0.15s ease-out both;
  }
}

/* ---------- Pied de page ---------- */

.credit {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  padding: 1rem 16px max(1.25rem, env(safe-area-inset-bottom));
  color: var(--label);
  font-size: 0.85rem;
}

/* ---------- Page de confidentialité (statique) ---------- */

.legal h2 {
  margin-top: 1.5rem;
}

.legal p,
.legal li {
  color: var(--fg);
}

/* ---------- Pages staff ---------- */

.staff .shell {
  width: min(100%, 640px);
}

.staff-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.staff-home {
  font-weight: 600;
  text-decoration: none;
}

.link-button {
  padding: 0.4rem 0;
  border: 0;
  background: none;
  color: var(--label);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.pin-input {
  letter-spacing: 0.5em;
  text-align: center;
  font-size: 1.6rem !important;
}

.btn-scan {
  min-height: 72px;
  font-size: 1.3rem;
}

.btn-reward {
  background: #2FBF71;
  color: #0B2416;
}

.scanner video {
  display: block;
  width: 100%;
  max-height: 60vh;
  border-radius: 10px;
  background: #000000;
  object-fit: cover;
}

.search {
  display: flex;
  gap: 0.5rem;
}

.search input {
  flex: 1;
  min-width: 0;
  min-height: 54px;
  padding: 0.7rem 0.9rem;
  border: 0;
  border-radius: 10px;
  background: #FFFFFF;
  color: #111111;
  font: inherit;
  font-size: 1.1rem;
}

.search .btn {
  width: auto;
  margin: 0;
}

.results {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.result {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0.25rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.result-name {
  font-weight: 600;
}

.result-meta {
  color: var(--label);
  white-space: nowrap;
}

.staff-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.staff-actions form {
  margin: 0;
}

.notice-ok {
  border-color: #2FBF71;
  background: #E8F8EF;
  color: #0B3D22;
}

.qr-large svg {
  width: min(80vw, 320px);
  height: auto;
  aspect-ratio: 1;
}

.resend {
  text-align: center;
}

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

/* ---------- Inscription : âge et anniversaire ---------- */

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

.fieldset legend {
  padding: 0;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.fieldset .hint {
  margin: 0.15rem 0 0;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 52px;
  margin: 0 0 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 1.05rem;
  cursor: pointer;
}

.choice input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--stamp);
}

.choice:has(input:checked) {
  border-color: var(--stamp);
}

.choice-note {
  display: block;
  color: var(--label);
  font-size: 0.9rem;
}

.birthday {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.75rem;
}

.select-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.select-field label {
  font-size: 0.95rem;
}

.select-field select {
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 0.9rem;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #FFFFFF;
  color: #111111;
  font: inherit;
  font-size: 1.1rem;
}

.select-field select[aria-invalid="true"] {
  border-color: #E5484D;
}

/* ---------- Choix du cadeau (staff) ---------- */

.reward-choices {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.reward-choices legend {
  padding: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.reward-choices .choice {
  margin: 0;
}

.card-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  text-align: left;
}

/* ---------- Dernier message du restaurant (carte web) ---------- */

.card-message {
  margin-top: 1rem;
}

.card-message-label {
  margin: 0 0 0.35rem;
  color: var(--label);
  font-size: 0.85rem;
}

.card-message h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.card-message-body {
  margin: 0;
  font-size: 0.97rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* ---------- Finition métallisée ----------
   Dégradé métallique dérivé de la couleur de fond (reflets clairs et sombres, légère texture brossée) et
   un reflet qui passe toutes les 7 s (comme le logo en or poli du menu). Les reflets restent assez doux pour
   que le texte garde au moins 4,5:1 : les jeux de couleurs proposés dans l'admin sont testés sur le pire cas
   (reflet clair de +30 % de blanc, ombre de 20 % de noir). Sans effet quand une photo de fond est choisie. */

body.finish-metal:not(.has-photo) {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, rgba(0, 0, 0, 0.04) 2px 3px),
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--bg) 88%, #000) 0%,
      color-mix(in srgb, var(--bg) 70%, #fff) 16%,
      color-mix(in srgb, var(--bg) 98%, #fff) 32%,
      color-mix(in srgb, var(--bg) 84%, #000) 50%,
      color-mix(in srgb, var(--bg) 78%, #fff) 66%,
      color-mix(in srgb, var(--bg) 98%, #000) 82%,
      color-mix(in srgb, var(--bg) 80%, #000) 100%
    );
  background-attachment: fixed;
}

body.finish-metal:not(.has-photo)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.18) 50%, transparent 62%) no-repeat;
  background-size: 250% 100%;
  background-position: 130% 0;
  animation: metal-shine 7s ease-in-out 1s infinite;
}

body.finish-metal > .shell,
body.finish-metal > .credit {
  position: relative;
  z-index: 1;
}

@keyframes metal-shine {
  0% { background-position: 130% 0; }
  23% { background-position: -30% 0; }
  100% { background-position: -30% 0; }
}

@media (prefers-reduced-motion: reduce) {
  body.finish-metal:not(.has-photo)::before {
    animation: none;
    opacity: 0;
  }
}
