/* ================= TOKENS ================= */
:root {
  --bg: #0a0a0a;
  --fg: #efefef;
  --muted: #8c8c8c;
  --line: rgba(255, 255, 255, 0.14);
  --blue: #2e3cff;
  --on-blue: #ffffff;
  --on-blue-muted: rgba(255, 255, 255, 0.72);
  --panel-dark: #111111;
  --mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --pad: clamp(14px, 1.8vw, 28px);
  --ease: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}
@media (hover: none) { body { cursor: auto; } }
a, button { color: inherit; text-decoration: none; background: none; border: 0; font: inherit; cursor: none; }
@media (hover: none) { a, button { cursor: pointer; } }
ol, ul { list-style: none; }
::selection { background: var(--blue); color: var(--on-blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; text-transform: uppercase; }
.muted { color: var(--muted); }
.label { margin-bottom: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ================= LOADER ================= */
#loader {
  position: fixed; inset: 0; z-index: 300;
  background: var(--blue); color: var(--on-blue);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--pad);
  clip-path: circle(150% at 50% 50%);
  transition: clip-path .55s cubic-bezier(.7, 0, .84, 0), visibility 0s .55s; /* se referme en un point au centre : le big bang part de là */
}
.loader-top { display: flex; justify-content: space-between; }
#loader-num {
  font-weight: 900; font-stretch: 125%;
  font-size: clamp(110px, 26vw, 420px); line-height: 0.78; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
body.loaded #loader { clip-path: circle(0% at 50% 50%); visibility: hidden; }

/* ================= CURSOR ================= */
#cursor {
  position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none;
  width: 0; height: 0; mix-blend-mode: difference;
}

#confetti { position: fixed; inset: 0; z-index: 450; pointer-events: none; width: 100%; height: 100%; }
#cursor::before {
  content: ""; position: absolute; left: -42px; top: -42px; width: 84px; height: 84px; border-radius: 50%;
  background: #fff; scale: 0.1667; transition: scale .4s var(--ease-out);
}
#cursor.big::before { scale: 1; }
#cursor-label {
  position: absolute; left: 0; top: 0; translate: -50% -50%; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; color: #000; text-transform: uppercase; opacity: 0; transition: opacity .2s;
}
#cursor.big #cursor-label { opacity: 1; }
@media (hover: none) { #cursor { display: none; } }

/* ================= BIG WORD ================= */
#bigword {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  display: grid; place-items: center; overflow: hidden;
}
#bigword-inner {
  font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: 22vw; line-height: 0.8; letter-spacing: -0.045em;
  white-space: nowrap; color: var(--fg);
  display: flex; overflow: hidden; padding: 0.04em 0;
}
#bigword-inner .ch { display: inline-block; transform: translateY(105%); transition: transform .8s var(--ease-out); }
#bigword-inner.in .ch { transform: none; }
#bigword-inner.out .ch { transform: translateY(-105%); transition: transform .35s var(--ease); }

/* pan-y (pas none) : le doigt qui glisse verticalement fait défiler la page nativement ;
   seul un glissé horizontal atteint le JS pour faire tourner l'objet */
#webgl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; touch-action: pan-y; }

/* ================= TOP ================= */
.ui { position: fixed; z-index: 10; transition: opacity .8s .6s, transform .8s .6s var(--ease-out); }
body.is-loading .ui { opacity: 0; transform: translateY(10px); }

#top { top: 0; left: 0; right: 0; padding: var(--pad); display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
#top > * { pointer-events: auto; }
.logo { display: grid; gap: 4px; text-align: left; }
.logo-name { font-weight: 800; font-stretch: 125%; font-size: 15px; letter-spacing: -0.01em; }
.top-nav { display: flex; gap: 6px; }
.top-nav button {
  height: 30px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 30px;
  transition: background .25s, color .25s, border-color .25s;
}
.top-nav button:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
.eq i { width: 2px; height: 10px; background: currentColor; transform-origin: bottom; transform: scaleY(0.3); }
body.sound-on .eq i { animation: eq .8s ease-in-out infinite alternate; }
body.sound-on .eq i:nth-child(2) { animation-delay: -.3s; }
body.sound-on .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { from { transform: scaleY(0.2); } to { transform: scaleY(1); } }

#hint { left: 50%; bottom: 96px; transform: translateX(-50%); color: var(--muted); white-space: nowrap; pointer-events: none; }
body.is-loading #hint { transform: translate(-50%, 10px); }
body.hint-gone #hint { opacity: 0; transition-delay: 0s; }

/* ================= BOTTOM ================= */
#bottom {
  left: 0; right: 0; bottom: 0; padding: var(--pad);
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: end;
  pointer-events: none;
}
#bottom > * { pointer-events: auto; }
.ach-btn { display: grid; gap: 6px; text-align: left; min-width: 120px; }
.ach-btn b { font-weight: 500; }
.ach-bar { display: block; height: 3px; background: var(--line); overflow: hidden; }
#ach-bar-fill { display: block; height: 100%; width: 0; background: var(--blue); transition: width .8s var(--ease-out); }
.help-btn { color: var(--muted); transition: color .2s; }
.help-btn:hover { color: var(--fg); }

#projects {
  display: flex; justify-content: center; gap: 2px; flex-wrap: wrap;
}
#projects button {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 10px; border-radius: 2px;
  font-weight: 700; font-stretch: 75%; font-size: 17px; text-transform: uppercase; letter-spacing: 0.01em;
  transition: background .2s, color .2s;
}
#projects button sup { font-family: var(--mono); font-size: 9px; font-weight: 400; color: var(--muted); }
#projects button:hover, #projects button.active { background: var(--blue); color: var(--on-blue); }
#projects button:hover sup, #projects button.active sup { color: var(--on-blue-muted); }
#projects button.seen::after { content: "•"; color: var(--blue); margin-left: 2px; }
#projects button:hover.seen::after { color: var(--on-blue); }

/* ================= ACHIEVEMENT TOAST ================= */
#ach-toast {
  position: fixed; z-index: 250; left: 50%; bottom: 130px;
  min-width: 260px; padding: 14px 16px;
  background: var(--blue); color: var(--on-blue);
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  transition: transform .6s var(--ease-out), opacity .4s;
}
#ach-toast.show { transform: translate(-50%, 0); opacity: 1; }
#ach-toast .mono { color: var(--on-blue-muted); }
.ach-title { font-weight: 900; font-stretch: 125%; font-size: 26px; text-transform: uppercase; letter-spacing: -0.02em; margin: 6px 0 4px; }
.ach-desc { font-size: 11px; }

/* ================= PANELS ================= */
.panel {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column;
  clip-path: inset(100% 0 0 0);
  transition: clip-path .9s var(--ease);
  visibility: hidden;
}
.panel.open { clip-path: inset(0 0 0 0); visibility: visible; }
.panel:not(.open) { transition: clip-path .7s var(--ease), visibility 0s .7s; }
.panel-blue { background: var(--blue); color: var(--on-blue); }
.panel-dark { background: var(--panel-dark); color: var(--fg); }
.panel-bar { display: flex; justify-content: space-between; align-items: center; padding: var(--pad); gap: 12px; }
.panel-bar button:hover { text-decoration: underline; text-underline-offset: 3px; }
.pj-nav { display: flex; gap: 20px; }
.panel-scroll { flex: 1; overflow-y: auto; padding: 0 var(--pad) var(--pad); }

/* recherche (palette de commandes) */
.search-wrap { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 0 var(--pad) var(--pad); }
.search-input {
  width: 100%; padding: 18px 0; margin-bottom: 10px; border-bottom: 1px solid var(--line);
  background: none; color: var(--fg); font-family: var(--sans); font-weight: 700; font-stretch: 112%;
  font-size: clamp(22px, 3.4vw, 36px); letter-spacing: -0.01em;
}
.search-input::placeholder { color: var(--muted); }
.search-list { flex: 1; overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.search-list li button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 12px; text-align: left; border-radius: 2px; transition: background .15s, color .15s;
}
.search-list li button .s-label { font-family: var(--sans); font-size: 17px; font-weight: 700; font-stretch: 90%; text-transform: none; letter-spacing: 0; color: var(--fg); }
.search-list li button .s-hint { color: var(--muted); font-size: 10px; }
.search-list li button:hover, .search-list li button.sel { background: var(--blue); }
.search-list li button:hover .s-label, .search-list li button.sel .s-label { color: var(--on-blue); }
.search-list li button:hover .s-hint, .search-list li button.sel .s-hint { color: var(--on-blue-muted); }
.search-empty { color: var(--muted); padding: 14px 12px; }

/* about */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 30%); gap: clamp(20px, 4vw, 64px); align-items: start; margin-top: 4vh; }
.about-text {
  font-weight: 800; font-stretch: 112%;
  font-size: clamp(30px, 4.6vw, 76px); line-height: 0.98; letter-spacing: -0.03em;
}
.about-text .w { display: inline-block; overflow: hidden; vertical-align: top; }
.about-text .w span { display: inline-block; transform: translateY(100%); transition: transform .9s var(--ease-out); }
.panel.open .about-text .w span { transform: none; }
.saturn { margin: 0; }
.saturn canvas { display: block; width: 100%; aspect-ratio: 1; touch-action: pan-y; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 64px); margin-top: 8vh; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.3); }
.facts dt { color: var(--on-blue-muted); }
.stack { display: flex; flex-wrap: wrap; gap: 6px; }
.stack li { font-family: var(--mono); font-size: 11px; text-transform: uppercase; padding: 6px 10px; border: 1px solid rgba(255,255,255,.4); border-radius: 30px; }

/* contact */
.contact-wrap { display: flex; flex-direction: column; justify-content: center; }
.contact-mail {
  font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: clamp(28px, 6.4vw, 120px); line-height: 0.9; letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  transition: letter-spacing .5s var(--ease-out);
}
.contact-mail:hover { letter-spacing: -0.02em; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6vh; }
.socials a { display: inline-block; padding: 10px 14px; border: 1px solid rgba(255,255,255,.5); border-radius: 30px; transition: background .2s, color .2s; }
.socials a:hover { background: #fff; color: var(--blue); }

/* project */
.pj-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(20px, 3vw, 48px); margin-top: 2vh; }
.pj-name {
  font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: clamp(44px, 7.5vw, 130px); line-height: 0.85; letter-spacing: -0.045em;
  overflow-wrap: normal; word-break: keep-all;
}
.pj-meta { margin-top: 28px; }
.pj-meta div { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.pj-meta dt { color: var(--muted); }
.pj-desc { font-size: 19px; line-height: 1.35; margin: 26px 0; max-width: 32em; }
.pj-link { display: inline-block; padding: 12px 18px; background: var(--blue); color: var(--on-blue); border-radius: 30px; transition: background .2s, color .2s; }
.pj-link:hover { background: var(--fg); color: var(--bg); }
.pj-media img { width: 100%; display: block; aspect-ratio: 16 / 10; object-fit: cover; }
.pj-media iframe { width: 100%; aspect-ratio: 16 / 10; display: block; border: 0; background: #000; }
.pj-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.pj-live {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.02em;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 30px; transition: background .2s, color .2s, border-color .2s;
}
.pj-live:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pj-live .dot-live { width: 7px; height: 7px; border-radius: 50%; background: #3ddc73; flex: none; }
.pj-live.off .dot-live { background: var(--muted); }

/* achievements */
.ach-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 2vh 0 5vh; }
.ach-big { font-weight: 900; font-stretch: 125%; font-size: clamp(90px, 16vw, 260px); line-height: 0.8; letter-spacing: -0.05em; margin: 0; }
.ach-share {
  flex: none; padding: 12px 18px; border: 1px solid var(--line); border-radius: 30px;
  text-transform: uppercase; letter-spacing: 0.02em; transition: background .2s, color .2s, border-color .2s;
}
.ach-share:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.ach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.ach-list li { padding: 14px; border: 1px solid var(--line); min-height: 110px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.ach-list li.done { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.ach-list li .t { font-weight: 800; font-stretch: 112%; font-size: 20px; text-transform: uppercase; letter-spacing: -0.01em; }
.ach-list li .d { color: var(--muted); }
.ach-list li.done .d { color: var(--on-blue-muted); }

/* help */
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; margin-top: 2vh; }
.keys div { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); }
.keys kbd { font-family: var(--mono); font-size: 13px; min-width: 38px; height: 38px; padding: 0 8px; display: grid; place-items: center; background: var(--fg); color: var(--bg); border-radius: 4px; }
.keys dd { font-family: var(--mono); font-size: 11px; text-transform: uppercase; }

/* party mode (konami) */
body.party #bigword-inner { animation: hue 2s linear infinite; color: var(--blue); }
@keyframes hue { to { filter: hue-rotate(360deg); } }

/* ================= VITRINE EN DÉFILEMENT ================= */
/* un espaceur en flux normal donne sa hauteur réelle à la page (tout le reste est en fixed) ;
   l'objet 3D existant traverse chaque projet pendant qu'on défile dedans */
#scroll-spacer { position: relative; z-index: 0; }

#showcase { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.station {
  position: absolute; left: var(--pad); top: 50%; transform: translateY(-50%);
  max-width: min(560px, 86vw);
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
/* seule la station affichée doit intercepter les clics : sinon les 7 boutons superposés
   au même endroit se disputent le clic, et le dernier du DOM gagne toujours */
.station.on { opacity: 1; pointer-events: auto; }
.station .kicker { color: var(--muted); margin-bottom: 10px; }
.station h2 {
  display: flex; flex-wrap: wrap; overflow: hidden; padding: 0.04em 0;
  font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: clamp(34px, 6vw, 72px); line-height: 0.92; letter-spacing: -0.03em; margin: 0 0 16px;
}
/* même langage que le gros nom de l'accueil (#bigword) : chaque lettre monte depuis le bas */
.station h2 .ch { display: inline-block; transform: translateY(105%); transition: transform .7s var(--ease-out); }
.station.on h2 .ch { transform: none; }
.station .desc { font-size: 16px; line-height: 1.5; color: #d2d2d2; margin: 0 0 14px; max-width: 42ch; }
.station .stat { color: var(--muted); margin-bottom: 18px; }
.station .thumb {
  display: block; width: 180px; aspect-ratio: 16 / 10; object-fit: cover;
  margin-bottom: 18px; border: 1px solid var(--line); opacity: 0.92;
}
.station .pj-open {
  display: inline-block; padding: 12px 18px;
  background: var(--blue); color: var(--on-blue); border-radius: 30px;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.02em;
  transition: background .2s, color .2s;
}
.station .pj-open:hover { background: var(--fg); color: var(--bg); }

#dots {
  position: fixed; z-index: 10; right: var(--pad); top: 50%; transform: translateY(-50%);
  display: grid; gap: 13px; pointer-events: auto;
}
#dots .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .25s, transform .25s; }
#dots .dot:hover { background: var(--muted); }
#dots .dot.on { background: var(--blue); transform: scale(1.6); }
#dots .dot { position: relative; }
#dots .dot::after {
  content: attr(aria-label); position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap; background: var(--panel-dark); padding: 4px 8px;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
#dots .dot:hover::after { opacity: 1; }

/* barre de progression tirable : clique ou glisse dessus pour sauter directement à une station */
#scroll-bar { position: fixed; z-index: 20; left: 0; top: 0; right: 0; height: 10px; cursor: pointer; }
#scroll-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: var(--line); }
#scroll-bar i { position: absolute; left: 0; top: 4px; display: block; height: 2px; width: 0; background: var(--blue); transform-origin: left; }

.station.end h2 { font-size: clamp(30px, 5vw, 56px); }
.station.end .desc { max-width: 38ch; }

body.scrolled #hint { opacity: 0; transition-delay: 0s; }
body.scrolled #bigword { opacity: 0; transition: opacity .5s; }

/* ================= MOBILE ================= */
@media (max-width: 760px) {
  .top-nav button[data-open="about"] { display: none; }
  .top-nav button { padding: 0 10px; white-space: nowrap; }
  #search-btn .muted { display: none; } /* le raccourci clavier ne sert à rien au doigt */
  .help-btn { display: none; }
  #hint { bottom: 150px; width: calc(100% - 32px); white-space: normal; text-align: center; }
  #bottom { grid-template-columns: 1fr auto; }
  #projects { grid-column: 1 / -1; grid-row: 1; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); }
  #projects::-webkit-scrollbar { display: none; }
  #projects button { flex: none; }
  #ach-toast { bottom: 170px; }
  .about-grid, .about-cols, .pj-grid { grid-template-columns: 1fr; }
  .panel-space .about-grid { grid-template-columns: 1fr; }
  .saturn { max-width: 420px; width: 100%; justify-self: center; }
  .station { top: 42%; max-width: calc(100vw - var(--pad) * 2); }
  #dots { right: 10px; gap: 10px; }
  #dots .dot { width: 5px; height: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ================= ÉTUDE DE CAS + APPEL À CONTACT (panneau projet) ================= */
.cs { margin: clamp(48px, 8vw, 96px) 0 0; border-top: 1px solid var(--line); }
.cs > div { display: grid; grid-template-columns: minmax(140px, 1fr) 3fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.cs dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 0.4em; }
.cs dd { margin: 0; font-size: clamp(17px, 1.6vw, 22px); line-height: 1.45; max-width: 46ch; }
.pj-cta { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin: clamp(48px, 8vw, 96px) 0 24px; }
.pj-cta-title { margin: 0; font-family: var(--sans); font-weight: 800; font-stretch: 112%; font-size: clamp(32px, 5vw, 72px); line-height: 0.95; text-transform: uppercase; letter-spacing: -0.02em; }
.pj-cta-title em { font-style: normal; color: #8a93ff; }
.pj-cta-btn { padding: 16px 26px; border-radius: 999px; background: var(--blue); color: var(--on-blue); font-size: 13px; text-transform: uppercase; transition: transform 0.25s, background 0.25s; }
.pj-cta-btn:hover { transform: translateY(-2px); background: #4452ff; }
@media (max-width: 700px) { .cs > div { grid-template-columns: 1fr; gap: 8px; padding: 20px 0; } }

/* ================= SANS WEBGL : un disque plein à la place de l'objet 3D ================= */
body.no-webgl #webgl { background: radial-gradient(circle at 50% 50%, var(--blue) 0 16vmin, transparent calc(16vmin + 1px)); }
body.no-webgl #hint { display: none; }

/* ================= OMAR MODE (secret : taper "omar") ================= */
#override { position: fixed; inset: 0; z-index: 445; display: grid; place-content: center; gap: 14px; text-align: center; pointer-events: none; opacity: 0; transition: opacity 0.2s; color: #ff2e2e; }
#override::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 46, 46, 0.09) 0 1px, transparent 1px 3px); }
body.override #override { opacity: 1; }
body.override { --blue: #ff2e2e; }
body.override #bigword { opacity: 0; }
.ov-sys { position: relative; margin: 0; font-size: 13px; letter-spacing: 0.3em; }
.ov-big { position: relative; margin: 0; font-family: var(--sans); font-weight: 900; font-stretch: 125%; font-size: clamp(56px, 13vw, 220px); line-height: 0.85; text-transform: uppercase; color: #fff; text-shadow: 4px 0 #00e5ff, -4px 0 #ff2e2e; }
body.override .ov-big { animation: ov-jit 0.14s steps(2) infinite; }
body.override #webgl { animation: ov-jit 0.2s steps(2) infinite; }
@keyframes ov-jit { 0% { transform: translate(0, 0); } 50% { transform: translate(-6px, 2px) skewX(-3deg); } 100% { transform: translate(4px, -2px); } }
@media (prefers-reduced-motion: reduce) { body.override .ov-big, body.override #webgl { animation: none; } }

/* ================= À PROPOS : PANNEAU NOIR ÉTOILÉ ================= */
.panel-space { background: #000; color: var(--fg); }
#about-stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.panel-space .panel-bar, .panel-space .panel-scroll { position: relative; z-index: 1; }
.panel-space .about-grid { grid-template-columns: minmax(0, 1fr) minmax(240px, 40%); align-items: center; }
@media (max-width: 760px) { .panel-space .about-grid { grid-template-columns: 1fr; } }

/* ================= CONTACT : TROU NOIR EN FOND ================= */
/* le canvas passe sous le texte (z-index -1) sans créer de groupe isolé : l'e-mail peut ainsi
   s'inverser au-dessus du disque lumineux (mix-blend-mode) et rester lisible partout */
#contact-hole { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
#panel-contact { touch-action: pan-y; }
#panel-contact .panel-bar, #panel-contact .panel-scroll { z-index: auto; }
#panel-contact .contact-mail { mix-blend-mode: difference; color: #fff; }
/* glisser pour tourner autour du trou noir ne doit pas surligner le texte au passage */
#panel-contact { user-select: none; -webkit-user-select: none; }

/* ================= SUCCÈS ET RACCOURCIS : CIELS EN FOND (canvas ajoutés par script.js) ================= */
.panel-sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* Succès : tuiles translucides pour voir la constellation à travers */
#panel-ach .ach-list li { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.14); }
#panel-ach .ach-list li.done { background: rgba(46, 60, 255, 0.3); border-color: rgba(130, 145, 255, 0.55); }

/* ================= BIG BANG, SUPERNOVA, TRAÎNÉE ================= */
/* éclair au point où l'écran de chargement s'est refermé */
#bang-flash { position: fixed; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; z-index: 301; pointer-events: none; opacity: 0; }
body.loaded #bang-flash { animation: bang-flash 1s 0.5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes bang-flash { 0% { opacity: 1; transform: scale(0.2); } 12% { opacity: 1; transform: scale(1.6); } 100% { opacity: 0; transform: scale(16); } }
/* supernova : éclair blanc puis onde de choc qui traverse l'écran */
#nova { position: fixed; inset: 0; z-index: 440; pointer-events: none; }
#nova::before { content: ""; position: absolute; inset: 0; background: #fff6e8; opacity: 0; }
#nova::after { content: ""; position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 1px solid #fff; opacity: 0; }
body.nova #nova::before { animation: nova-flash 0.7s ease-out both; }
body.nova #nova::after { animation: nova-ring 1.5s cubic-bezier(.15, .6, .3, 1) both; }
@keyframes nova-flash { 0% { opacity: 0.6; } 100% { opacity: 0; } }
@keyframes nova-ring { 0% { opacity: 1; transform: scale(0.2); } 100% { opacity: 0; transform: scale(60); } }
/* traînée d'étoiles du curseur (canvas ajouté par script.js) */
#trail { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 455; pointer-events: none; }

/* ================= FINITIONS ================= */
::selection { background: var(--blue); color: #fff; }
html { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }

/* ================= VERSION IMPRIMABLE : une page propre, façon CV ================= */
/* nom → à propos → projets → contact ; tout ce qui est animé ou interactif disparaît */
@media print {
  @page { margin: 16mm; }
  html, body { background: #fff !important; color: #000 !important; overflow: visible !important; }
  body { display: flex; flex-direction: column; cursor: auto; }
  #loader, #bang-flash, #cursor, #confetti, #trail, #nova, #override, #bigword, #webgl, #hint, #scroll-bar, #dots,
  #scroll-spacer, #bottom, #ach-toast, #share-canvas, .top-nav, .panel-bar, .panel-sky, #about-stars, #contact-hole,
  .saturn, #panel-search, #panel-project, #panel-ach, #panel-help, .station .thumb, .station button, .station.end { display: none !important; }
  #top { position: static !important; order: 1; padding: 0 0 10mm; opacity: 1 !important; transform: none !important; }
  #top, #top * { color: #000 !important; }
  #panel-about { order: 2; } #showcase { order: 3; } #panel-contact { order: 4; }
  .panel { position: static !important; inset: auto; clip-path: none !important; visibility: visible !important; display: block !important; background: #fff !important; color: #000 !important; }
  .panel-scroll { overflow: visible !important; padding: 0 !important; }
  .about-grid, .panel-space .about-grid { display: block; margin: 0; }
  .about-text { font-size: 20pt; }
  .about-text .w span { transform: none !important; }
  .about-cols { margin-top: 6mm; }
  .facts div { border-top-color: #bbb; }
  .facts dt, .station .kicker, .station .stat { color: #555 !important; }
  .facts dd, .about-text, .about-text *, .station h2 { color: #000 !important; }
  .stack li { border-color: #999 !important; color: #000 !important; }
  #showcase { position: static !important; display: block; margin-top: 10mm; }
  .station { position: static !important; transform: none !important; opacity: 1 !important; max-width: none; margin: 0 0 7mm; break-inside: avoid; }
  .station h2 { font-size: 20pt; overflow: visible; line-height: 1.15; height: auto; }
  .station h2 .ch { transform: none !important; }
  .station .desc { color: #222 !important; max-width: none; }
  #panel-contact { margin-top: 6mm; }
  .contact-wrap { min-height: 0; }
  .contact-mail, #panel-contact .contact-mail { font-size: 18pt; mix-blend-mode: normal !important; color: #000 !important; }
  .socials a { border-color: #000 !important; color: #000 !important; }
  .socials a[href^="http"]::after { content: " · " attr(href); text-transform: none; }
}

/* étoiles filantes de l'accueil (canvas ajouté par script.js) : dans le ciel, derrière l'objet 3D */
#shooting { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
@media print { #shooting { display: none !important; } }

/* crédit des textures de Saturne (licence CC BY 4.0) */
.saturn figcaption { margin-top: 8px; font-size: 10px; color: #8c8c8c; text-align: right; }
.saturn figcaption a { text-decoration: underline; text-underline-offset: 2px; }

/* ================= SYSTÈME SOLAIRE DES PROJETS (touche P) ================= */
body.solar { overflow: hidden; }
body.solar #showcase, body.solar #dots, body.solar #scroll-bar, body.solar #hint, body.solar #bigword { opacity: 0 !important; pointer-events: none !important; }
#solar-ui { position: fixed; inset: 0; z-index: 9; pointer-events: none; opacity: 0; }
.solar-label { position: absolute; left: 0; top: 0; pointer-events: auto; padding: 6px 11px; border-radius: 999px; font-size: 11px; text-transform: uppercase; white-space: nowrap; color: #fff; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.2); transition: background .2s, color .2s, border-color .2s; }
.solar-label.on, .solar-label:hover, .solar-label:focus-visible { background: #fff; color: #000; border-color: #fff; }
body.no-webgl #solar-btn { display: none; }

@media print { #solar-ui, #solar-btn { display: none !important; } }

/* projet ouvert depuis le système solaire : la fiche apparaît en fondu, comme si on entrait dans la planète */
.panel.from-planet { clip-path: none; opacity: 0; transform: scale(1.04); transition: opacity .7s ease, transform .9s var(--ease-out); }
.panel.from-planet.open { opacity: 1; transform: none; }

/* « Planètes » : à côté du nom, en haut à gauche, dans le même style que les boutons du haut */
.top-left { display: flex; align-items: center; gap: 18px; } /* « Planètes » à droite du nom */
@media (max-width: 760px) { .top-left { display: grid; gap: 14px; justify-items: start; } } /* au téléphone, pas la place : dessous */
.solar-pill { height: 30px; padding: 0 12px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 30px; transition: background .25s, color .25s, border-color .25s; }
.solar-pill:hover, body.solar .solar-pill { background: var(--fg); color: var(--bg); border-color: var(--fg); }
@media print { .solar-pill { display: none !important; } }
