/* NovaEmu, site public, en pages.
   Direction : précis, joueur, honnête. Monde : consoles portables, écrans allumés dans le noir, touches de clavier.
   Couleur de marque : le lavande de l'interface NovaEmu (#bcacff). Les illustrations de consoles portent la couleur. */

@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }

:root {
  --bg-deep: #06070b;
  --bg: #090b11;
  --card: #10131a;
  --raised: #181c25;
  --line: rgba(236, 239, 245, 0.07);
  --line-strong: rgba(236, 239, 245, 0.13);
  --text: #eceff5;
  --text-2: #a2a8b6;
  --muted: #838a9c;
  --accent: #bcacff;
  --accent-hover: #cbbeff;
  --accent-ink: #16122a;

  --sans: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: 40px;
  --bar: 64px;
  --pager: 56px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden;
  display: grid; grid-template-rows: var(--bar) minmax(0, 1fr) var(--pager);
  height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
b { font-weight: 500; color: var(--text); }
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
h1:focus, h2:focus { outline: none; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
.mono { color: var(--text); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.skip { position: absolute; left: 16px; top: -48px; z-index: 30; padding: 8px 12px; border-radius: 8px; background: var(--text); color: var(--bg); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Barre du haut ---------- */
.bar {
  position: relative; z-index: 10;
  display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 17px; font-weight: 600; }
.mark { width: 24px; height: 24px; flex: none; }
.mark rect { fill: var(--accent); }
.mark path { fill: none; stroke: var(--accent-ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.menu { display: flex; gap: 2px; margin: 0 auto; }
.menu a {
  position: relative; padding: 6px 12px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; font-size: 14px;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.menu a:hover { color: var(--text); background: var(--raised); }
.menu a[aria-current="page"] { color: var(--text); background: var(--raised); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.menu-btn { display: none; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent;
  font: 500 15px/1 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--raised); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; border-radius: 8px; }
.btn-meta { font: 400 13px/1 var(--mono); opacity: 0.7; }

/* ---------- Pages ---------- */
.pages { position: relative; overflow: hidden; }
.page {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 32px var(--gutter);
}
.page[hidden] { display: none; }
.page.entering .inner { animation: enter 420ms var(--ease) both; }
.page.entering.back .inner { animation-name: enter-back; }
@keyframes enter { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
.inner { width: 100%; max-width: 1200px; margin: auto; }

.head { max-width: 46rem; margin-bottom: 32px; }
.head h2 { font-size: clamp(30px, 3.2vw, 40px); line-height: 1.12; letter-spacing: -0.02em; }
.head p { margin-top: 12px; font-size: 17px; line-height: 27px; color: var(--text-2); }
.meta { font: 400 13px/20px var(--mono); color: var(--muted); }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.panel h3 { font-size: 17px; }

/* ---------- 1. Accueil ---------- */
.home { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: center; gap: 64px; }
.home h1 { margin-top: 16px; font-size: clamp(40px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -0.03em; }
.lead { margin-top: 24px; max-width: 34rem; font-size: 18px; line-height: 28px; color: var(--text-2); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.figures { display: flex; gap: 40px; margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--line); max-width: 34rem; }
.figures dt { font-size: 13px; color: var(--muted); }
.figures dd { margin: 4px 0 0; font-size: 22px; font-weight: 500; }

.device { margin: 0; justify-self: center; width: 100%; max-width: 440px; }
.device-body { position: relative; }
.device-body::after {
  content: ""; position: absolute; left: 12%; right: 12%; bottom: -2%; height: 6%; z-index: -1;
  border-radius: 50%; background: rgba(0, 0, 0, 0.55); filter: blur(18px);
}
.device img { width: 100%; height: auto; max-height: calc(100dvh - var(--bar) - var(--pager) - 120px); object-fit: contain; }
.screen { position: absolute; image-rendering: pixelated; border-radius: 1px; background: #0e1a33; }
/* Positions des écrans sur l'illustration (unités de la coque NovaEmu, marge 24 comprise : 468 × 544). */
.screen-top { left: 15.81%; top: 8.09%; width: 68.38%; height: 35.29%; }
.screen-bottom { left: 22.65%; top: 53.68%; width: 54.70%; height: 35.29%; cursor: crosshair; touch-action: none; }
.device figcaption { margin-top: 20px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- 2. Consoles ---------- */
.consoles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.console { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--card); transition: border-color 150ms var(--ease); }
.console:hover { border-color: var(--line-strong); }
.console img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.console-text { padding: 14px 16px 16px; }
.console h3 { font-size: 16px; }
.engine { margin-top: 2px; font-size: 14px; color: var(--text-2); }
.engine span { font: 400 12px/1 var(--mono); color: var(--muted); }
.formats { margin-top: 10px; font: 400 12px/18px var(--mono); color: var(--text); }
.need { margin-top: 4px; font-size: 13px; line-height: 19px; color: var(--muted); }
.console-note { display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: 20px; background: transparent; border-style: dashed; }
.console-note p { font-size: 14px; line-height: 21px; color: var(--text-2); }

/* ---------- 3. Installer ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.step-n {
  display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 6px;
  font: 500 13px/1 var(--mono); border: 1px solid var(--line-strong); border-radius: 8px; background: var(--raised);
}
.steps h3 { font-size: 17px; }
.steps p { font-size: 15px; line-height: 23px; color: var(--text-2); }
.steps .btn { margin-top: auto; }
.specs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 16px; }
.specs dl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 0; }
.specs dt { font-size: 12px; color: var(--muted); }
.specs dd { margin: 4px 0 0; font-size: 14px; line-height: 20px; }
.hash { display: flex; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.hash-label { font-size: 12px; color: var(--muted); flex: none; }
.hash code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12px; color: var(--text-2); }
.copy {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; flex: none;
  border: 1px solid var(--line); border-radius: 8px; background: var(--raised);
  color: var(--text-2); font: 400 13px/1 var(--sans); cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.copy .icon { width: 16px; height: 16px; }
.copy:hover { color: var(--text); background: #212633; }

/* ---------- 4. Commandes ---------- */
.keys-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.keys { margin: 12px 0 0; padding: 0; list-style: none; }
.keys li { display: grid; grid-template-columns: 172px 1fr; align-items: center; gap: 16px; min-height: 48px; border-top: 1px solid var(--line); }
.keys li > span:last-child { font-size: 15px; color: var(--text-2); }
.keys li > kbd { justify-self: start; }
.kbd-group { display: flex; flex-wrap: wrap; gap: 4px; }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 28px; padding: 0 8px;
  font: 500 12px/1 var(--mono); color: var(--text);
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 6px;
  box-shadow: 0 2px 0 var(--bg-deep), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---------- 5. Bon à savoir ---------- */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.facts p { margin-top: 8px; font-size: 15px; line-height: 24px; color: var(--text-2); }

/* ---------- 6. Aide ---------- */
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; align-items: start; }
.faq details { border-top: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; padding: 12px 0; cursor: pointer; list-style: none; font-size: 16px; font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin-right: 6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform 180ms var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq details p { padding: 0 0 20px; font-size: 15px; line-height: 24px; color: var(--text-2); }
.faq a, .credits a { color: var(--accent); text-underline-offset: 3px; }

/* ---------- 7. Licences ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-size: 13px; font-weight: 400; color: var(--muted); }
tbody th { font-weight: 500; }
td { color: var(--text-2); }
td.mono { font-size: 13px; color: var(--text); }
.credits a { color: var(--text-2); text-decoration-color: var(--line-strong); }
.credits a:hover { color: var(--text); }
.legal { margin-top: 24px; max-width: 52rem; font-size: 13px; line-height: 20px; color: var(--muted); }

/* ---------- Barre des pages ---------- */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 0 var(--gutter); border-top: 1px solid var(--line);
}
.pager-btn {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), opacity 150ms var(--ease);
}
.pager-btn:hover:not(:disabled) { color: var(--text); background: var(--raised); }
.pager-btn:disabled { opacity: 0.35; cursor: default; }
.dots { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dots li { width: 6px; height: 6px; border-radius: 3px; background: var(--line-strong); transition: width 220ms var(--ease), background-color 220ms var(--ease); }
.dots li.on { width: 20px; background: var(--accent); }
.pager-label { min-width: 150px; font-size: 13px; color: var(--muted); }
.pager-num { font-family: var(--mono); color: var(--text-2); }
.pager-hint { position: absolute; right: var(--gutter); display: flex; gap: 4px; }
.pager-hint kbd { min-width: 26px; height: 24px; font-size: 11px; color: var(--muted); }

/* ---------- Page introuvable ---------- */
.missing { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; padding: 24px; }
body:has(.missing) { display: block; overflow: auto; }
.missing h1 { font-size: 36px; line-height: 1.15; }
.missing p:not(.meta) { color: var(--text-2); }
.missing .btn { margin-top: 16px; }

/* ---------- Écrans moyens ---------- */
@media (max-width: 1180px) {
  :root { --gutter: 24px; }
  .menu a { padding: 6px 9px; }
  .consoles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .specs dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-height: 860px) and (min-width: 961px) {
  .head { margin-bottom: 20px; }
  .head h2 { font-size: 32px; }
  .head p { margin-top: 8px; font-size: 16px; line-height: 24px; }
  .page { padding-top: 20px; padding-bottom: 20px; }
  .console img { aspect-ratio: 5 / 2; }
  .console-text { padding: 10px 14px 12px; }
  .formats { margin-top: 6px; }
  .figures { margin-top: 32px; }
  .steps li { padding: 20px; }
  .keys li { min-height: 42px; }
}

/* ---------- Petits écrans : menu replié, pages défilables ---------- */
@media (max-width: 960px) {
  :root { --gutter: 20px; --pager: 60px; }
  .menu-btn {
    display: grid; place-items: center; width: 40px; height: 40px; margin-left: 0;
    border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer;
  }
  .menu-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
  .bar-cta { margin-left: auto; }
  .menu {
    position: absolute; left: 0; right: 0; top: var(--bar); margin: 0;
    flex-direction: column; gap: 2px; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-4px); visibility: hidden; pointer-events: none;
    transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 0s 180ms;
  }
  .menu a { padding: 12px; font-size: 16px; }
  .bar.open .menu { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .home { grid-template-columns: 1fr; gap: 32px; }
  .device { max-width: 300px; }
  .device img { max-height: none; }
  .consoles, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specs dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faq, .keys-grid, .facts { grid-template-columns: 1fr; }
  .pager-hint { display: none; }
}
@media (max-width: 600px) {
  .home h1 { font-size: 38px; }
  .lead { font-size: 17px; line-height: 26px; }
  .actions .btn { width: 100%; }
  .figures { gap: 24px; }
  .consoles, .steps { grid-template-columns: 1fr; }
  .console { display: grid; grid-template-columns: 120px 1fr; }
  .console img { height: 100%; aspect-ratio: auto; }
  .console-note { display: flex; }
  .keys li { grid-template-columns: 1fr; gap: 6px; padding: 12px 0; }
  .hash { flex-wrap: wrap; }
  .dots { display: none; }
  th, td { padding: 12px 14px; }
  .credits td:last-child, .credits th:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
