/* Généré par dev/tools/lib/styles.mjs — sources : dev/site/css/ */

/* ===== /css/reset.css ===== */
/* Reset minimaliste */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

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

body {
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

input,
button {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
}

ol,
ul {
  padding: 0;
}

p,
h1,
h2,
h3,
h4 {
  overflow-wrap: break-word;
}

[hidden] {
  display: none !important;
}

/* Sprite d'icônes SVG : présent dans le DOM mais invisible */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ===== /css/backdrop.css ===== */
/*
 * Décor animé partagé par toutes les pages : aurore (taches floues qui dérivent),
 * réseau de nœuds (canvas, js/network.js), quadrillage, halo qui suit la souris, grain.
 * Construit par js/backdrop.js. Uniquement transform / opacity animés.
 */

/* Thème sombre (et page d'accueil, toujours sombre) */
:root {
  --bd-c1: #2563eb;
  --bd-c2: #1e40af;
  --bd-c3: #38bdf8;
  --bd-c4: #60a5fa;
  --bd-blob-opacity: 0.5;
  --bd-blend: screen;
  --bd-grid: rgba(255, 255, 255, 0.035);
  --bd-spot: rgba(59, 130, 246, 0.18);
  --bd-grain-opacity: 0.07;
  --bd-grain-blend: normal;
}

/* Pages secondaires en sombre : un peu plus discret que l'accueil (texte par-dessus) */
:root[data-theme="dark"]:not(.home) {
  --bd-blob-opacity: 0.38;
  --bd-spot: rgba(59, 130, 246, 0.12);
}

/* Thème clair : taches pastel en mode normal (« screen » serait invisible sur fond clair) */
:root:not([data-theme="dark"]):not(.home) {
  --bd-c1: #93c5fd;
  --bd-c2: #bfdbfe;
  --bd-c3: #7dd3fc;
  --bd-c4: #a5b4fc;
  --bd-blob-opacity: 0.45;
  --bd-blend: normal;
  --bd-grid: rgba(30, 58, 138, 0.05);
  --bd-spot: rgba(59, 130, 246, 0.1);
  --bd-grain-opacity: 0.05;
  --bd-grain-blend: multiply;
}

/* Le mode Matrix (Konami) a son propre fond */
.matrix-mode .scene {
  display: none;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora {
  position: absolute;
  inset: -15%;
  will-change: transform;
}

.blob {
  position: absolute;
  width: 48vmax;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: var(--bd-blob-opacity);
  mix-blend-mode: var(--bd-blend);
  will-change: transform;
}

.blob--1 {
  top: 0;
  left: 0;
  background: radial-gradient(circle at 30% 30%, var(--bd-c1), transparent 65%);
  animation: drift-1 26s var(--ease-in-out) infinite alternate;
}

.blob--2 {
  top: 10%;
  right: -5%;
  background: radial-gradient(circle at 50% 50%, var(--bd-c2), transparent 65%);
  animation: drift-2 32s var(--ease-in-out) infinite alternate;
}

.blob--3 {
  bottom: -10%;
  left: 20%;
  background: radial-gradient(circle at 50% 50%, var(--bd-c3), transparent 62%);
  opacity: calc(var(--bd-blob-opacity) * 0.64);
  animation: drift-3 28s var(--ease-in-out) infinite alternate;
}

.blob--4 {
  right: 10%;
  bottom: 0;
  width: 32vmax;
  background: radial-gradient(circle at 50% 50%, var(--bd-c4), transparent 65%);
  opacity: calc(var(--bd-blob-opacity) * 0.6);
  animation: drift-4 22s var(--ease-in-out) infinite alternate;
}

@keyframes drift-1 {
  to { transform: translate(25vw, 20vh) scale(1.25) rotate(40deg); }
}
@keyframes drift-2 {
  to { transform: translate(-30vw, 25vh) scale(0.85) rotate(-30deg); }
}
@keyframes drift-3 {
  to { transform: translate(20vw, -30vh) scale(1.2); }
}
@keyframes drift-4 {
  to { transform: translate(-25vw, -20vh) scale(1.3); }
}

.network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Quadrillage qui défile lentement, estompé sur les bords */
.grid-lines {
  position: absolute;
  inset: -64px 0 0;
  background-image:
    linear-gradient(var(--bd-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bd-grid) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
  animation: grid-scroll 6s linear infinite;
}

@keyframes grid-scroll {
  to { transform: translateY(64px); }
}

/* Halo qui suit le curseur (positionné par transform) */
.spotlight {
  position: absolute;
  top: -350px;
  left: -350px;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bd-spot), transparent 60%);
  opacity: 0;
  transition: opacity 600ms var(--ease);
  will-change: transform;
}

.has-pointer .spotlight {
  opacity: 1;
}

/* Grain argentique animé */
.grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--bd-grain-opacity);
  mix-blend-mode: var(--bd-grain-blend);
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-6%, 4%); }
  40% { transform: translate(5%, -7%); }
  60% { transform: translate(-3%, 8%); }
  80% { transform: translate(7%, 2%); }
  100% { transform: translate(-4%, -5%); }
}

@media (prefers-reduced-motion: reduce) {
  .blob,
  .grid-lines,
  .grain {
    animation: none !important;
  }
}

@media print {
  .scene {
    display: none !important;
  }
}

/* ===== /css/home.css ===== */
/* Police Syne auto-hébergée (licence OFL) — variable, couvre 600 et 800 */
@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 400 800;
  /* block : police minuscule et préchargée → pas de saut de mise en page au changement de police */
  font-display: block;
  src: url("../assets/fonts/syne-latin.woff2") format("woff2");
  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;
}

/* Page d'accueil — sombre, typographique, très animée.
   Toutes les animations ne touchent que transform / translate / rotate / scale / opacity. */

:root {
  --bg: #03060f;
  --text: #f4f4f8;
  --muted: #a5b4cb;
  --line: rgba(147, 197, 253, 0.18);
  --c1: #2563eb;
  --c2: #1e40af;
  --c3: #38bdf8;
  --c4: #60a5fa;
  --success: #38bdf8;

  --font-display: "Syne", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 5vw, 64px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

html {
  background: var(--bg);
}

body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
}

::selection {
  background: var(--c2);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--c3);
  outline-offset: 4px;
}

/* ---------- Curseur personnalisé (souris uniquement) ---------- */
.cursor {
  /* Hors du flux : sinon il devient une rangée de la grille du body et décale la page */
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .has-pointer .cursor {
    display: block;
  }
}

.cursor-ring,
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}

.cursor-ring {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  mix-blend-mode: difference;
}

.cursor-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform 400ms var(--ease);
}

.cursor.is-hover .cursor-ring::after {
  transform: scale(1);
}

.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: #fff;
}

/* ---------- Rideau d'introduction ---------- */
.curtain {
  display: none;
}

.js .curtain {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: 1fr 1fr;
  pointer-events: none;
}

.js .curtain span {
  background: #060a17;
  /* Repli : le rideau s'ouvre de lui-même même si le JS échoue */
  animation: curtain-up 1s var(--ease) 2.5s forwards;
}

.js .curtain span:last-child {
  animation-name: curtain-down;
}

.is-ready .curtain span {
  animation-delay: 0.05s;
}

@keyframes curtain-up {
  to { transform: translateY(-101%); }
}
@keyframes curtain-down {
  to { transform: translateY(101%); }
}

/* ---------- Mise en page ---------- */
.topbar,
.hero,
.foot {
  position: relative;
  z-index: 1;
}

/* Rangées explicites : aucun autre élément ne peut s'intercaler dans la grille */
.topbar { grid-row: 1; }
.hero { grid-row: 2; }
.foot { grid-row: 3; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: clamp(16px, 3vw, 28px) var(--gutter);
}

.lang {
  /* Hauteur réservée : les boutons sont insérés par JS, la page ne doit pas sauter */
  min-height: 2.75rem;
  display: flex;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.lang a {
  position: relative;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  min-width: 2.75rem;
  min-height: 2.75rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  transition: color 300ms var(--ease);
}

.lang a::after {
  content: "";
  position: absolute;
  right: 0.7rem;
  bottom: 0.55rem;
  left: 0.7rem;
  height: 1px;
  background: linear-gradient(90deg, var(--c3), var(--c2));
  transform: scaleX(0);
  transition: transform 400ms var(--ease);
}

.lang a:hover,
.lang a[aria-current="true"] {
  color: var(--text);
}

.lang a[aria-current="true"]::after {
  transform: scaleX(1);
}

.hero {
  /* Ancré en haut (et non centré) : l'arrivée du texte « À propos » ne fait pas remonter le nom */
  align-self: start;
  width: min(100% - 2 * var(--gutter), 1180px);
  margin-inline: auto;
  padding-block: clamp(24px, 12vh, 140px) clamp(24px, 6vh, 72px);
}

.hello {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(0.75rem, 2vh, 1.5rem);
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 0.7rem + 0.3vw, 0.9rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.hello-line {
  width: clamp(32px, 6vw, 72px);
  height: 1px;
  background: linear-gradient(90deg, var(--c3), var(--c2));
  transform-origin: left;
}

/* Nom : chaque lettre monte depuis un masque */
.name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 10.5vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  user-select: none;
}

.name .word {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  padding: 0.04em 0 0.1em;
  margin-bottom: -0.1em;
}

.name .char {
  display: inline-block;
  transform-origin: 50% 100%;
  transition: translate 450ms var(--ease);
  cursor: default;
}

.role {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: clamp(1rem, 3vh, 2rem);
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: clamp(0.85rem, 0.8rem + 0.3vw, 1rem);
  font-weight: 500;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.role:empty,
.role:has(#role-text:empty) {
  display: none;
}

.role-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.role-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
  animation: ping 2.2s var(--ease) infinite;
}

@keyframes ping {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(3); opacity: 0; }
}

.about {
  max-width: 75ch;
  margin-top: clamp(1.25rem, 3vh, 2rem);
  font-size: clamp(1rem, 0.9rem + 0.45vw, 1.25rem);
  line-height: 1.7;
  color: var(--muted);
}

.about > * + * {
  margin-top: 0.9em;
}

.about strong {
  font-weight: 600;
  color: var(--text);
}

.about a {
  color: var(--text);
}

.about .w {
  display: inline-block;
}

/* ---------- Boutons ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: clamp(1.75rem, 5vh, 3rem);
}

.cta {
  position: relative;
  display: inline-flex;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: translate 500ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.cta-inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0 1.75rem;
  border-radius: inherit;
  overflow: hidden;
  transition: translate 500ms var(--ease), color 400ms var(--ease);
}

/* Remplissage au survol */
.cta-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  transform: translateY(101%);
  transition: transform 500ms var(--ease);
}

.cta:hover .cta-inner::before,
.cta:focus-visible .cta-inner::before {
  transform: translateY(0);
}

.cta-icon {
  width: 1.2rem;
  height: 1.2rem;
  transition: transform 500ms var(--ease);
}

.cta--primary:hover .cta-icon {
  transform: translateX(5px);
}

.cta--ghost:hover .cta-icon {
  transform: rotate(-8deg) scale(1.1);
}

/* Bouton principal : bordure en dégradé conique qui tourne */
.cta--primary {
  padding: 1.5px;
  overflow: hidden;
  isolation: isolate;
}

.cta-border {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300%;
  aspect-ratio: 1;
  margin: -150% 0 0 -150%;
  background: conic-gradient(from 0deg, var(--c3), var(--c1), var(--c2), var(--c4), var(--c3));
  animation: spin 4s linear infinite;
}

.cta--primary .cta-inner {
  background: #060b1a;
}

.cta--primary .cta-inner::before {
  background: linear-gradient(110deg, var(--c3), var(--c1) 45%, var(--c2));
}

.cta--primary:hover .cta-inner {
  color: #fff;
}

.cta--ghost .cta-inner {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.cta--ghost .cta-inner::before {
  background: var(--text);
}

.cta--ghost:hover .cta-inner {
  color: var(--bg);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Lien d'évitement (clavier) ---------- */
.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 70;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Footer ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.25rem var(--gutter) clamp(1rem, 3vw, 1.75rem);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.clock {
  font-variant-numeric: tabular-nums;
}

.foot-link {
  color: var(--muted);
  text-decoration: none;
  text-underline-offset: 3px;
}

.foot-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.noscript {
  position: relative;
  z-index: 1;
  padding: 1rem var(--gutter);
}

/* ---------- Séquence d'entrée (déclenchée par .is-ready) ---------- */
.js .hello-line { transform: scaleX(0); }
.js .hello .scramble,
.js .role,
.js .links .cta,
.js .topbar > *,
.js .foot > * {
  opacity: 0;
  translate: 0 16px;
}
.js .name .char {
  transform: translateY(115%) rotate(12deg);
}
.js .about .w {
  opacity: 0;
  transform: translateY(0.7em);
}

.is-ready .hello-line {
  transform: none;
  transition: transform 900ms var(--ease) 500ms;
}

.is-ready .hello .scramble,
.is-ready .role,
.is-ready .links .cta,
.is-ready .topbar > *,
.is-ready .foot > * {
  opacity: 1;
  translate: 0 0;
  transition:
    opacity 900ms var(--ease) var(--d, 0ms),
    translate 900ms var(--ease) var(--d, 0ms);
}

.is-ready .hello .scramble { --d: 600ms; }
.is-ready .topbar > * { --d: 900ms; }
.is-ready .role { --d: 1100ms; }
.is-ready .links .cta:nth-child(1) { --d: 1500ms; }
.is-ready .links .cta:nth-child(2) { --d: 1600ms; }
.is-ready .foot > * { --d: 1800ms; }

/* Une fois arrivés, les boutons gardent une transition courte pour l'effet magnétique */
.is-settled .links .cta {
  transition: translate 500ms var(--ease);
}

.is-ready .name .char {
  transform: none;
  transition:
    transform 1100ms var(--ease) calc(500ms + var(--i) * 40ms),
    translate 450ms var(--ease);
}

.about.is-shown .w {
  opacity: 1;
  transform: none;
  transition:
    opacity 700ms var(--ease) calc(var(--about-delay, 1100ms) + var(--i) * 14ms),
    transform 700ms var(--ease) calc(var(--about-delay, 1100ms) + var(--i) * 14ms);
}

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  .links {
    flex-direction: column;
  }

  .cta,
  .cta-inner {
    width: 100%;
    justify-content: center;
  }

  .blob {
    filter: blur(50px);
  }
}

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }

  .grain,
  .grid-lines {
    animation: none !important;
  }

  .js .curtain {
    display: none;
  }
}

/* ===== /css/transitions.css ===== */
/*
 * Transitions entre pages, sans SPA (View Transitions entre documents).
 * Chrome / Edge 126+, Safari 18.2+ ; ailleurs, navigation classique.
 *  - en-tête : reste en place et se transforme (même nom sur toutes les pages) ;
 *  - contenu principal (<main>) : sort vers le haut, le nouveau arrive par le bas ;
 *  - reste de la page (décor, pied de page) : fondu enchaîné par défaut.
 * Couplé au préchargement au survol (Speculation Rules, en-tête HTTP dans .htaccess).
 */
@view-transition {
  navigation: auto;
}

.site-header {
  view-transition-name: site-header;
}

main {
  view-transition-name: page-content;
}

::view-transition-group(*) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* L'ancien contenu s'efface vite ; le nouveau n'arrive qu'ensuite (pas de superposition confuse) */
::view-transition-old(page-content) {
  animation: vt-content-out 180ms cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(page-content) {
  animation: vt-content-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) 150ms both;
}

@keyframes vt-content-out {
  to {
    opacity: 0;
    transform: translateY(-14px) scale(0.99);
  }
}

@keyframes vt-content-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.99);
  }
}

/* Arrivée par une transition (classe posée par js/boot.js) : pas d'animation d'entrée en double */
.vt-arrival .site-header,
.vt-arrival .site-nav a,
.vt-arrival .curtain span {
  animation: none !important;
}

.vt-arrival .curtain {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* ===== /css/palette.css ===== */
/*
 * Palette de commandes (js/palette.js) et bouton « Rechercher » des en-têtes.
 * Autonome : fonctionne sur l'accueil (thème sombre propre, sans variables.css) comme sur les autres pages.
 */
.palette {
  --p-surface: var(--surface, #0c1122);
  --p-surface-2: var(--surface-2, #131a30);
  --p-text: var(--text, #f4f4f8);
  --p-muted: var(--text-muted, var(--muted, #a5b4cb));
  --p-border: var(--border, rgba(147, 197, 253, 0.18));
  --p-accent: var(--accent, #60a5fa);
  --p-accent-soft: var(--accent-soft, rgba(96, 165, 250, 0.16));
  width: min(100% - 2rem, 640px);
  max-height: min(70dvh, 560px);
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--p-border);
  border-radius: 18px;
  background: var(--p-surface);
  color: var(--p-text);
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

.palette[open] {
  display: flex;
  flex-direction: column;
  animation: palette-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes palette-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.palette::backdrop {
  background: rgba(2, 6, 23, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.palette-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--p-border);
}

.palette-field .palette-icon {
  color: var(--p-muted);
}

.palette-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--p-text);
  font: inherit;
  font-size: 1.05rem;
  outline: none;
}

.palette-input::placeholder {
  color: var(--p-muted);
}

.palette-esc,
.palette-shortcut {
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--p-border, currentColor);
  border-radius: 6px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--p-muted, inherit);
}

.palette-list {
  flex: 1;
  margin: 0;
  padding: 0.4rem;
  overflow-y: auto;
  list-style: none;
}

.palette-group {
  padding: 0.7rem 0.6rem 0.3rem;
  color: var(--p-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.palette-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
}

.palette-option[aria-selected="true"] {
  background: var(--p-accent-soft);
  color: var(--p-text);
}

.palette-option[aria-selected="true"] .palette-icon {
  color: var(--p-accent);
}

.palette-icon {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--p-muted);
}

.palette-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-hint {
  flex-shrink: 0;
  max-width: 45%;
  overflow: hidden;
  color: var(--p-muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-empty {
  padding: 2rem 1rem;
  color: var(--p-muted);
  text-align: center;
}

.palette-footer {
  margin: 0;
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--p-border);
  color: var(--p-muted);
  font-size: 0.75rem;
}

/* Bouton « Rechercher » (en-tête des pages et accueil) */
.palette-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2, #131a30) 70%, transparent);
  color: var(--text-muted, var(--muted, #a5b4cb));
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 200ms, background-color 200ms;
}

.palette-trigger:hover {
  color: var(--text, #f4f4f8);
}

.palette-trigger svg {
  width: 1.05rem;
  height: 1.05rem;
}

.palette-trigger-label,
.palette-trigger .palette-shortcut {
  display: none;
}

@media (min-width: 1100px) {
  .palette-trigger-label,
  .palette-trigger .palette-shortcut {
    display: inline;
  }
}

/* Accueil : bouton discret dans la barre du haut */
.home .palette-trigger {
  border: 1px solid rgba(147, 197, 253, 0.18);
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@media (prefers-reduced-motion: reduce) {
  .palette[open] {
    animation: none;
  }
}
