/* Palette Workbench 1.3 : bleu, blanc, noir, orange */
:root {
  --wb-blue: #0055aa;
  --wb-blue-dark: #003a77;
  --wb-white: #ffffff;
  --wb-black: #000022;
  --wb-orange: #ff8800;
  --ink: #e8f0ff;
  --muted: #a9c3e8;
  --pixel: "VT323", "Courier New", monospace;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
/* lien vers la version Amiga : masqué dès que ce CSS est appliqué */
.sans-css { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--wb-blue);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.55;
}
a { color: var(--wb-orange); }
a:hover { color: var(--wb-white); }
code { font-family: var(--mono); background: var(--wb-blue-dark); padding: 0 .3em; }

/* ---------- Barre de titre ---------- */
.wb-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: var(--wb-white); color: var(--wb-blue);
  font-family: var(--pixel); font-size: 1.35rem;
  padding: .1rem 1rem;
  border-bottom: 3px solid var(--wb-black);
}
.wb-bar nav { display: flex; gap: 1.2rem; }
.wb-bar a { color: var(--wb-blue); text-decoration: none; }
.wb-bar a:hover, .wb-bar a[aria-current="page"] { background: var(--wb-blue); color: var(--wb-white); }
.wb-bar .wb-title { padding: 0; }
.wb-bar .wb-title:hover { background: none; color: var(--wb-blue); }
.wb-bar nav a { padding: 0 .3rem; }
.hero.hero-small { min-height: 220px; }
.hero.hero-small .logo { font-size: clamp(2rem, 8vw, 5rem); }

/* ---------- Bandeau démo ---------- */
.hero {
  position: relative; overflow: hidden;
  background: #000;
  min-height: 340px;
  display: flex; flex-direction: column; justify-content: center;
}
#copper { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-content { position: relative; text-align: center; padding: 2rem 1rem 4rem; }
.logo {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 400;
  font-size: clamp(2.2rem, 10vw, 7.5rem);
  letter-spacing: .04em;
  line-height: 1;
  color: var(--wb-white);
  text-shadow: 4px 4px 0 var(--wb-orange), 8px 8px 0 var(--wb-black);
}
.tagline {
  font-family: var(--pixel); font-size: 1.5rem;
  color: var(--wb-white); margin: 1rem 0 0;
  text-shadow: 2px 2px 0 #000;
}
.scroller {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3rem; overflow: hidden;
  background: rgba(0,0,0,.65);
  border-top: 2px solid var(--wb-orange);
}
.scroller-text {
  position: absolute; white-space: nowrap; top: 50%;
  font-family: var(--pixel); font-size: 1.9rem; color: var(--wb-orange);
  will-change: transform;
}

/* ---------- Fenêtres façon Intuition ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 2.5rem 16px 1rem; }
.window {
  background: var(--wb-blue);
  border: 3px solid var(--wb-white);
  box-shadow: 6px 6px 0 var(--wb-black);
  margin-bottom: 2.5rem;
  scroll-margin-top: 3.5rem;
}
.window-title {
  display: flex; align-items: center; gap: .5rem;
  height: 1.9rem; padding: 0 .3rem;
  background: repeating-linear-gradient(0deg, var(--wb-white) 0 2px, var(--wb-blue) 2px 4px);
  border-bottom: 3px solid var(--wb-white);
}
.window-title .label {
  background: var(--wb-white); color: var(--wb-blue);
  font-family: var(--pixel); font-size: 1.45rem; line-height: 1.3;
  padding: 0 .5rem;
}
.window-title .gadget,
.window-title .depth {
  flex: none; width: 1.4rem; height: 1.2rem;
  background: var(--wb-white); border: 2px solid var(--wb-blue);
  position: relative;
}
.window-title .gadget::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: .45rem; height: .45rem; background: var(--wb-blue);
}
.window-title .depth { margin-left: auto; }
.window-title .depth::before,
.window-title .depth::after {
  content: ""; position: absolute; width: .65rem; height: .5rem; border: 2px solid var(--wb-blue);
}
.window-title .depth::before { top: 1px; left: 1px; }
.window-title .depth::after { bottom: 1px; right: 1px; background: var(--wb-blue); }
.window-body { padding: 1.4rem; }

/* ---------- Filtres ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.4rem; }
.btn {
  font-family: var(--pixel); font-size: 1.3rem;
  background: var(--wb-blue); color: var(--wb-white);
  border: 2px solid; border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
  padding: .1rem .9rem; cursor: pointer;
}
.btn:hover { background: var(--wb-blue-dark); }
.btn[aria-pressed="true"], .btn:active {
  background: var(--wb-orange); color: var(--wb-black);
  border-color: var(--wb-black) var(--wb-white) var(--wb-white) var(--wb-black);
}

/* ---------- Cartes programmes ---------- */
.grid {
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card {
  background: var(--wb-blue-dark);
  border: 2px solid var(--wb-white);
  display: flex; flex-direction: column;
}
.shot {
  aspect-ratio: 320 / 256;
  width: 100%; display: block; object-fit: contain;
  image-rendering: pixelated;
  border-bottom: 2px solid var(--wb-white);
  background: #000;
}
.card-body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card h3 { overflow-wrap: anywhere; margin: 0; font-family: var(--pixel); font-weight: 400; font-size: 1.8rem; line-height: 1.1; color: var(--wb-white); }
.meta { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .8rem; }
.tag { background: var(--wb-white); color: var(--wb-blue); padding: 0 .45rem; font-weight: 600; }
.tag.type { background: var(--wb-orange); color: var(--wb-black); }
.card p { margin: 0; color: var(--ink); font-size: .92rem; }
.actions { margin-top: auto; padding-top: .6rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.actions a { text-decoration: none; display: inline-block; }
.empty { font-family: var(--pixel); font-size: 1.4rem; }

/* ---------- Texte ---------- */
.prose { max-width: 70ch; }
.prose h3 { font-family: var(--pixel); font-weight: 400; font-size: 1.7rem; color: var(--wb-white); margin: 1.4rem 0 .4rem; }
.contact-mail { font-family: var(--pixel); font-size: clamp(1.4rem, 6vw, 2rem); overflow-wrap: anywhere; }

/* ---------- Pied de page ---------- */
.footer { text-align: center; padding: 1rem 16px 2rem; color: var(--muted); font-size: .8rem; }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .wb-bar { flex-direction: column; align-items: flex-start; gap: 0; font-size: 1.15rem; }
  .wb-bar nav { gap: .9rem; }
  .grid { grid-template-columns: 1fr; }
  .window-body { padding: 1rem; }
  .hero { min-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Blagues ---------- */
.blagues p { margin: 0 0 .8rem; }

/* Faux Guru Meditation */
.guru {
  position: fixed; inset: 0; z-index: 100;
  background: #000; color: #ff2200;
  font-family: "Topaz", var(--pixel); font-size: clamp(1rem, 3.2vw, 1.9rem);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  cursor: pointer; padding: 0;
}
.guru[hidden] { display: none; }
.guru-box {
  width: 100%; text-align: center; padding: 1.2em 1rem;
  border: .35em solid #ff2200; line-height: 1.5;
  animation: guru-blink 1.2s steps(1) infinite;
}
.guru-box p { margin: 0; }
@keyframes guru-blink { 50% { border-color: #000; } }
.guru-joke { margin-top: auto; padding: 1.5rem 16px; color: #777; font-size: .7em; text-align: center; opacity: 0; transition: opacity .6s; }
.guru-joke.show { opacity: 1; }

/* Faux requester */
.req-back {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 20, 60, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.req-back[hidden] { display: none; }
.req { width: min(440px, 100%); margin: 0; position: relative; }
.req p { font-family: var(--pixel); font-size: 1.45rem; line-height: 1.25; text-align: center; margin: .2rem 0 1.4rem; }
.req strong { color: var(--wb-orange); font-weight: 400; }
.req-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; position: relative; padding: 2rem 0; margin: -1.4rem 0 -1rem; }
#reqCancel { transition: transform .15s ease-out; }
.window-title button.gadget { padding: 0; cursor: pointer; font: inherit; }
.window-title button.gadget:hover::after, .window-title button.gadget:focus-visible::after { background: var(--wb-orange); }
.window-title button.gadget:active { background: var(--wb-blue); }
.window-title button.gadget:active::after { background: var(--wb-white); }

@media (prefers-reduced-motion: reduce) {
  .guru-box { animation: none; }
  #reqCancel { transition: none; }
}

/* ---------- Versions ---------- */
.tag.ver-tag { background: var(--wb-black); color: var(--wb-orange); border: 1px solid var(--wb-orange); }
.downloads { margin-top: auto; padding-top: .6rem; display: flex; flex-direction: column; gap: .8rem; }
.downloads .actions { margin-top: 0; padding-top: 0; }
.dl-head { display: flex; gap: .4rem; align-items: center; margin-bottom: .35rem; font-size: .8rem; }
.ver { font-family: var(--pixel); font-size: 1.25rem; color: var(--wb-white); line-height: 1; }
.var { background: var(--wb-orange); color: var(--wb-black); font-weight: 600; padding: 0 .4rem; }
.notes { font-size: .82rem !important; color: var(--muted) !important; margin: .35rem 0 0 !important; }
.pre { border: 1px dashed var(--wb-orange); color: var(--wb-orange); padding: 0 .4rem; }
.btn-small { font-size: 1.05rem; padding: 0 .6rem; }
.history { margin-top: .9rem; border-top: 2px dotted var(--wb-blue); padding-top: .6rem; }
.history summary { cursor: pointer; font-family: var(--pixel); font-size: 1.25rem; color: var(--wb-orange); list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.history summary::before { content: "▸ "; }
.history[open] summary::before { content: "▾ "; }
.history ul { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.history li { padding-left: .6rem; border-left: 2px solid var(--wb-blue); }

/* ---------- Choix plateforme / version ---------- */
.picker { display: flex; flex-direction: column; gap: .7rem; border: 2px solid var(--wb-white); padding: .8rem; background: var(--wb-blue); }
.pick-field { display: flex; flex-direction: column; gap: .2rem; }
.pick-field[hidden] { display: none; }
.pick-field label { font-family: var(--pixel); font-size: 1.15rem; color: var(--wb-orange); line-height: 1; }
.picker select {
  font-family: var(--pixel); font-size: 1.3rem; width: 100%;
  background: var(--wb-white); color: var(--wb-blue);
  border: 2px solid; border-color: var(--wb-white) var(--wb-black) var(--wb-black) var(--wb-white);
  padding: .1rem .4rem; border-radius: 0; cursor: pointer;
}
.picker select:focus-visible { outline: 2px solid var(--wb-orange); outline-offset: 2px; }
.pick-result { border-top: 2px dotted var(--wb-white); padding-top: .7rem; }
.archive { border-top: 2px dotted var(--wb-white); padding-top: .7rem; }
.archive .ver { font-size: 1.1rem; color: var(--wb-orange); }
