/* =========================================================
   KAKURII — Styles principaux (mobile first)
   ========================================================= */

/* 1. Polices */
@font-face {
  font-family: "Knewave";
  src: url("../fonts/Knewave-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Tovari";
  src: url("../fonts/TovariSans.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/NunitoSans-Regular.ttf") format("truetype");
  font-display: swap;
}

/* 2. Variables et styles généraux */
:root {
  color-scheme: dark;
  --night: #1e1553;
  --cream: #fffdef;
  --violet: #772faf;
  --acid: #fffb95;
  --green: #36e983;
  --kakurii-logo-width: min(330px, 76vw);
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: clip; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: clip;
  background: var(--night);
  color: var(--cream);
  font-family: "Tovari", sans-serif;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4, h5, h6, .brand-fallback {
  font-family: "Knewave", cursive;
  font-weight: normal;
}
button, input, textarea, select { font-family: "Nunito Sans", sans-serif; }

/* 3. Fond d'yeux animé */
.eyes-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.eye {
  position: absolute;
  display: block;
  width: 80px;
  height: auto;
  transform: translate(-50%, -50%) rotate(var(--rotation)) scale(var(--flip-x), var(--flip-y));
  transform-origin: center;
}
.eye.is-blinking { animation: eye-blink 180ms ease-in-out; }
@keyframes eye-blink {
  0%, 100% { scale: 1 1; }
  50% { scale: 1 0; }
}
.content { position: relative; z-index: 1; flex: 1; min-height: 0; }

/* 4. Header et logo — mobile first */
.site-header {
  position: relative;
  z-index: 110;
  width: 100%;
  padding: 36px 18px 0;
}
.header-top {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 86px;
  max-width: 1320px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  text-decoration: none;
}
.brand img {
  display: block;
  width: var(--kakurii-logo-width);
  max-height: 130px;
  object-fit: contain;
}
.brand-fallback {
  font-size: clamp(32px, 8vw, 58px);
  letter-spacing: -.06em;
  transform: rotate(-3deg);
}

.header-kakurii { display: none; } /* Un seul Kakurii en haut : dans le menu sur mobile. */

/* 5. Réseaux : rose de la charte, pictogrammes bleu nuit */
.socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.socials-desktop { display: none; }
.socials-mobile { margin-top: 0; }
.social-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: #772faf;
  color: var(--cream);
  text-decoration: none;
  transition: background .2s, color .2s, transform .2s;
}
.social-circle svg { width: 25px; height: 25px; fill: currentColor; }
.social-circle:hover, .social-circle:focus-visible {
  background: var(--green);
  color: var(--night);
  transform: scale(1.08) rotate(-7deg);
}
.social-circle.language {
  width: auto;
  padding: 0 5px;
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  font: 800 19px/1 "Nunito Sans", sans-serif;
}
.social-circle.language:hover, .social-circle.language:focus-visible {
  background: transparent;
  color: var(--green);
  transform: none;
}

/* 6. Navigation — mobile first : barre sticky et panneau dans le flux */
.navigation-shell {
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
  height: 0;
  order: -1;
}
.mobile-nav-bar {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 66px;
  padding: 8px 16px;
  /* transparent lorsque le menu est fermé */
  animation: burger-arrival .4s ease-out both;
}
.menu-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 50px;
  height: 50px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: #772faf;
  cursor: pointer;
  transition: transform .25s ease, background .2s;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  border-radius: 3px;
  background: var(--cream);
  transition: transform .2s, opacity .2s;
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(8px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-8px) rotate(-45deg); }
.header-nav {
  position: relative;
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  background-color: transparent; /* Le PNG du menu conserve sa transparence. */
  padding-top: 0;
  visibility: hidden;
  border: 0;
  box-shadow: none;
  overflow: hidden;
  transition: grid-template-rows .5s ease, visibility .5s;
}
@keyframes burger-arrival { from { transform: translateY(-24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
/* Le panneau se déroule et pousse le contenu situé dessous. */
.navigation-shell.menu-open { height: auto; }
.header-nav.is-open {
  grid-template-rows: 1fr;
  padding-top: 66px;
  visibility: visible;
}
/* Un conteneur unique pour animer la hauteur sans perdre le logo et les réseaux */
.menu-inner { min-height: 0; overflow: hidden; position: relative; }
.menu-brand { display: block; width: var(--kakurii-logo-width); margin: 0 auto 10px; }
@media (max-width: 980px) {
  /* Le logo commence immédiatement sous le bouton, sans marge haute superflue. */
  .header-nav.is-open { padding-top: 0; }
  /* Compense exactement la hauteur perdue par le logo principal replié.
     La variable est mesurée en JS, sans valeur fixe de 240px. */
  .header-nav.is-open .menu-inner { padding-bottom: 48px; }
  .menu-inner { padding-top: 18px; padding-bottom: 48px; }
  .menu-brand { display: block; width: min(370px, calc(100vw - 140px)); margin-top: 0; margin-bottom: 10px; }
  .main-menu { gap: 0; align-items: center; justify-content: center; }
  .main-menu a { padding-block: 3px; font: normal 40px/1.1 "Knewave", cursive; }
  /* Les contrôles restent au-dessus du logo. */
  .mobile-nav-bar { pointer-events: none; }
  .menu-toggle { pointer-events: auto; }
}
/* Masque le logo de l’en-tête pendant l’ouverture : jamais deux logos visibles. */
/* Le header conserve sa hauteur quand le burger s’ouvre : pas de saut de page. */
.menu-brand img { display: block; width: 100%; height: auto; }
.main-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}
.main-menu a {
  padding: 14px 5px;
  color: var(--acid);
  font: normal 20px/1.3 "Knewave", cursive;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .2s, transform .25s cubic-bezier(.2,1.5,.5,1), text-shadow .2s;
  display: inline-block;
  transform-origin: 50% 50%;
  transform-box: border-box;
  width: max-content;
}
.main-menu a:hover, .main-menu a:focus-visible {
  color: var(--green);
  transform: translateY(-2px) rotate(-1.5deg);
  text-shadow: 1px 2px 0 #fffdef;
}
.socials-mobile { position: relative; z-index: 1; justify-content: center; margin-top: 24px; padding: 6px 0 14px; }
.menu-kakurii {
  position: absolute;
  right: -38px;
  bottom: 5px;
  width: clamp(160px, 43vw, 270px);
  max-height: 55%;
  object-fit: contain;
  object-position: right bottom;
  z-index: 0;
  height: auto;
  pointer-events: none;
  transform: translateX(130%) rotate(18deg);
  transition: transform .55s cubic-bezier(.2,1.35,.4,1);
}
.header-nav.is-open .menu-kakurii { transform: translateX(0) rotate(-7deg); transition-delay: .14s; }

/* Fond illustré du panneau mobile : une tuile de 1934px glisse à droite. */
@keyframes header-bg-scroll { from { background-position-x: 0; } to { background-position-x: 1934px; } }
@keyframes footer-bg-scroll { from { background-position-x: 0; } to { background-position-x: -378px; } }
@media (max-width: 980px) {
  /* PNG transparent sur un calque indépendant : pas de fond opaque ni de liseré. */
  .header-nav { background: transparent; width: 100%; max-width: none; border-radius: 0; }
  .header-nav::before {
    content: "";
    position: absolute;
    inset: 0 -100px -1px; /* Débordement de 1px sous le panneau, sans répétition verticale. */
    z-index: 0;
    pointer-events: none;
    background: url("../img/header-bg.png") repeat-x left bottom;
    animation: header-bg-scroll 90s linear infinite;
    transform: translateX(-70px);
    transition: transform .5s ease-out;
  }
  .header-nav.is-open::before { transform: translateX(0); }
  .header-nav .menu-inner { z-index: 1; }
  .header-nav, .header-nav .menu-inner { border-bottom: 0; box-shadow: none; }

}


/* Ajustements petits mobiles */
@media (max-width: 430px) {
  .site-header { padding-inline: 14px; }
  :root { --kakurii-logo-width: min(290px, 73vw); }
}

/* Desktop : motif initial sous les réseaux, puis motif fixe lorsque le menu colle */
@media (min-width: 981px) {
  .site-header { padding: 24px 24px 0; isolation: isolate; z-index: 210; }
  /* Motif de départ : dans le flux de la page, sous les réseaux sociaux.
     Il disparaît naturellement dès que la page défile. */
  .site-header::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    pointer-events: none;
    background: url("../img/menu-sticky-bg.png") repeat-x left bottom;
    background-size: 1500px auto;
    animation: sticky-menu-bg-scroll 180s linear infinite;
  }
  .header-top { min-height: 114px; }
  :root { --kakurii-logo-width: min(380px, 60vw); }
  .brand img { max-height: 170px; transform: translateY(10px); }
  .brand:hover img, .brand:focus-visible img { transform: translateY(10px) rotate(-1deg) scale(1.02); }
  .brand-fallback { font-size: clamp(38px, 6vw, 78px); }
  .socials-desktop {
    position: fixed;
    right: 24px;
    top: 5px;
    z-index: 250;
    display: flex;
  }
  .main-menu a { font-size: 27px; }
  .mobile-nav-bar, .socials-mobile, .menu-brand, .menu-kakurii { display: none; }
  .navigation-shell { isolation: isolate; order: 0; height: auto; }
  .navigation-shell.menu-open { height: auto; }
  .header-nav, .header-nav.is-open {
    display: block;
    visibility: visible;
    opacity: 1;
    background: transparent;
    transition: none;
  }
  /* Fond sticky : complètement masqué avant l'accrochage.
     Il descend depuis le bord supérieur, sans fondu d'opacité. */
  .header-nav::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    z-index: -1;
    pointer-events: none;
    background: url("../img/menu-sticky-bg.png") repeat-x left bottom;
    background-size: 1500px auto;
    transform: translateY(-100%);
    transition: transform .16s ease-in;
    animation: sticky-menu-bg-scroll 180s linear infinite;
  }
  /* Logo du menu sticky sur desktop, indépendant du logo principal. */
  .navigation-shell .menu-brand { display: none; }
  .navigation-shell.is-stuck .menu-brand {
    display: block;
    position: fixed;
    top: 5px;
    left: 24px;
    width: 150px;
    margin: 0;
    z-index: 2;
  }
  .navigation-shell.is-stuck .menu-brand img { width: 100%; height: auto; }
  .navigation-shell.is-stuck .header-nav::before {
    transform: translateY(0);
    transition: transform .2s ease-out;
  }
  @keyframes sticky-menu-bg-scroll {
    from { background-position-x: 0; }
    to { background-position-x: 1500px; }
  }
  .menu-inner { overflow: visible; }
  .main-menu { flex-direction: row; justify-content: center; gap: clamp(28px, 5vw, 86px); }
  .main-menu a:hover, .main-menu a:focus-visible { transform: translateY(-2px) rotate(-1.5deg); }
}

/* Accessibilité : réduire les animations si demandé */
@media (prefers-reduced-motion: reduce) {
  .eye.is-blinking { animation: none; }
  .menu-toggle span, .social-circle, .main-menu a { transition: none; }
  .mobile-nav-bar { animation: none; }
  .header-nav, .header-nav::before, .menu-kakurii { transition: none !important; }
  .header-nav, .site-footer, .navigation-shell.is-stuck .header-nav::before { animation: none !important; }
}



/* 9. Typographie éditoriale — commune à TOUTES les pages */
h1, h2, h3, h4, h5, h6 {
  font-family: "Knewave", cursive;
  font-weight: normal;
  line-height: 1.2;
}
h1 {
  margin: 0 0 36px;
  font-size: clamp(36px, 7vw, 64px);
  color: #ff4381;
  text-shadow: 1px 2px 0 #fffb95;
  text-transform: uppercase;
}
h2 {
  text-shadow: 1px 2px 0 #ff4381;
  margin: 64px 0 24px;
  font-size: clamp(26px, 5vw, 40px);
  color: #fffb95;
  text-transform: uppercase;
}
p {
  margin: 0 0 24px;
  font-family: "Tovari", sans-serif;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.05;
}

/* 10. Mise en page propre à la page de démonstration */
.test-content {
  width: min(calc(100% - 40px), 760px);
  margin: 55px auto 40px;
}
@media (min-width: 981px) {
  h1 { text-shadow: 2px 4px 0 #fffb95; }
  .test-content { width: min(calc(100% - 64px), 980px); margin-block: 90px 50px; }
}

/* 11. Footer — personnage masqué en bas, visible au-dessus */
.site-footer {
  position: relative;
  z-index: 1;
  isolation: isolate;
  flex-shrink: 0;
  margin-top: auto;
  padding: 25px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  /* Le masque du personnage gère seul son débordement. */
  overflow: visible;
  background: url("../img/footer-bg.png") repeat-x center top;
  animation: footer-bg-scroll 24s linear infinite;
}
.footer-credit { position: relative; z-index: 2; display: block; line-height: 0; }
.footer-credit img {
  display: block;
  width: 180px;
  height: auto;
  transition: transform .3s cubic-bezier(.2,1.5,.5,1);
}
.footer-credit:hover img { transform: rotate(-1deg) scale(1.02); }
.footer-links {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.footer-links a {
  color: var(--acid);
  font: 17px/1.25 "Tovari", sans-serif;
  text-decoration: none;
  transition: color .2s, transform .2s;
}
.footer-links a:hover, .footer-links a:focus-visible {
  color: var(--green);
  transform: translateY(-2px);
}
/* Masque du personnage : coupe strictement le débordement sous le footer. */
.footer-kakurii-mask {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: -260px;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}
.footer-kakurii {
  position: absolute;
  right: -32px;
  bottom: 10px;
  width: clamp(140px, 38vw, 215px);
  height: auto;
  transform-origin: center center;
  transform: rotate(7deg);
  animation: footer-kakurii-idle 5.5s ease-in-out infinite;
}
@media (max-width: 980px) {
  .footer-kakurii { right: -10%; bottom: 20px; }
}
/* Espace avant le footer pour que le décor n'empiète pas sur le contenu. */
.content { padding-bottom: 115px; }
@media (min-width: 981px) {
  .site-footer { padding-top: 22px; }
  .footer-credit img { width: 225px; }
  .footer-kakurii {
    width: clamp(270px, 25vw, 360px);
    right: max(40px, calc((100vw - 1140px) / 2));
    bottom: -48px;
  }
  .content { padding-bottom: 145px; }
}
/* Légère respiration du personnage, sans animation de survol. */
@keyframes footer-kakurii-idle {
  0%, 100% { transform: translateY(0) rotate(7deg); }
  50% { transform: translateY(-9px) rotate(4deg); }
}
/* 12. Animations et interactions globales */
a { transition: color .2s ease, transform .25s ease; }
a:not(.social-circle):hover, a:not(.social-circle):focus-visible { color: var(--green); }
.header-brand-group { display: flex; align-items: center; justify-content: center; }
.brand img { transition: transform .35s cubic-bezier(.2,1.5,.5,1); }
.brand:hover img, .brand:focus-visible img { transform: rotate(-1deg) scale(1.02); }
.menu-brand img { transition: transform .35s cubic-bezier(.2,1.5,.5,1); }
.menu-brand:hover img { transform: rotate(2deg) scale(1.02); }
.main-menu a { transition: color .2s, transform .25s cubic-bezier(.2,1.5,.5,1); }
html, body, .content { overflow-anchor: none; }

@media (prefers-reduced-motion: reduce) {
  .brand img, .menu-brand img, .footer-credit img, .footer-kakurii, a { transition: none !important; }
  .footer-kakurii { animation: none !important; }
}


@media (min-width: 981px) {
  .brand:hover img, .brand:focus-visible img { transform: translateY(10px) rotate(-1deg) scale(1.02); }
}

/* Mobile : fondu croisé court entre les deux logos, sans mouvement
   ni modification de la hauteur du header. */
@media (max-width: 980px) {
  .site-header .brand {
    opacity: 1;
    visibility: visible;
    transition: opacity .18s ease, visibility 0s linear .18s;
  }
  body:has(.navigation-shell.menu-open) .site-header .brand {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .menu-brand {
    opacity: 0;
    transform: none;
    transition: opacity .22s ease;
  }
  .header-nav.is-open .menu-brand {
    opacity: 1;
    transition-delay: .14s;
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header .brand, .menu-brand { transition: none !important; }
}

/* Mobile : menu et en-tête partagent la même transition de hauteur.
   Le panneau se replie dans le flux, sans saut du contenu. */
@media (max-width: 980px) {
  .navigation-shell,
  .navigation-shell.menu-open {
    height: auto;
  }
  .site-header {
    max-height: 240px;
    overflow: hidden;
    transition: max-height .5s ease, padding-top .5s ease;
  }
  /* Replie le volume occupé par le logo en synchronisation avec le panneau. */
  body:has(.navigation-shell.menu-open) .site-header {
    height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
  }
  .header-nav {
    transition: grid-template-rows .5s ease, visibility .5s;
  }
  /* Le logo principal quitte le flux avec l'en-tête ; le menu prend sa place. */
  .site-header .brand {
    transition: opacity .18s ease, visibility 0s linear .18s;
  }
}
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none !important; }
}

/* Mobile : taille du logo retrouvee, centree dans la fenetre.
   La largeur ne diminue que si le bouton burger risquerait de le chevaucher. */
@media (max-width: 980px) {
  .site-header { padding: 15px 12px 7px; }
  .header-top { min-height: 0; margin: 0 auto; }
  .site-header .brand { width: min(330px, calc(100vw - 120px)); max-width: 100%; margin: 0 auto; }
  .site-header .brand img { width: 100%; max-height: none; height: auto; }
}

/* Mobile : le logo quitte réellement le flux pendant le déploiement.
   Hauteur de départ mesurée en JS : aucune valeur arbitraire à compenser. */
@media (max-width: 980px) {
  .site-header {
    transition: height .5s ease, padding-top .5s ease, padding-bottom .5s ease;
  }
}

/* Mobile : garder le panneau visible pendant toute la fermeture (pas de palier). */
@media (max-width: 980px) {
  .header-nav { transition: grid-template-rows .5s ease, visibility 0s linear .5s; }
  .header-nav.is-open { transition: grid-template-rows .5s ease, visibility 0s; }
}

/* Fermeture mobile continue : une seule horloge CSS pour le header et le panneau.
   Pas de changement de height inline ni de visibilité qui coupe la transition. */
@media (max-width: 980px) {
  .site-header {
    box-sizing: border-box;
    height: var(--mobile-header-height, auto);
    min-height: 0;
    max-height: none;
    overflow: hidden;
    transition: height .5s ease !important;
  }
  body:has(.navigation-shell.menu-open) .site-header {
    height: 0 !important;
    padding-top: 15px;
    padding-bottom: 7px;
  }
  .header-nav,
  .header-nav.is-open {
    visibility: visible;
    transition: grid-template-rows .5s ease !important;
  }
  .header-nav:not(.is-open) {
    pointer-events: none;
    grid-template-rows: 0fr;
  }
  .header-nav.is-open {
    pointer-events: auto;
    grid-template-rows: 1fr;
  }
  .menu-inner { min-height: 0; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header, .header-nav { transition: none !important; }
}

/* Mobile : panneau qui descend depuis le haut et se replie sans saut.
   On anime 0fr -> 1fr (et non minmax), tout en conservant le contenu
   dans une ligne de grille dont la hauteur peut réellement atteindre 0. */
@media (max-width: 980px) {
  .header-nav,
  .header-nav:not(.is-open) {
    display: grid;
    grid-template-rows: 0fr;
    visibility: visible;
    opacity: 1;
    overflow: hidden;
    padding: 0;
    pointer-events: none;
    transition: grid-template-rows .5s ease !important;
  }
  .header-nav.is-open {
    grid-template-rows: 1fr;
    visibility: visible;
    pointer-events: auto;
  }
  .header-nav > .menu-inner {
    min-height: 0;
    overflow: hidden;
    padding: 0 !important;
  }
  .header-nav .menu-content { padding: 18px 0 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .header-nav { transition: none !important; }
}

/* Ajustements : bandeau fin non fixe sur mobile, logo et footer tablette. */
@media (max-width: 980px) {
  /* Même motif que le bandeau initial desktop, défile avec la page. */
  body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 15px;
    z-index: 190;
    pointer-events: none;
    background: url("../img/menu-sticky-bg.png") repeat-x left bottom;
    background-size: 1500px auto;
    animation: sticky-mobile-bg-scroll 180s linear infinite;
  }
}
@media (min-width: 700px) and (max-width: 980px) {
  /* À ~950px, éviter que le Kakurii soit presque hors champ. */
  .footer-kakurii { right: -3%; }
}
@keyframes sticky-mobile-bg-scroll {
  from { background-position-x: 0; }
  to { background-position-x: 3000px; }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

/* Choix utilisateur : menu mobile */
@media (max-width: 980px) { .main-menu a { font-size: 30px; padding: 10px 5px; } }

/* Bouton réutilisable sur toutes les pages */
.button, button.button, input.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 45px;
  padding: 2px 16px;
  border: 0;
  border-radius: 14px;
  background: #ff4381;
  color: #fffb95;
  box-shadow: 0 0 0 transparent;
  font: normal 20px/1.15 "Knewave", cursive;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transform: rotate(0deg) translateY(0);
  transform-origin: 50% 50%;
  transform-box: border-box;
  text-transform: uppercase;
  transition: transform .25s cubic-bezier(.2,1.5,.5,1), background .2s ease, box-shadow .2s ease, color .2s ease;
}
.button:hover, .button:focus-visible, button.button:hover, button.button:focus-visible, input.button:hover, input.button:focus-visible {
  background: #36e983;
  color: #fffb95 !important;
  box-shadow: 5px 6px 0 #772faf, -3px -3px 0 #fffb95;
  transform: translateY(-3px) rotate(-2deg);
}
.button:focus-visible, .hero-controls button:focus-visible { outline: 3px solid #fffb95; outline-offset: 4px; }


/* Un peu plus d'air après la navigation desktop. */
@media (min-width: 981px) {
  .navigation-shell { margin-bottom: 20px; }
}

/* Logo mobile plus compact et header moins haut, sans empiéter sur le burger. */
@media (max-width: 980px) {
  .site-header,
  body:has(.navigation-shell.menu-open) .site-header { padding-top: 35px; }
  .site-header .brand { width: min(230px, calc(100vw - 120px)); }
  .site-header .brand img { width: 100%; }
  .main-menu a { font-size: 30px; padding: 10px 5px; }
}

/* Sur grands écrans, préserver le contenu de la silhouette Kakurii du footer. */


/* Burger : violet fermé, rose ouvert. */
@media (max-width: 980px) { .menu-toggle[aria-expanded="true"] { background: #ff4381; } }

/* Espacement global du contenu avant le footer sur grands écrans. */
@media (min-width: 1301px) { main.content, .content { padding-bottom: 150px; } }

/* Langue sous le burger : visible uniquement tout en haut de la page mobile. */
@media (max-width: 999px) {
  .mobile-nav-bar { flex-direction: column; justify-content: flex-start; gap: 4px; height: auto; align-items: center; }
  .mobile-burger-en { display: block; color: #772faf; font: 800 17px/1 "Nunito Sans", sans-serif; text-decoration: none; transition: opacity .2s, color .2s; }
  .mobile-burger-en:hover, .mobile-burger-en:focus-visible { color: #36e983; }
  body.has-scrolled .mobile-burger-en { opacity: 0; pointer-events: none; }
}
@media (min-width: 1000px) { .mobile-burger-en { display: none; } }

/* Lien EN : légèrement plus bas sous le burger sur mobile. */
@media (max-width: 999px) { .mobile-burger-en { margin-top: 9px; } }

/* Mobile : le lien EN reste au-dessus des couches du header et cliquable. */
@media (max-width: 999px) {
  .mobile-nav-bar { z-index: 210; overflow: visible; }
  .mobile-burger-en {
    position: relative;
    z-index: 211;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 28px;
    pointer-events: auto;
    cursor: pointer;
  }
  body.has-scrolled .mobile-burger-en { pointer-events: none; }
  .button { font-size: 16px; min-height: 39px; padding: 2px 12px; }
}

/* Navigation : page courante. */
.main-menu a.is-active, .main-menu a[aria-current="page"] { color: #36e983; }
/* Titre accessible et indexable, sans affichage visuel. */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* Masquer le lien EN sous le burger pendant l’ouverture du menu mobile. */
@media (max-width: 999px) {
  body.menu-open .mobile-burger-en { visibility: hidden; pointer-events: none; }
}

/* Flèche commune aux boutons du site. */
.button { gap: 12px; }
.button .button-arrow { display: inline-block; width: 8px; height: 8px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); flex: none; }

/* Typographie globale : rythme plus compact et listes assorties aux paragraphes. */
p { margin-bottom:10px; }
ul { font-family:"Tovari",sans-serif; font-size:clamp(19px,2vw,23px); line-height:1.05; }

/* Menu principal : tirets arrondis comme les catégories Goodies. */
.main-menu a { position:relative; }
.main-menu a .kakurii-menu-dashes {
  position:absolute;left:50%;bottom:0;transform:translateX(-50%);
  display:block;height:5px;max-width:none;overflow:visible;pointer-events:none;
  color:currentColor;
}
.main-menu a:not(.is-active):not([aria-current="page"]) .kakurii-menu-dashes {display:none;}
.main-menu a:is(:hover,:focus-visible) {
  text-shadow: 1.5px 3px 0 #772faf, -3px -1.5px 0 #fffb95;
}

/* La rubrique active conserve l’inclinaison et les deux ombres du survol. */
.main-menu a:is(.is-active, [aria-current="page"]) {
  transform: translateY(-2px) rotate(-1.5deg);
  text-shadow: 1.5px 3px 0 #772faf, -3px -1.5px 0 #fffb95;
}

/* Menu desktop collant : aucun pointillé sur la rubrique active. */
@media (min-width: 981px) {
  .navigation-shell.is-stuck .main-menu .kakurii-menu-dashes { display:none!important; }
}

/* Barre d’administration WordPress : décaler uniquement l’interface des utilisateurs connectés.
   Sous 783px, WordPress laisse la barre admin défiler avec la page. */
@media (min-width: 783px) {
  body.admin-bar .navigation-shell { top: 32px; }
}
@media (min-width: 981px) {
  body.admin-bar .header-nav::before { top: 32px; }
  body.admin-bar .navigation-shell.is-stuck .menu-brand { top: 37px; }
  body.admin-bar .socials-desktop { top: 37px; }
}

/* Réseaux desktop : dans le header au départ, fixes uniquement lorsque le menu sticky apparaît. */
@media (min-width: 981px) {
  .site-header { position: relative; }
  .socials-desktop { position: absolute; top: 5px; right: 24px; }
  body:has(.navigation-shell.is-stuck) .socials-desktop { position: fixed; top: 5px; right: 24px; }
  body.admin-bar .socials-desktop { top: 5px; }
  body.admin-bar:has(.navigation-shell.is-stuck) .socials-desktop { top: 37px; }
}

/* Desktop : aligner les réseaux sur le bord droit du viewport,
   même si leur parent .header-top est limité à 1320px. */
@media (min-width: 981px) {
  .site-header .header-top > .socials-desktop {
    right: calc(24px - max(0px, (100vw - 1320px) / 2));
  }
  body:has(.navigation-shell.is-stuck) .site-header .header-top > .socials-desktop {
    right: 24px;
  }
}

/* Position initiale : compenser les 36px de padding du header. */
@media (min-width: 981px) {
  .site-header .header-top > .socials-desktop { top: -15px; }
  body.admin-bar .site-header .header-top > .socials-desktop { top: -15px; }
  body:has(.navigation-shell.is-stuck) .site-header .header-top > .socials-desktop { top: 5px; }
  body.admin-bar:has(.navigation-shell.is-stuck) .site-header .header-top > .socials-desktop { top: 37px; }
}

/* Titres H1 généraux : ombre rose, hors titres du hero. */
h1:not(.hero-copy h1):not(.kakurii-standard-page h1) { text-shadow: 1px 2px 0 #ff4381; }
@media (min-width: 981px) {
  h1:not(.hero-copy h1):not(.kakurii-standard-page h1) { text-shadow: 2px 4px 0 #ff4381; }
  h2 { text-shadow: 2px 4px 0 #ff4381; }
}



/* Les menus WordPress gardent exactement la présentation des anciens liens directs. */
.main-menu .kakurii-menu-items,
.footer-links .kakurii-footer-menu-items {
  display: contents;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-menu .kakurii-menu-items > li,
.footer-links .kakurii-footer-menu-items > li {
  display: contents;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Pages WordPress classiques : encart beige, frises et typographie. */
.kakurii-standard-page {
  background: transparent;
  color: var(--night);
  padding: clamp(35px, 5vw, 70px) 20px clamp(60px, 8vw, 110px);
}
.kakurii-standard-page .kakurii-standard-content {
  position: relative;
  isolation: isolate;
  z-index: 1;
  box-sizing: border-box;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: clamp(30px, 5vw, 65px);
  border-radius: 26px;
  background: var(--cream);
  font-family: "Nunito Sans", sans-serif;
}
.kakurii-standard-page .kakurii-standard-content :is(p, li) {
  font-family: "Nunito Sans", sans-serif;
}
.kakurii-standard-page .kakurii-standard-content::before,
.kakurii-standard-page .kakurii-standard-content::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  background: url("../img/hero-cache.png") repeat-x left center / auto 10px;
  pointer-events: none;
  z-index: 2;
}
.kakurii-standard-page .kakurii-standard-content::before { top: 0; }
.kakurii-standard-page .kakurii-standard-content::after { bottom: 0; transform: rotate(180deg); }
.kakurii-standard-page h1 { margin-top: 0; text-shadow: 1px 2px 0 #fffb95; }
.kakurii-standard-page a { color: var(--violet); }
.kakurii-standard-page a:hover { color: #208f58; }
@media (min-width: 981px) {
  .kakurii-standard-page h1 { text-shadow: 2px 4px 0 #fffb95; }
}

/* Kakurii décoratif du pied de page : position abaissée. */
.footer-kakurii { bottom: -25px; }
@media (min-width: 981px) { .footer-kakurii { bottom: -85px; } }

/* Hero-cache : debordement de 1 px sur les deux bords. */
.kakurii-standard-page .kakurii-standard-content::before { top: -1px; }
.kakurii-standard-page .kakurii-standard-content::after { bottom: -1px; }

/* Menu principal : espacement desktop uniquement. */
@media (min-width: 1000px) {
  .main-menu a { padding: 5px 5px; }
}

/* Menu principal : espacement desktop ajusté. */
@media (min-width: 1000px) {
  .main-menu a { padding: 5px 5px 15px; }
}
