/*
  Signature projet : site developpe par phomsay pour zaki.
  Contact Discord : @phomsay671.
  Dev web : phomsay. Admin : sauci.
  Travail de recherche et edition : Zaki & B.
  Ne pas supprimer cette signature pour les prochains devs qui travaillent sur le projet.
*/

:root {
  /* Couleurs communes de la section Histoire. Les périodes changent surtout l'accent lumineux. */
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --wakfu-teal: #2ecfb0;
  --dark-bg: #080810;
  --panel-bg: rgba(10, 10, 18, 0.86);
  --text-main: #e8e0d0;
  --text-soft: #fff7df;
  --text-muted: #a99d88;
}

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

html { scroll-behavior: smooth; }

body {
  /* Ces variables sont mises a jour par le JS pendant le scroll. */
  --history-energy-rgb: 155, 127, 212;
  --history-line-progress: 0;
  --history-page-progress: 0;
  --history-flow-shift: 0px;
  min-height: 100vh;
  background: var(--dark-bg);
  color: var(--text-main);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Petit ciel fixe: il donne de la matiere au fond meme quand une image est tres sombre. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 9% 16%, rgba(255,255,255,0.54) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 60%, rgba(255,255,255,0.28) 0%, transparent 100%),
    radial-gradient(1px 1px at 58% 24%, rgba(255,255,255,0.42) 0%, transparent 100%),
    radial-gradient(1px 1px at 84% 18%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(2px 2px at 76% 70%, rgba(46,207,176,0.32) 0%, transparent 100%),
    radial-gradient(2px 2px at 28% 78%, rgba(201,168,76,0.28) 0%, transparent 100%);
}

/* Les couches de fond restent toutes presentes; seule la periode active devient visible. */
.story-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #080810;
}

/* Voile commun par-dessus les images pour garder le texte lisible. */
.story-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(circle at 50% calc(12% + var(--history-page-progress) * 68%), rgba(var(--history-energy-rgb), 0.12), transparent 25%),
    linear-gradient(to bottom, rgba(8,8,16,0.08), rgba(8,8,16,0.54) 72%, rgba(8,8,16,0.88)),
    linear-gradient(to right, rgba(8,8,16,0.72), rgba(8,8,16,0.18) 44%, rgba(8,8,16,0.74));
}

.story-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  background-position: center;
  background-size: cover;
  transform: scale(1.04);
  transition: opacity 0.9s ease, transform 1.4s ease;
}

.story-bg-layer.active {
  opacity: 0.34;
  transform: scale(1);
}

.story-bg-krosmoz,
.story-bg-origines { background-image: url('../assets/histoire/KROSMOZ.png'); }
.story-bg-dofus { background-image: url('../assets/histoire/DOFUS.png'); }
.story-bg-wakfu { background-image: url('../assets/histoire/WAKFU.png'); }
.story-bg-waven { background-image: url('../assets/histoire/WAVEN.png'); }

/* Phrase d'ambiance au centre: elle suit la periode active sans devenir une vraie navigation. */
.period-voice {
  position: fixed;
  left: 50%;
  top: 49%;
  z-index: 3;
  width: min(860px, calc(100% - 2rem));
  text-align: center;
  opacity: 0.78;
  transform: translate(-50%, -50%);
  transition: opacity 0.35s ease;
}

.period-voice[data-period="intro"] {
  opacity: 0;
  visibility: hidden;
}

.period-voice span {
  display: block;
  color: rgba(232,201,122,0.78);
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.period-voice p {
  margin-top: 0.85rem;
  color: rgba(255,247,223,0.34);
  font-family: 'IM Fell English', 'Crimson Text', Georgia, serif;
  font-size: clamp(1.05rem, 2.35vw, 2rem);
  font-style: italic;
  line-height: 1.42;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 12px 34px rgba(0,0,0,0.9), 0 0 28px rgba(var(--history-energy-rgb), 0.16);
}

header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

/* Navigation reprise du reste du site pour que la section Histoire ne fasse pas a part. */
.site-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  padding: 0.9rem 1.5rem;
  background: rgba(7, 7, 12, 0.94);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: #f6f2e7;
  text-decoration: none;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand span { line-height: 1; }

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-item { position: relative; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.85rem;
  border: 0;
  background: transparent;
  color: #f3efe4;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:visited,
.nav-link:hover,
.nav-link:focus-visible,
.nav-link:active {
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active,
.nav-item:focus-within > .nav-link {
  color: var(--gold-light);
  background: rgba(201,168,76,0.08);
  outline: none;
}

.nav-caret {
  font-size: 0.8em;
  opacity: 0.8;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 240px;
  padding: 0.45rem;
  border: 1px solid rgba(201,168,76,0.16);
  background: rgba(12, 12, 18, 0.97);
  box-shadow: 0 16px 35px rgba(0,0,0,0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu-item {
  width: 100%;
  display: block;
  padding: 0.7rem 0.8rem;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-menu-item:hover,
.nav-menu-item:focus-visible {
  background: rgba(201,168,76,0.08);
  color: var(--gold-light);
  outline: none;
}

.history-index-main {
  position: relative;
  z-index: 5;
}

/* Le haut de page pose l'intention, mais laisse vite la place au fil interactif. */
.history-hero {
  min-height: clamp(460px, 68vh, 720px);
  width: min(1120px, calc(100% - 2rem));
  display: grid;
  align-content: center;
  justify-items: center;
  margin: 0 auto;
  padding: clamp(4.4rem, 10vw, 7rem) 0 clamp(2.2rem, 6vw, 4rem);
  text-align: center;
}

.history-eyebrow {
  color: var(--gold-light);
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

#history-title,
.history-hero h1 {
  max-width: 900px;
  margin-top: 0.7rem;
  color: #fff7df;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 14px 42px rgba(0,0,0,0.9), 0 0 26px rgba(201,168,76,0.18);
}

.history-hero p:not(.history-eyebrow) {
  width: min(720px, 100%);
  margin-top: 1.35rem;
  color: #f3ead8;
  font-size: clamp(1.08rem, 1.8vw, 1.34rem);
  font-style: italic;
  line-height: 1.7;
  text-shadow: 0 6px 24px rgba(0,0,0,0.92);
}

/* Zone longue volontairement: la ligne a besoin de respiration pour raconter les grandes périodes. */
.history-line-section {
  position: relative;
  width: min(1180px, calc(100% - 2rem));
  min-height: 440vh;
  margin: 0 auto;
  padding: 20vh 0 20vh;
}

.history-start-link {
  position: absolute;
  left: 50%;
  top: 4.5vh;
  z-index: 4;
  width: clamp(82px, 11vw, 138px);
  height: clamp(82px, 11vw, 138px);
  transform: translateX(-50%);
}

.history-start-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(46,207,176,0.42)) drop-shadow(0 0 28px rgba(224,40,210,0.24));
  animation: historyStartIconPulse 2.4s ease-in-out infinite;
}

.history-start-link .history-sparkle-preview {
  left: calc(100% + 0.7rem);
  top: 50%;
}

.history-start-link:hover .history-sparkle-preview,
.history-start-link:focus-visible .history-sparkle-preview {
  display: grid;
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

/* Le SVG est redessine par le JS selon la position reelle des périodes. */
.history-energy-line {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* La progression lumineuse avance avec le scroll grace a --history-line-progress. */
.history-line-glow,
.history-line-core,
.history-line-progress {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.history-line-glow {
  stroke: rgba(var(--history-energy-rgb), 0.42);
  stroke-width: 26;
  stroke-linecap: round;
  filter: blur(15px);
  opacity: 0.72;
}

.history-line-core {
  stroke: rgba(232,201,122,0.64);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 10 26;
  stroke-dashoffset: calc(var(--history-flow-shift) * -1);
}

.history-line-progress {
  stroke: rgba(var(--history-energy-rgb), 0.92);
  stroke-width: 4.6;
  stroke-linecap: round;
  stroke-dasharray: var(--history-line-progress) 1;
  filter: drop-shadow(0 0 14px rgba(var(--history-energy-rgb), 0.76));
}

.history-periods {
  position: relative;
  z-index: 1;
  min-height: 100%;
}

/* Chaque periode alterne gauche/droite pour donner une lecture en mouvement. */
.history-period {
  position: relative;
  min-height: 82vh;
}

.history-marker {
  position: absolute;
  left: var(--marker-x, var(--line-x));
  top: 50%;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(8,8,16,0.96);
  border-radius: 50%;
  background: rgb(var(--history-energy-rgb));
  box-shadow:
    0 0 0 1px rgba(232,201,122,0.5),
    0 0 20px rgba(var(--history-energy-rgb), 0.58);
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.history-period.active .history-marker {
  transform: translate(-50%, -50%) scale(1.25);
  box-shadow:
    0 0 0 1px rgba(255,247,223,0.72),
    0 0 26px rgba(var(--history-energy-rgb), 0.78),
    0 0 54px rgba(var(--history-energy-rgb), 0.32);
}

.history-period-link {
  position: absolute;
  top: 50%;
  display: grid;
  gap: 0.35rem;
  width: min(360px, 30vw);
  color: var(--text-main);
  text-decoration: none;
  text-shadow: 0 8px 28px rgba(0,0,0,0.92);
  transform: translateY(-50%);
}

.history-period-link::before {
  content: '';
  position: absolute;
  top: 1.25rem;
  width: clamp(40px, 6vw, 84px);
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(232,201,122,0.78), transparent);
}

.history-period-link-left {
  right: calc(100% - var(--line-x) + clamp(38px, 6vw, 84px));
  text-align: right;
}

.history-period-link-left::before {
  right: calc(clamp(40px, 6vw, 84px) * -1);
}

.history-period-link-right {
  left: calc(var(--line-x) + clamp(38px, 6vw, 84px));
  text-align: left;
}

.history-period-link-right::before {
  left: calc(clamp(40px, 6vw, 84px) * -1);
}

.history-period-count {
  color: rgba(232,201,122,0.74);
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.history-period-link strong {
  color: #fff7df;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: clamp(1.3rem, 3vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s ease, transform 0.2s ease;
}

.history-period-link span:last-child {
  color: rgba(232,224,208,0.78);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  font-style: italic;
  line-height: 1.45;
}

.history-period-link:hover,
.history-period-link:focus-visible {
  outline: none;
}

.history-period-link:hover strong,
.history-period-link:focus-visible strong {
  color: var(--gold-light);
}

/* Les petits jalons pointent vers la periode associee en attendant des pages dediees. */
.history-sparkle {
  position: absolute;
  left: var(--spark-x, var(--line-x));
  top: var(--spark-y);
  z-index: 4;
  width: 18px;
  height: 18px;
  color: var(--text-main);
  text-decoration: none;
  transform: translate(-50%, -50%);
}

.history-sparkle-dot {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff7df;
  box-shadow:
    0 0 8px rgba(255,247,223,0.9),
    0 0 18px rgba(var(--history-energy-rgb),0.74),
    0 0 34px rgba(var(--history-energy-rgb),0.36);
  animation: sparklePulse 1.9s ease-in-out infinite;
}

.history-sparkle-icon {
  width: 54px;
  height: 54px;
}

.history-sparkle-krosmoz-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 66px;
  height: 66px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 10px rgba(255,247,223,0.7))
    drop-shadow(0 0 18px rgba(224,40,210,0.48))
    drop-shadow(0 0 22px rgba(46,207,176,0.42));
  transform: translate(-50%, -50%);
  animation: krosmozIconPulse 2.4s ease-in-out infinite;
}

.history-sparkle-dot::before,
.history-sparkle-dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255,247,223,0.82);
  transform: translate(-50%, -50%);
}

.history-sparkle-dot::before {
  width: 2px;
  height: 18px;
}

.history-sparkle-dot::after {
  width: 18px;
  height: 2px;
}

.history-sparkle-preview {
  position: absolute;
  top: 50%;
  display: none;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  width: 320px;
  min-height: 92px;
  padding: 0.65rem;
  border: 1px solid rgba(232,201,122,0.24);
  border-radius: 6px;
  background: rgba(8,8,16,0.88);
  box-shadow: 0 18px 48px rgba(0,0,0,0.42);
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  transform: translateY(-50%) scale(0.96);
}

.history-sparkle-right .history-sparkle-preview {
  left: 2rem;
}

.history-sparkle-left .history-sparkle-preview {
  right: 2rem;
}

.history-sparkle:hover .history-sparkle-preview,
.history-sparkle:focus-visible .history-sparkle-preview {
  display: grid;
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

.history-sparkle-image {
  position: relative;
  min-height: 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(232,201,122,0.16), rgba(46,207,176,0.13)),
    rgba(255,255,255,0.04);
}

.history-sparkle-image span {
  color: rgba(255,247,223,0.86);
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.history-sparkle-copy {
  display: grid;
  align-content: center;
  gap: 0.25rem;
  min-width: 0;
}

.history-sparkle-copy strong {
  color: var(--gold-light);
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 0.72rem;
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-sparkle-copy span {
  color: rgba(246,242,231,0.72);
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-sparkle-copy em {
  color: rgba(232,224,208,0.76);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.25;
}

@keyframes sparklePulse {
  0%, 100% {
    opacity: 0.58;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@keyframes krosmozIconPulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 10px rgba(255,247,223,0.62))
      drop-shadow(0 0 18px rgba(224,40,210,0.42))
      drop-shadow(0 0 22px rgba(46,207,176,0.36));
    transform: translate(-50%, -50%) scale(0.94);
  }
  50% {
    filter:
      drop-shadow(0 0 14px rgba(255,247,223,0.88))
      drop-shadow(0 0 28px rgba(224,40,210,0.58))
      drop-shadow(0 0 32px rgba(46,207,176,0.54));
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@keyframes historyStartIconPulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 16px rgba(255,247,223,0.58))
      drop-shadow(0 0 22px rgba(224,40,210,0.38))
      drop-shadow(0 0 28px rgba(46,207,176,0.34));
    transform: scale(0.94);
  }
  50% {
    filter:
      drop-shadow(0 0 22px rgba(255,247,223,0.78))
      drop-shadow(0 0 34px rgba(224,40,210,0.54))
      drop-shadow(0 0 38px rgba(46,207,176,0.5));
    transform: scale(1.04);
  }
}

/* La section reste lisible sur mobile: on simplifie la ligne avant de reduire le contenu. */
@media (max-width: 900px) {
  .site-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .history-line-section {
    width: min(100% - 1rem, 620px);
    min-height: auto;
    padding: 8vh 0 12vh;
  }

  .history-period {
    min-height: 76vh;
  }

  .history-period-link {
    width: min(270px, 62vw);
  }

  .history-period-link-left,
  .history-period-link-right {
    left: auto;
    right: auto;
    text-align: left;
  }

  .history-period-link-left {
    right: calc(100% - var(--line-x) + 46px);
  }

  .history-period-link-right {
    left: calc(var(--line-x) + 46px);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }

  .top-nav {
    width: 100%;
    gap: 0.15rem;
  }

  .nav-link {
    padding: 0.55rem 0.65rem;
    font-size: 0.68rem;
  }

  .history-hero {
    min-height: 66vh;
    width: min(100% - 1rem, 560px);
  }

  .period-voice {
    top: 53%;
    opacity: 0.68;
  }

  .period-voice p {
    font-size: clamp(0.9rem, 4.8vw, 1.35rem);
    letter-spacing: 0.14em;
    line-height: 1.48;
  }

  .history-period {
    min-height: 68vh;
  }

  .history-sparkle-left .history-sparkle-preview,
  .history-sparkle-right .history-sparkle-preview {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: 58%;
    width: auto;
    grid-template-columns: minmax(0, 1fr);
    transform: translateY(-50%) scale(0.96);
  }

  .history-period-link {
    width: min(180px, 40vw);
  }

  .history-period-link::before {
    width: 38px;
  }

  .history-period-link-left {
    left: auto;
    right: calc(100% - var(--line-x) + 34px);
    text-align: right;
  }

  .history-period-link-left::before {
    left: auto;
    right: -38px;
  }

  .history-period-link-right {
    left: calc(var(--line-x) + 34px);
  }

  .history-period-link-right::before {
    left: -38px;
  }
}

.back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 60;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(232,201,122,0.54);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(232,201,122,0.16), rgba(8,8,16,0.9) 42%, rgba(46,207,176,0.12)),
    rgba(8,8,16,0.86);
  color: var(--gold-light);
  font-size: 1.3rem;
  line-height: 1;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 16px 42px rgba(0,0,0,0.42), 0 0 20px rgba(201,168,76,0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  border-color: rgba(232,201,122,0.78);
  background:
    linear-gradient(135deg, rgba(232,201,122,0.28), rgba(16,16,24,0.94) 42%, rgba(46,207,176,0.18)),
    rgba(16,16,24,0.94);
  outline: none;
}

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

.back-to-top {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(232,201,122,0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(46,207,176,0.14), transparent 38%),
    radial-gradient(circle at 36% 28%, rgba(255,247,223,0.16), transparent 30%),
    linear-gradient(145deg, rgba(18,18,30,0.98), rgba(6,6,12,0.96) 66%);
  color: var(--gold-light);
  font-size: 0;
  clip-path: none;
  box-shadow:
    0 18px 42px rgba(0,0,0,0.56),
    inset 0 0 0 4px rgba(8,8,16,0.78),
    0 0 0 1px rgba(255,247,223,0.08),
    0 0 28px rgba(46,207,176,0.12);
  transition: opacity 0.22s ease, transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease, color 0.22s ease;
}

.back-to-top span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  color: transparent;
}

.back-to-top::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 28px;
  background: currentColor;
  clip-path: polygon(12% 0, 100% 50%, 12% 100%);
  transform: translate(-50%, -54%) rotate(-90deg);
  filter: drop-shadow(0 0 6px rgba(232,201,122,0.34));
}

.back-to-top:hover,
.back-to-top:focus-visible {
  border-color: rgba(255,239,178,0.92);
  background:
    radial-gradient(circle at 50% 50%, rgba(46,207,176,0.2), transparent 42%),
    radial-gradient(circle at 36% 28%, rgba(255,247,223,0.22), transparent 32%),
    linear-gradient(145deg, rgba(30,26,32,0.98), rgba(9,9,16,0.98) 66%);
  color: #fff7df;
  box-shadow:
    0 22px 50px rgba(0,0,0,0.64),
    inset 0 0 0 4px rgba(8,8,16,0.7),
    inset 0 0 0 6px rgba(232,201,122,0.56),
    0 0 0 1px rgba(255,247,223,0.14),
    0 0 30px rgba(201,168,76,0.2),
    0 0 38px rgba(46,207,176,0.14);
  transform: translateY(0) scale(1.1);
}

/* Place le lien Contactez-nous a droite de la navigation principale. */
.top-nav { flex: 1; }
.top-nav > a[href$="contact.html"],
.top-nav > a[href$="contact-html/contact.html"] { margin-left: auto; }

/* mobile-nav:start */
.mobile-nav-toggle {
  display: none;
}

@media (max-width: 720px) {
  .site-topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center !important;
    gap: 0.55rem !important;
    padding: 0.55rem 0.85rem !important;
  }

  .brand {
    min-width: 0;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .brand span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.46rem;
    min-height: 36px;
    padding: 0.46rem 0.68rem;
    border: 1px solid rgba(201, 168, 76, 0.34);
    border-radius: 3px;
    background: rgba(12, 10, 8, 0.72);
    color: #f3df9b;
    font: inherit;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(255, 247, 223, 0.05), 0 8px 22px rgba(0, 0, 0, 0.24);
    cursor: pointer;
  }

  .mobile-nav-icon,
  .mobile-nav-icon::before,
  .mobile-nav-icon::after {
    display: block;
    width: 16px;
    height: 1px;
    background: currentColor;
    content: "";
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .mobile-nav-icon {
    position: relative;
  }

  .mobile-nav-icon::before,
  .mobile-nav-icon::after {
    position: absolute;
    left: 0;
  }

  .mobile-nav-icon::before {
    top: -5px;
  }

  .mobile-nav-icon::after {
    top: 5px;
  }

  .site-topbar.is-mobile-nav-open .mobile-nav-icon {
    background: transparent;
  }

  .site-topbar.is-mobile-nav-open .mobile-nav-icon::before {
    transform: translateY(5px) rotate(45deg);
  }

  .site-topbar.is-mobile-nav-open .mobile-nav-icon::after {
    transform: translateY(-5px) rotate(-45deg);
  }

  .top-nav {
    grid-column: 1 / -1;
    width: 100% !important;
    max-height: 0;
    display: grid !important;
    gap: 0.26rem !important;
    flex: unset !important;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.24s ease, opacity 0.2s ease, padding-top 0.2s ease;
  }

  .site-topbar.is-mobile-nav-open .top-nav {
    max-height: 72vh;
    padding-top: 0.34rem;
    opacity: 1;
  }

  .top-nav .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 0.62rem 0.72rem;
    font-size: 0.68rem;
  }

  .top-nav > a[href$="contact.html"],
  .top-nav > a[href$="contact-html/contact.html"] {
    margin-left: 0 !important;
  }

  .nav-item,
  .nav-dropdown {
    width: 100%;
  }

  .nav-menu {
    position: static !important;
    display: none;
    width: 100%;
    min-width: 0 !important;
    margin: 0.2rem 0 0;
    padding: 0.25rem;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none;
  }

  .nav-dropdown:focus-within .nav-menu,
  .nav-dropdown:hover .nav-menu {
    display: grid;
  }

  .site-topbar > .krosmoz-top-social-links,
  .site-topbar > .krosmoz-header-contact {
    display: none !important;
    grid-column: 1 / -1;
  }

  .site-topbar.is-mobile-nav-open > .krosmoz-top-social-links {
    display: inline-flex !important;
    justify-self: end;
    margin-left: 0;
    padding-top: 0.15rem;
  }

  .site-topbar.is-mobile-nav-open > .krosmoz-header-contact {
    display: inline-flex !important;
    width: 100%;
    justify-content: center;
    margin-left: 0 !important;
  }
}
/* mobile-nav:end */

/* mobile-menu-icon:start */
@media (max-width: 720px) {
  .mobile-nav-icon,
  .mobile-nav-icon::before,
  .mobile-nav-icon::after {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform: none !important;
    opacity: 1;
  }

  .mobile-nav-icon::before {
    top: -6px;
  }

  .mobile-nav-icon::after {
    top: 6px;
  }

  .site-topbar.is-mobile-nav-open .mobile-nav-icon {
    background: currentColor;
  }
}
/* mobile-menu-icon:end */
