/* ==========================================================================
   King Host — Reset, typographie de base et utilitaires
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  /* Empêche le contenu de passer sous le header collant lors des ancres */
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(circle at 78% 10%, var(--gold-glow), transparent 27rem),
    radial-gradient(circle at 12% 46%, rgba(214, 177, 92, 0.04), transparent 26rem),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Garde-fou : aucune page ne doit jamais scroller horizontalement */
  overflow-x: hidden;
}

/* Verrouille le scroll quand le menu mobile est ouvert */
body.is-locked {
  overflow: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
}

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

svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke-width: 1.8;
  flex-shrink: 0;
}

/* Focus visible cohérent sur tout le site (accessibilité clavier) */
:where(a, button, summary, input, textarea, select, details):focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: rgba(214, 177, 92, 0.3);
  color: var(--text);
}

/* Barre de défilement discrète, accordée au thème */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 177, 92, 0.35) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(214, 177, 92, 0.28);
  border: 3px solid transparent;
  border-radius: var(--r-full);
  background-clip: content-box;
}

/* --------------------------------------------------------------------------
   Grain de fond
   -------------------------------------------------------------------------- */
.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: var(--z-noise);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Utilitaires
   -------------------------------------------------------------------------- */

/* Conteneur central : une seule règle pour toutes les sections du site */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--shell-pad);
}

.section {
  padding-block: var(--section-gap);
}

.section--tight {
  padding-block: calc(var(--section-gap) * 0.6);
}

.section--flush-top {
  padding-top: 0;
}

.text-gold {
  background: var(--grad-gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted {
  color: var(--muted);
}

/* Lien d'évitement pour les lecteurs d'écran / navigation clavier */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--gold);
  color: #17130b;
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform var(--t-fast);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Apparition au scroll (piloté par assets/js/main.js)

   IMPORTANT : la mise en transparence est conditionnée à la classe « .js »,
   posée en tout début de <head>. Sans JavaScript — ou si le script échoue —
   la classe est absente et le contenu reste simplement visible. Sans cette
   précaution, une erreur JS rendrait la page entièrement blanche.
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   Accessibilité : respect de « réduire les animations »
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
