/* ============================================================
   Est-ce que Donald Trump est mort ? / Is Donald Trump dead?
   Stylesheet unique — fond noir, esthétique trumpstore-like
   ============================================================ */

/* --- Polices self-hostées (sous-set latin uniquement, ~90 Ko total) --- */
@font-face {
  font-family: "Cinzel";
  src: url("/assets/fonts/cinzel-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-400.woff2") format("woff2");
  font-weight: 100 900; /* fichier variable couvrant toute la plage */
  font-style: normal;
  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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Allura";
  src: url("/assets/fonts/allura-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  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+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Reset minimal moderne --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #000;
  --fg: #fff;
  --muted: #aaa;
  --muted-strong: #ccc;
  --muted-soft: #666;

  --link: #c8102e; /* rouge républicain US — accent visuel */
  --link-soft: #8b1825;
  --link-hover: #e02538;

  --gold: #c9a96e; /* champagne sobre — accent décoratif (bordures, traits, hover sec) */

  --font-display: "Cinzel", "Trajan Pro", "Times New Roman", serif; /* H1, "Non" */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; /* corps, footer, UI */
  --font-script: "Allura", "Snell Roundhand", "Apple Chancery", cursive; /* tagline (signature) */
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  /* Fond noir constellé de taches dorées diffuses à positions vraiment aléatoires (SVG inline).
     Le SVG (généré par build/generate-stars.mjs) contient ~80 cercles dorés à positions, tailles et opacités random — pas de pattern géométrique perceptible.
     Le ciel scrolle avec la page → effet "voyage cosmique". Tuile 1200×1200 (rares seams). */
  background-color: var(--bg);
  background-image: url("/assets/img/stars-bg.svg");
  background-size: 1200px 1200px;
  background-repeat: repeat;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.15rem);
  line-height: 1.5;
  text-align: center;
  display: flex;
  flex-direction: column;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--link-soft);
  text-underline-offset: 4px;
  transition:
    color 180ms ease,
    text-decoration-color 180ms ease;
}

a:hover,
a:focus-visible {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

.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;
}

/* --- Drapeau switcher (inline en haut, glow au survol) --- */
.flag-switcher {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.25rem 0;
}

.flag-link {
  display: block;
  width: clamp(1.85rem, 2.8vw, 2.4rem);
  border-radius: 3px;
  overflow: hidden;
  line-height: 0;
  filter: drop-shadow(0 0 0 transparent);
  transition:
    transform 220ms cubic-bezier(0.4, 0, 0.2, 1),
    filter 220ms ease;
}

.flag-link:hover,
.flag-link:focus-visible {
  transform: scale(1.06);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35))
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.18));
}

.flag-link:focus-visible {
  /* Outline conservé pour Windows High Contrast Mode (RGAA / WCAG 2.4.7) */
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.flag-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  display: block;
}

/* --- Layout principal --- */
main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 1.25rem 1.5rem;
  gap: 0;
}

.answer-block {
  max-width: 48rem;
  width: 100%;
}

.tagline {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--gold);
  font-size: clamp(1rem, 0.95rem + 0.6vw, 1.5rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  text-wrap: balance;
  letter-spacing: 0.01em;
}

.tagline #current-year {
  /* Pas de différenciation typographique — l'année reste dans le ton "signature" */
  font-weight: inherit;
  color: inherit;
}

.question {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 1rem + 2.8vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

.name-highlight {
  color: var(--link);
  white-space: nowrap;
}

.portrait {
  margin: 0 auto 1.25rem;
  max-width: min(85vw, 26rem);
}

.portrait img {
  margin: 0 auto;
  border-radius: 4px;
}



.answer-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.5rem, 2.8rem + 6vw, 6rem);
  line-height: 1;
  margin: 0.5rem 0 0.75rem;
  letter-spacing: -0.04em;
  text-wrap: balance;
}



.still-alive {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.2rem);
  margin: 0 0 0.85rem;
  text-wrap: balance;
}

.easter-egg {
  color: var(--muted);
  font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  font-style: italic;
  margin: 0 auto;
  max-width: 38rem;
  text-wrap: pretty;
}

/* Compteur d'âge — sous le H1, avant l'image. Ton très discret (subordonné à la tagline). */
.age-counter {
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 0.68rem + 0.15vw, 0.78rem);
  color: var(--gold);
  opacity: 0.55; /* effacé par rapport à la tagline qui est l'élément headline */
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums; /* chiffres alignés pour stabilité visuelle au tick */
  margin: 0 0 1rem;
  text-wrap: balance;
  font-style: italic;
}

/* --- Page 404 ---
   Hiérarchie visuelle alignée sur l'accueil :
   - "404" en gros caractère (équivalent visuel au "NON" de l'accueil)
   - "Page introuvable" en sous-titre serif (équivalent au H1 de l'accueil)
   - Phrase explicative + bouton retour clair */
.not-found {
  padding: 2rem 1.25rem;
}

.not-found .error-code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(5rem, 4rem + 8vw, 9rem);
  color: var(--fg);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.not-found-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 1rem + 2.5vw, 2.4rem);
  color: var(--gold);
  letter-spacing: 0.02em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.not-found-explanation {
  font-style: italic;
  color: var(--muted-strong);
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.2rem);
  max-width: 36rem;
  margin: 0 auto 2rem;
  text-wrap: pretty;
}

.not-found-return {
  margin: 0;
}

.back-link {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: var(--muted-strong);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  font-variant: small-caps;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    background-color 180ms ease;
}

.back-link:hover,
.back-link:focus-visible {
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--fg);
  background-color: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

/* --- Bouton Ko-fi (dans le footer, design pilule, sans underline) --- */
.site-footer .coffee {
  margin-top: 1.5rem; /* respiration entre le crédit Pixabay et le bouton */
}

.coffee-link {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: var(--muted-strong);
  text-decoration: none; /* override de la règle 'a' globale */
  font-size: 0.9rem;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    background-color 180ms ease;
}

.coffee-link:hover,
.coffee-link:focus-visible {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--fg);
  background-color: rgba(255, 255, 255, 0.04);
  text-decoration: none; /* override aussi en hover/focus */
}

/* --- Footer (atténué) --- */
.site-footer {
  flex-shrink: 0;
  padding: 1.5rem 1.5rem 2rem;
  font-size: 0.78rem;
  color: var(--muted-soft);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  margin-top: 2.5rem;
  line-height: 1.55;
}

.site-footer p {
  margin: 0.35rem auto;
  max-width: 44rem;
}

.site-footer a {
  color: #777; /* TRÈS légèrement plus clair que le texte (#666) */
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.1);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--muted);
  text-decoration-color: var(--link-soft);
}

/* Override pour Ko-fi : pas d'underline (la spécificité .site-footer a > .coffee-link sans préfixe) */
.site-footer a.coffee-link,
.site-footer a.coffee-link:hover,
.site-footer a.coffee-link:focus-visible {
  text-decoration: none;
}

.legal-notice {
  margin-top: 2rem;
  font-size: 0.8rem;
}

.legal-notice summary {
  cursor: pointer;
  user-select: none;
  display: inline-block;
  padding: 0.25rem 0.5rem;
  color: #555; /* plus discret que muted-soft (#666) */
  list-style: none; /* enlève la flèche par défaut sur certains UA */
  transition: color 180ms ease;
  font-size: 0.78rem;
}

.legal-notice summary::-webkit-details-marker {
  display: none; /* idem Safari */
}

.legal-notice summary::before {
  content: "▸ ";
  color: #555; /* aligné avec la couleur du summary */
  margin-right: 0.25rem;
  transition:
    transform 180ms ease,
    color 180ms ease;
  display: inline-block;
}

.legal-notice[open] summary::before {
  content: "▾ ";
}

.legal-notice summary:hover,
.legal-notice summary:focus-visible {
  color: var(--muted-strong);
}

.legal-notice summary:focus-visible {
  outline: 2px solid var(--muted-strong);
  outline-offset: 3px;
  border-radius: 2px;
}

.legal-notice address {
  font-style: normal;
  margin: 0.75rem auto 0;
  padding: 0.85rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.06); /* discrète mais perceptible */
  border-radius: 6px;
  display: inline-block;
  text-align: left;
  max-width: 38rem;
  color: #555;
}

.legal-notice address p {
  margin: 0.3rem 0;
}

/* Liens dans les mentions légales : style muet (préserve l'aspect précédent quand le bloc était dans .site-footer) */
.legal-notice address a {
  color: #777;
  text-decoration-color: rgba(255, 255, 255, 0.15);
}

.legal-notice address a:hover,
.legal-notice address a:focus-visible {
  color: var(--muted);
  text-decoration-color: var(--link-soft);
}

/* Animation douce d'ouverture/fermeture du <details> — Chrome 131+, Safari 18.2+, Firefox récent.
   Fallback gracieux : reveal instantané (comportement natif) sur browsers sans support. */
.legal-notice {
  interpolate-size: allow-keywords;
}

.legal-notice::details-content {
  height: 0;
  overflow: hidden;
  /* Easing 'ease' uniforme avec la transition existante du chevron summary (180ms ease).
     Durée 190ms : réduction d'1/3 par rapport à la version initiale (280ms) — ressenti plus nerveux. */
  transition:
    height 190ms ease,
    content-visibility 190ms allow-discrete;
}

.legal-notice[open]::details-content {
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .legal-notice::details-content {
    transition: none;
  }
}

/* ============================================================
   Easter egg MDGA (Make Death Great Again) — plaque parodique sous le footer

   Effet : pierre tombale qui se lève dans une aura biblique en fondu.
   - L'aura (lueur dorée diffuse) apparait, atteint son pic au milieu de l'entrée, puis s'estompe
   - La plaque émerge du bas, monte, se déflouttte et atteint sa pleine présence
   - Symétrique : scroll inverse → l'effet se rejoue à l'envers naturellement (timeline view())
   - 100% CSS, pas de JS, pas de fallback hasardeux
   ============================================================ */
.mdga-easter-egg {
  position: relative; /* ancrage pour l'aura ::before */
  isolation: isolate; /* stacking context pour ::before z-index:-1 */
  display: flex;
  justify-content: center;
  /* Margin-bottom respecte la safe area iOS (notch + home indicator) */
  margin: 3rem auto calc(2.5rem + env(safe-area-inset-bottom, 0px));
  width: clamp(110px, 14vw, 160px); /* discret easter-egg */
}

/* Sur mobile, on ajoute davantage de margin-bottom pour clear la barre dynamique
   Safari iOS qui peut couvrir le bas du viewport quand l'utilisateur scrolle */
@media (max-width: 600px) {
  .mdga-easter-egg {
    margin-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Aura biblique : radial gradient doré-blanc en arrière-plan, débordant la plaque */
.mdga-easter-egg::before {
  content: "";
  position: absolute;
  inset: -60% -45%; /* déborde largement de la plaque */
  background: radial-gradient(
    ellipse at center,
    rgba(255, 240, 200, 0.7) 0%,
    /* cœur lumineux blanc-doré (plus présent) */ rgba(255, 200, 100, 0.4) 28%,
    rgba(255, 160, 50, 0.18) 55%,
    transparent 75%
  );
  filter: blur(18px);
  opacity: 0; /* invisible par défaut, l'animation pilote */
  z-index: -1;
  pointer-events: none;
  animation: mdgaAura linear both;
  animation-timeline: view();
  /* Range compacte sur la phase d'entrée → animation complète quel que soit le scroll de la page */
  animation-range: entry 0% entry 100%;
}

.mdga-easter-egg picture,
.mdga-easter-egg img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  position: relative;
  z-index: 1;
}

.mdga-easter-egg img {
  /* État initial : enfouie, floue, fantomatique */
  opacity: 0.08;
  filter: blur(6px);
  transform: translateY(60px);
  animation: mdgaTombRise linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 100%;
}

/* Aura : monte rapidement puis maintient un halo persistant à l'état final.
   L'état final EST visible (halo doré) → le user voit toujours quelque chose même en arrivant en bas de page sans scroller en arrière.
   Scroll inverse → joué à l'envers automatiquement (timeline view()). */
@keyframes mdgaAura {
  0% {
    opacity: 0;
  } /* hors viewport */
  60% {
    opacity: 1;
  } /* pic dramatique pendant l'apparition */
  100% {
    opacity: 0.55;
  } /* HALO PERSISTANT : visible à l'état final */
}

/* Plaque : se lève complètement et atteint sa pleine présence à 100% du timeline.
   Pas de plateau intermédiaire pour garantir que l'état final = plaque parfaitement nette. */
@keyframes mdgaTombRise {
  0% {
    opacity: 0.08;
    filter: blur(6px);
    transform: translateY(60px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

/* Fallback : si animation-timeline non supporté (très anciens navigateurs), plaque visible statique */
@supports not (animation-timeline: view()) {
  .mdga-easter-egg::before {
    opacity: 0.4;
    animation: none;
  }
  .mdga-easter-egg img {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
  }
}

/* Accessibilité : pas d'animation pour les utilisateurs sensibles aux mouvements */
@media (prefers-reduced-motion: reduce) {
  .mdga-easter-egg::before {
    opacity: 0.35;
    animation: none;
  }
  .mdga-easter-egg img {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
  }
}

/* --- Respect des préférences utilisateur --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Print : pas de gag, version sobre --- */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .flag-switcher,
  .coffee {
    display: none;
  }
}
