/* ===========================================================================
   Photomaton d'Halloween — Cox Animation
   Palette : nuit violette, citrouille, fantôme, slime… et le rouge coccinelle
   de l'association.
   =========================================================================== */

/* Polices auto-hébergées (SIL Open Font License) : aucune requête vers un tiers. */
@font-face {
  font-family: "Creepster";
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/creepster.woff2") format("woff2");
}
@font-face {
  font-family: "Fredoka";
  font-weight: 300 700;
  font-display: swap;
  src: url("assets/fonts/fredoka.woff2") format("woff2");
}
@font-face {
  font-family: "Nunito";
  font-weight: 200 1000;
  font-display: swap;
  src: url("assets/fonts/nunito.woff2") format("woff2");
}

:root {
  --night: #1b1030;
  --night-2: #2a1845;
  --night-3: #362158;
  --pumpkin: #ff8a2a;
  --pumpkin-dark: #e05f12;
  --ghost: #f5f0ff;
  --lavender: #b8a6ff;
  --slime: #7bd23a;
  --red: #d62828;
  --cream: #fff8ef;
  --ink: #f3ecff;
  --muted: #b3a6cc;
  --shadow: 0 22px 50px -20px rgba(0, 0, 0, 0.7);
  --radius: 24px;
  --radius-sm: 14px;
  --ring: 0 0 0 4px rgba(255, 138, 42, 0.35);
}

* { box-sizing: border-box; }

html { background: var(--night, #1b1030); }
html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(500px 500px at 88% -6%, rgba(255, 243, 196, 0.16), transparent 60%),
    radial-gradient(1200px 700px at 50% 120%, rgba(255, 138, 42, 0.14), transparent 60%),
    linear-gradient(180deg, var(--night) 0%, #24133d 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  display: flex;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Petites étoiles qui scintillent */
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 32% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 72% 22%, #fff3c4 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 86% 44%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 8% 62%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 56% 72%, #fff3c4 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 92% 86%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 24% 92%, #fff 50%, transparent 51%);
  background-size: 420px 420px;
  opacity: 0.7;
  animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { to { opacity: 0.35; } }

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding:
    calc(20px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
    calc(32px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app > * { flex-shrink: 0; }

[hidden] { display: none !important; }

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

/* ---- En-tête de l'association ---- */
.brand { display: flex; justify-content: center; }
.brand__link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand__logo-wrap { position: relative; display: block; }
.brand__logo {
  height: 84px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 14px rgba(255, 138, 42, 0.35));
  animation: wobble 3.2s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes wobble {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
}
.brand__tag { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

/* ---- Cartes ---- */
.card {
  background: linear-gradient(180deg, rgba(54, 33, 88, 0.92), rgba(42, 24, 69, 0.92));
  border: 1px solid rgba(184, 166, 255, 0.18);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px 26px;
  animation: rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.card--tight { padding: 14px 14px 20px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--slime);
  margin: 0 0 8px;
}

.spooky {
  font-family: "Creepster", "Fredoka", cursive;
  font-weight: 400;
  font-size: clamp(2.3rem, 10vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: 1px;
  margin: 0 0 14px;
  text-align: center;
  color: var(--pumpkin);
  text-shadow: 0 3px 0 #6b2a05, 0 0 24px rgba(255, 138, 42, 0.35);
}

.lead {
  font-size: 1.06rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 20px;
}

/* ---- Confidentialité ---- */
.privacy {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(123, 210, 58, 0.1);
  border: 1px dashed rgba(123, 210, 58, 0.5);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0 0 22px;
}
.privacy p { margin: 0; font-size: 0.95rem; line-height: 1.45; color: var(--ink); }
.privacy strong { color: var(--slime); }
.privacy__icon { font-size: 1.3rem; line-height: 1.2; }
.privacy--inline {
  display: block;
  margin: 18px 0 0;
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

/* ---- Boutons ---- */
.stack { display: grid; gap: 10px; }

.btn {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.08rem;
  border: none;
  border-radius: 999px;
  padding: 15px 26px;
  min-height: 54px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible, .frame:focus-visible, .shutter:focus-visible, .round:focus-visible, .link:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn--block { width: 100%; }
.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Bouton principal en forme de sourire de citrouille */
.btn--grin {
  width: 100%;
  max-width: 340px;
  justify-self: center;
  min-height: 0;
  height: 100px;
  padding: 18px 40px 0;
  border-radius: 0;
  background: url("assets/grin.svg") center / 100% 100% no-repeat;
  color: #3b1a08;
  font-size: 1.12rem;
  font-weight: 700;
  filter: drop-shadow(0 0 14px rgba(255, 138, 42, 0.45)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.35));
}
/* Lueur qui « respire » pour inviter à appuyer */
.btn--glow { animation: glow 2.2s ease-in-out infinite; }
@keyframes glow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(255, 138, 42, 0.4)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.35));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 26px rgba(255, 170, 60, 0.95)) drop-shadow(0 0 6px rgba(255, 220, 120, 0.7)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.35));
    transform: scale(1.03);
  }
}
.btn--grin:focus-visible {
  box-shadow: none;
  filter: drop-shadow(0 0 3px #fff3c4) drop-shadow(0 0 14px rgba(255, 138, 42, 0.8));
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  min-height: 46px;
  font-size: 0.98rem;
  padding: 10px 18px;
}
.btn--xmas {
  background: var(--red);
  color: #fff;
  box-shadow: 0 12px 24px -12px rgba(214, 40, 40, 0.8);
}

@media (hover: hover) and (pointer: fine) {
  .btn--grin:hover {
    animation-play-state: paused;
    transform: translateY(-1px) scale(1.02);
    filter: drop-shadow(0 0 22px rgba(255, 138, 42, 0.75)) drop-shadow(0 6px 6px rgba(0, 0, 0, 0.35));
  }
  .btn--ghost:hover { color: var(--ink); }
  .btn--xmas:hover { background: #b51f1f; transform: translateY(-1px); }
  .frame:hover { border-color: rgba(255, 138, 42, 0.6); }
}

.error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(214, 40, 40, 0.15);
  border: 1px solid rgba(214, 40, 40, 0.5);
  font-size: 0.92rem;
  line-height: 1.4;
}

/* ---- Aperçu caméra & photo ---- */
.stage,
.photo {
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--night);
  box-shadow: 0 0 0 1px rgba(184, 166, 255, 0.2), 0 18px 40px -20px #000;
}
.stage { aspect-ratio: 4 / 5; }
.stage.is-landscape { aspect-ratio: 5 / 4; }
.stage__canvas { width: 100%; height: 100%; display: block; }
.photo { display: block; height: auto; animation: pop 0.45s cubic-bezier(0.18, 1.3, 0.4, 1) both; }
@keyframes pop {
  from { opacity: 0; transform: scale(0.9) rotate(-2deg); }
  to { opacity: 1; transform: none; }
}

/* ---- Choix du cadre ---- */
.frames {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 16px;
}
.frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: rgba(27, 16, 48, 0.6);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.frame img { width: 44px; height: 55px; border-radius: 6px; background: #4a3a68; }
.frame.is-landscape img { width: 55px; height: 44px; margin: 5px 0 6px; }
.frame[aria-checked="true"] { border-color: var(--pumpkin); color: var(--cream); background: rgba(255, 138, 42, 0.12); }

/* ---- Commandes de prise de vue ---- */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}
.shutter {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 5px solid var(--cream);
  background: radial-gradient(circle at 50% 45%, var(--pumpkin) 0 56%, var(--pumpkin-dark) 57%);
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(255, 138, 42, 0.3), 0 10px 26px -8px rgba(255, 138, 42, 0.8);
  transition: transform 0.1s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.shutter:active { transform: scale(0.92); }
.round {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(184, 166, 255, 0.3);
  background: rgba(27, 16, 48, 0.7);
  color: var(--ink);
  font-size: 1.3rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 14px 0 0;
}

/* ---- Partage (discret) ---- */
.share {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.share__ask { margin: 0 0 4px; }
.share__actions { display: inline-flex; gap: 8px; align-items: center; }
.link {
  background: none;
  border: none;
  padding: 6px 4px;
  font: inherit;
  font-weight: 700;
  color: var(--lavender);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  border-radius: 6px;
}
.share__hint { margin: 10px auto 0; max-width: 38ch; line-height: 1.4; }

.networks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0 0;
}
.net {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 2px 8px;
  border: 1px solid rgba(184, 166, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(27, 16, 48, 0.6);
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, color 0.15s ease;
}
.net:active { transform: scale(0.96); }
.net:focus-visible { outline: none; box-shadow: var(--ring); }
.net svg {
  width: 38px;
  height: 38px;
  padding: 7px;
  border-radius: 12px;
  color: #fff;
}
.net--facebook svg { background: #1877f2; }
.net--instagram svg { background: radial-gradient(circle at 30% 110%, #ffdb6e 0%, #fd5949 40%, #d6249f 65%, #285aeb 100%); }
.net--tiktok svg { background: #111; filter: drop-shadow(1.5px 0 0 #25f4ee) drop-shadow(-1.5px 0 0 #fe2c55); }
.net--snapchat svg { background: #fffc00; }
@media (hover: hover) and (pointer: fine) {
  .net:hover { color: var(--ink); transform: translateY(-1px); }
}

/* ---- Marché de Noël ---- */
.xmas {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 32%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 94% 52%, rgba(255, 255, 255, 0.9) 0 1.5px, transparent 2.5px),
    linear-gradient(160deg, #1f5c3a, #154a2d);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 22px 22px;
  border: 2px solid rgba(255, 215, 120, 0.5);
  box-shadow: var(--shadow);
  animation: rise 0.5s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.xmas__eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffd778;
}
.xmas__title {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  margin: 0 0 8px;
}
.xmas__when { margin: 0 0 10px; font-weight: 800; line-height: 1.4; }
.xmas__desc { margin: 0 0 18px; line-height: 1.5; color: #dff0e4; }

/* ---- Pied de page ---- */
.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
  margin-top: auto;
}
.foot p { margin: 0; }
.foot a { color: var(--pumpkin); font-weight: 700; text-decoration: none; }

@media (max-width: 380px) {
  .brand__tag { display: none; }
  .card { padding: 22px 16px 22px; }
  .card--tight { padding: 10px 10px 16px; }
  .frame span { font-size: 0.72rem; }
}

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