/* PROJECT 40 — socle graphique commun */

@font-face {
  font-family: 'Bodoni Moda';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(../fonts/bodoni-moda-latin-opsz-normal.woff2) format('woff2-variations'), url(../fonts/bodoni-moda-latin-opsz-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Bodoni Moda';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url(../fonts/bodoni-moda-latin-opsz-italic.woff2) format('woff2-variations'), url(../fonts/bodoni-moda-latin-opsz-italic.woff2) format('woff2');
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(../fonts/manrope-latin-wght-normal.woff2) format('woff2-variations'), url(../fonts/manrope-latin-wght-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-400-normal.woff2) format('woff2');
}

:root {
  --night: #0a0607;
  --night-2: #120a0c;
  --ink: #1a0f12;
  --panel: rgba(22, 12, 14, 0.72);
  --rojo: #b3132b;
  --rojo-deep: #6e0a18;
  --rojo-glow: #e0313f;
  --oro: #d6b36a;
  --oro-pale: #f1dfb0;
  --oro-deep: #9a7434;
  --crema: #f4ecdf;
  --crema-2: rgba(244, 236, 223, 0.78);
  --crema-3: rgba(244, 236, 223, 0.5);
  --line: rgba(241, 223, 176, 0.16);
  --line-2: rgba(241, 223, 176, 0.32);
  --rosa: #d9857a;
  --ok: #8fc79a;
  --serif: 'Bodoni Moda', 'Didot', 'Bodoni 72', 'Bodoni MT', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --gold-grad: linear-gradient(100deg, #c49a4a 0%, #f3dc9b 22%, #d4ad5e 42%, #fbeec2 60%, #cfa24f 80%, #f3dc9b 100%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 4px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--night);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--crema);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, canvas, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--oro-pale); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
::selection { background: var(--rojo); color: #fff; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
  font-optical-sizing: auto;
}
em { font-family: var(--serif); font-style: italic; }

/* Chiffres : en Bodoni, le trait fin du « 4 » disparaît aux grandes tailles.
   Une taille optique basse garde « 40 » parfaitement lisible. */
.num, .mark, .countdown b, .serif-num { font-optical-sizing: none; font-variation-settings: 'opsz' 11; }
.serif-text { font-optical-sizing: none; font-variation-settings: 'opsz' 16; }
p { margin: 0 0 1em; }

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

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--oro);
  margin: 0;
}

.gold {
  background: var(--gold-grad);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmer 7s ease-in-out infinite alternate;
}
@keyframes shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

/* ---------------------------------------------------------------- fond */

.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.backdrop .bg { position: absolute; inset: 0; opacity: 0; will-change: opacity; }
.backdrop .bg-night {
  opacity: 1;
  background:
    radial-gradient(120% 80% at 50% 0%, #1d0d10 0%, transparent 60%),
    radial-gradient(90% 60% at 50% 110%, #170a0c 0%, transparent 70%),
    var(--night);
}
.backdrop .bg-red {
  background:
    radial-gradient(70% 60% at 70% 45%, rgba(150, 14, 34, 0.55) 0%, transparent 70%),
    radial-gradient(60% 50% at 15% 80%, rgba(90, 8, 20, 0.5) 0%, transparent 70%);
}
.backdrop .bg-rose {
  background:
    radial-gradient(60% 40% at 50% 78%, rgba(255, 170, 120, 0.55) 0%, transparent 70%),
    linear-gradient(180deg, #160a14 0%, #3b1726 34%, #8a3e47 62%, #d98a6e 84%, #e9a77c 100%);
}
.backdrop .bg-gold {
  background:
    radial-gradient(70% 50% at 50% 18%, rgba(214, 179, 106, 0.28) 0%, transparent 70%),
    radial-gradient(80% 60% at 50% 100%, rgba(120, 14, 30, 0.45) 0%, transparent 70%);
}

#world {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  z-index: 1;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.07;
  background-image: 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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ---------------------------------------------------------------- boutons */

.btn {
  --b: var(--oro);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid var(--b);
  border-radius: 2px;
  background: transparent;
  color: var(--oro-pale);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.5s var(--ease), border-color 0.5s var(--ease), transform 0.3s var(--ease);
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--gold-grad);
  background-size: 200% 100%;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.btn:hover, .btn:focus-visible { color: #1a0f08; }
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); transform-origin: left; }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-gold { color: #1a0f08; border-color: transparent; }
.btn-gold::before { transform: scaleX(1); animation: shimmer 6s ease-in-out infinite alternate; }
.btn-gold:hover { color: #000; }
.btn-ghost { --b: var(--line-2); color: var(--crema-2); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 11px; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--crema-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.link-btn:hover { color: var(--oro-pale); }

/* ---------------------------------------------------------------- formulaires */

.field { display: grid; gap: 8px; margin-bottom: 18px; text-align: left; }
.field > label, .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--crema-3);
}
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field textarea, .field select {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  background: rgba(10, 6, 7, 0.55);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  color: var(--crema);
  font-size: 16px;
  transition: border-color 0.3s, background 0.3s;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--oro);
  background: rgba(10, 6, 7, 0.8);
}
.field .hint { font-size: 13px; color: var(--crema-3); margin: 0; }

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

/* ---------------------------------------------------------------- texte enrichi */

.rich { color: var(--crema-2); }
.rich p:last-child, .rich ul:last-child { margin-bottom: 0; }
.rich strong { color: var(--crema); font-weight: 600; }
.rich ul { margin: 0 0 1em; padding: 0; list-style: none; }
.rich li { position: relative; padding-left: 1.4em; margin-bottom: 0.4em; }
.rich li::before { content: ''; position: absolute; left: 0; top: 0.72em; width: 0.7em; height: 1px; background: var(--oro); }

/* ---------------------------------------------------------------- toast */

.toast-zone {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 200;
  display: grid;
  gap: 10px;
  width: min(92vw, 440px);
  pointer-events: none;
}
.toast {
  padding: 14px 18px;
  background: rgba(20, 11, 13, 0.94);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--oro);
  color: var(--crema);
  font-size: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toast-in 0.5s var(--ease) both;
}
.toast.is-error { border-left-color: var(--rojo-glow); }
.toast.is-out { animation: toast-out 0.4s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ---------------------------------------------------------------- compte à rebours */

.countdown { display: flex; gap: clamp(14px, 4vw, 40px); justify-content: center; }
.countdown .cd-unit { display: grid; justify-items: center; gap: 6px; min-width: 3ch; }
.countdown b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 7vw, 64px);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}
.countdown small {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--crema-3);
}

/* ---------------------------------------------------------------- tampon */

.stamp {
  display: inline-block;
  padding: 4px 10px 3px;
  border: 1.5px solid currentColor;
  color: var(--rojo-glow);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  transform: rotate(-4deg);
  opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .grain { display: none; }
}
