/* Le site de Ferraille : les couleurs, les polices et l'écran du jeu (public/style.css). */
:root {
  --bg: #120d07;
  --bg-2: #1b140b;
  --panel: #20180d;
  --night: #0a0704;
  --line: #4a3618;
  --amber: #ffb43b;
  --amber-dim: #c98a2a;
  --text: #f1d9a8;
  --muted: #a8916b;
  --water: #8fd3c3;
  --paper: #e9dcbf;
  --ink: #2c2216;
  --radius: 4px;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'VT323', 'IBM Plex Mono', monospace;
  --hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --topbar: 56px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: var(--amber); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #ffc766; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

/* Les lignes de balayage du vieil écran, très discrètes (comme dans le jeu). */
.crt {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.14) 2px 3px);
  mix-blend-mode: multiply;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 80;
  padding: 8px 14px;
  background: var(--amber);
  color: var(--bg);
  font: 600 14px var(--mono);
  border-radius: var(--radius);
  text-decoration: none;
}
.skip:focus { top: 12px; color: var(--bg); }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

/* ─── Boutons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--amber);
  font: 600 15px/1.2 var(--mono);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.btn:hover { background: rgba(255, 180, 59, 0.08); border-color: var(--amber-dim); color: var(--amber); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--bg); }
.btn.primary:hover { background: #ffc766; border-color: #ffc766; color: var(--bg); }
.btn.big { min-height: 52px; padding: 14px 26px; font-size: 17px; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }

/* ─── La barre du haut ────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: calc(var(--topbar) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  transition: background-color 0.25s, box-shadow 0.25s;
}
.topbar-inner {
  height: var(--topbar);
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--gutter-r) 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topbar-brand {
  font: 400 22px/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  text-decoration: none;
  text-shadow: 0 0 12px rgba(255, 180, 59, 0.3);
}
.topbar-brand, .topbar-cta { opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s; }
/* Une fois l'accueil passé, la barre se pose sur la page sans filet : un fond, et une ombre douce. */
.topbar[data-hero-visible='false'] { background: rgba(18, 13, 7, 0.92); box-shadow: 0 10px 24px rgba(10, 7, 4, 0.45); }
@supports (backdrop-filter: blur(8px)) {
  .topbar[data-hero-visible='false'] { background: rgba(18, 13, 7, 0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}
.topbar[data-hero-visible='false'] .topbar-brand,
.topbar[data-hero-visible='false'] .topbar-cta { opacity: 1; visibility: visible; }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: rgba(18, 13, 7, 0.6); }
.lang button {
  min-width: 44px;
  min-height: 36px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}
.lang button + button { border-left: 1px solid var(--line); }
.lang button:hover { color: var(--amber); }
.lang button[aria-pressed='true'] { background: rgba(255, 180, 59, 0.14); color: var(--amber); }
.lang button:focus-visible { outline-offset: -3px; }

/* ─── L'accueil ───────────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  padding-top: calc(var(--topbar) + env(safe-area-inset-top, 0px) + 28px);
  background: radial-gradient(ellipse at 50% 0%, #2a1d0c 0%, var(--bg) 62%);
}
.hero-inner { display: grid; gap: 0; }
.hero-text { display: grid; justify-items: start; gap: 0; }
.eyebrow {
  font: 400 12px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.logo {
  margin: 6px 0 0 -0.04em;
  font: 400 clamp(68px, 19vw, 150px)/0.86 var(--display);
  color: var(--amber);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255, 180, 59, 0.35);
}
.tagline { margin-top: 10px; font: 400 16px/1.5 var(--mono); color: var(--muted); }
.teaser { margin-top: 18px; max-width: 30em; font: italic 400 17px/1.55 var(--sans); color: var(--text); }
.cta-row { margin-top: 26px; display: grid; gap: 12px; width: 100%; max-width: 340px; }
.cta-row .btn { justify-content: center; }
.cta-note { margin-top: 12px; font-size: 14px; color: var(--muted); }
.release { margin-top: 22px; display: grid; gap: 2px; padding-left: 12px; border-left: 2px solid var(--amber-dim); }
.release-date { font: 400 26px/1.1 var(--display); color: var(--text); letter-spacing: 0.02em; }
.release-platforms { font: 400 12px/1.6 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* L'horizon : sur téléphone et tablette, une bande entre le texte et la bande-annonce ; sur grand
   écran, le fond de tout l'accueil (site.js choisit la composition d'après sa taille). */
.horizon {
  width: 100%;
  height: 290px;
  order: 2;
  pointer-events: none;
  /* Le haut de la bande se fond dans la page : pas de bord net au-dessus du soleil. */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 32%);
  mask-image: linear-gradient(to bottom, transparent, #000 32%);
}
.hero { display: flex; flex-direction: column; }
.hero-inner { display: contents; }
.hero-text { order: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.trailer {
  order: 3;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 8px var(--gutter-r) 56px var(--gutter);
  background: linear-gradient(var(--night), var(--bg) 70%);
}

/* ─── La bande-annonce ────────────────────────────────────── */
.trailer { margin-bottom: 0; }
.trailer-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 180, 59, 0.05);
}
.trailer:not(.vertical) .trailer-frame { width: min(100%, calc(86svh * 16 / 9)); margin: 0 auto; }
.trailer.vertical .trailer-frame {
  aspect-ratio: 9 / 16;
  width: min(100%, calc(78svh * 9 / 16));
  margin: 0 auto;
}
.trailer-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.trailer-play {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  border: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(10, 7, 4, 0.72), rgba(10, 7, 4, 0.12) 60%);
  color: var(--text);
  font: 600 15px/1.3 var(--mono);
  cursor: pointer;
}
.trailer-play-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 180, 59, 0.92);
  color: var(--bg);
  box-shadow: 0 0 0 8px rgba(255, 180, 59, 0.18), 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s, background-color 0.15s;
}
.trailer-play-icon svg { width: 34px; height: 34px; fill: currentColor; margin-left: 4px; }
.trailer-play-label { padding: 4px 10px; background: rgba(10, 7, 4, 0.7); border-radius: var(--radius); }
.trailer-play:hover .trailer-play-icon { background: #ffc766; transform: scale(1.04); }
.trailer-play:focus-visible { outline-offset: -4px; }

/* ─── Sections ────────────────────────────────────────────── */
/* Les sections se suivent sans filet : l'espace et le fond suffisent à les séparer. */
.section { padding: 72px 0; }
.section h2 {
  font: 400 clamp(42px, 9vw, 64px)/0.95 var(--display);
  color: var(--amber);
  letter-spacing: 0.02em;
  text-shadow: 0 0 14px rgba(255, 180, 59, 0.18);
}
.section h3 { font: 400 28px/1.05 var(--display); color: var(--amber); letter-spacing: 0.02em; }

/* Le jeu */
.split { display: grid; gap: 40px; }
.prose { display: grid; gap: 18px; align-content: start; max-width: 38em; }
.prose h2 { margin-bottom: 6px; }
.prose p { font-size: 17px; }
.prose .aside {
  padding: 2px 0 2px 16px;
  border-left: 2px dotted var(--amber-dim);
  font: 400 22px/1.35 var(--hand);
  color: var(--amber-dim);
}
.illus { margin: 0; justify-self: center; width: min(100%, 520px); }
.illus img { width: 100%; height: auto; border-radius: 3px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); }
.illus figcaption.hand { margin-top: 14px; font: 400 22px/1.3 var(--hand); color: var(--amber-dim); }

/* Une réplique du jeu, telle quelle */
.replique { margin: 56px 0 0; padding: 0; max-width: 34em; }
.replique p { font: 400 clamp(30px, 5.4vw, 44px)/1.12 var(--display); color: var(--text); letter-spacing: 0.01em; text-wrap: balance; }
.replique footer { margin-top: 12px; font: 400 13px/1.5 var(--mono); letter-spacing: 0.08em; color: var(--muted); }

/* Trois lignes, deux visages */
.trois { background: linear-gradient(var(--bg), var(--night) 45%, var(--bg)); }
.trois-inner { display: grid; gap: 44px; align-items: center; }
.lignes { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; max-width: 30em; }
.lignes li { font: 400 clamp(25px, 4.4vw, 32px)/1.2 var(--display); color: var(--text); letter-spacing: 0.01em; text-wrap: balance; }
.lignes li::before { content: ''; display: block; width: 26px; height: 2px; margin-bottom: 12px; background: var(--amber-dim); opacity: 0.7; }
.visages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 460px; }
.visages img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); }
.visages img:nth-child(2) { margin-top: 36px; }

/* À écouter */
.pistes { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 14px; max-width: 640px; }
.piste { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: rgba(32, 24, 13, 0.55); }
.piste-btn {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--amber);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.piste-btn svg { width: 22px; height: 22px; fill: currentColor; }
.piste-btn .i-lire { margin-left: 3px; }
.piste-btn .i-pause, .piste.joue .piste-btn .i-lire { display: none; }
.piste.joue .piste-btn .i-pause { display: block; }
.piste-btn:hover, .piste.joue .piste-btn { background: rgba(255, 180, 59, 0.12); border-color: var(--amber-dim); }
.piste-corps { display: grid; gap: 6px; min-width: 0; }
.piste-titre { font: 400 26px/1 var(--display); color: var(--text); letter-spacing: 0.02em; }
.piste.joue .piste-titre { color: var(--amber); }
.piste-barre { position: relative; height: 22px; cursor: pointer; touch-action: none; }
.piste-barre::before { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: rgba(74, 54, 24, 0.9); border-radius: 1px; }
.piste-fait { position: absolute; left: 0; top: 10px; height: 2px; width: 0; background: var(--amber); border-radius: 1px; }
.piste-fait::after { content: ''; position: absolute; right: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); opacity: 0; transition: opacity 0.15s; }
.piste.joue .piste-fait::after, .piste-barre:hover .piste-fait::after, .piste-barre:focus-visible .piste-fait::after { opacity: 1; }
.piste-barre:focus-visible { outline-offset: 2px; }
.piste-temps { font: 400 12px/1.4 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }

/* Un mot de l'auteur */
.note { max-width: 36em; margin: 0 auto; display: grid; gap: 16px; }
.note p { font: italic 400 19px/1.65 var(--sans); color: var(--text); }
.note .signature { margin-top: 4px; font: 400 26px/1 var(--hand); font-style: normal; color: var(--amber-dim); }

/* Le carnet */
.carnet .lead { margin-bottom: 30px; }
.sketches { list-style: none; margin: 0; padding: 0; }
.sketches figure { margin: 0; }
.zoom { display: block; cursor: zoom-in; }
.zoom img { width: 100%; height: auto; }
/* Un croquis : le crayon seul, posé sur une page de carnet (papier et lignes). */
.paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent 22px, rgba(196, 92, 72, 0.28) 22px 23px, transparent 23px),
    repeating-linear-gradient(to bottom, transparent 0 25px, rgba(84, 110, 140, 0.16) 25px 26px);
  border-radius: 3px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 40px rgba(120, 90, 40, 0.18);
}
.sketches figcaption.hand {
  margin-top: 12px;
  font: 400 21px/1.25 var(--hand);
  color: var(--amber-dim);
}

/* Bande à faire défiler sur téléphone (les croquis). */
.strip {
  display: grid;
  grid-auto-flow: column;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--gutter-r)) 0 calc(-1 * var(--gutter));
  padding: 4px var(--gutter-r) 14px var(--gutter);
  scroll-padding: 0 var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.strip > li { scroll-snap-align: start; }
.sketches.strip { grid-auto-columns: min(80vw, 340px); }

.lead { margin-top: 14px; max-width: 34em; font-size: 18px; color: var(--text); }

/* La sortie */
.release-block { text-align: center; padding: 88px 0 96px; background: radial-gradient(ellipse at 50% 100%, #2a1d0c 0%, var(--bg) 65%); }
.release-block .container { display: grid; justify-items: center; gap: 18px; }
.release-block h2 { max-width: 12em; }
.release-block p:not(.eyebrow) { max-width: 30em; font-size: 17px; }
.release-block .btn { margin-top: 10px; }

/* Le pied */
.footer { padding: 32px 0 calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 14px; }
.footer-inner { display: grid; gap: 10px; }
.footer-brand { font: 400 32px/1 var(--display); color: var(--amber); letter-spacing: 0.08em; text-transform: uppercase; }
.footer-contact .mail { overflow-wrap: anywhere; }

/* ─── La visionneuse ──────────────────────────────────────── */
.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 6, 3, 0.94);
  color: var(--text);
}
.viewer::backdrop { background: rgba(8, 6, 3, 0.8); }
.viewer-body {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  padding: calc(56px + env(safe-area-inset-top, 0px)) var(--gutter-r) calc(14px + env(safe-area-inset-bottom, 0px)) var(--gutter);
}
.viewer-figure { margin: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; justify-items: center; }
.viewer-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; min-height: 0; border-radius: 4px; }
.viewer-img.on-paper { background: var(--paper); }
.viewer-caption { max-width: 40em; text-align: center; font-size: 15px; color: var(--text); }
.viewer-caption .hand-cap { font: 400 22px/1.25 var(--hand); color: var(--amber); }
.viewer-nav { display: flex; align-items: center; justify-content: center; gap: 18px; }
.viewer-count { min-width: 4em; text-align: center; font: 400 13px var(--mono); color: var(--muted); }
.viewer-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 13, 7, 0.8);
  color: var(--amber);
  cursor: pointer;
}
.viewer-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viewer-btn:hover { border-color: var(--amber-dim); background: rgba(255, 180, 59, 0.1); }
.viewer-close { position: absolute; top: calc(8px + env(safe-area-inset-top, 0px)); right: var(--gutter-r); }
body.viewing { overflow: hidden; }

/* ─── Tablette ────────────────────────────────────────────── */
@media (min-width: 640px) {
  .hero { padding-top: calc(var(--topbar) + 40px); }
  .topbar-brand { font-size: 30px; }
  .horizon { height: 330px; }
  .teaser { font-size: 19px; }
  .cta-row { display: flex; flex-wrap: wrap; max-width: none; }
  .sketches.strip { display: grid; grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; gap: 28px 22px; }
  .section { padding: 96px 0; }
  .trailer { padding-bottom: 72px; }
}

/* ─── Grand écran : la bande-annonce à droite, l'horizon en fond ─── */
@media (min-width: 1024px) {
  .hero { display: block; min-height: clamp(700px, 100svh, 980px); padding-top: calc(var(--topbar) + 56px); padding-bottom: 0; }
  .horizon { position: absolute; inset: 0; height: 100%; z-index: -1; -webkit-mask-image: none; mask-image: none; }
  .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    gap: 56px;
    max-width: 1160px;
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter-r);
    /* Le bas de l'accueil reste à l'horizon : la ville, le soleil, le sol. */
    padding-bottom: clamp(230px, 34svh, 330px);
  }
  .hero-text { padding: 0; max-width: none; }
  .trailer { padding: 0; background: none; max-width: none; }
  .to-trailer { display: none; }
  .logo { font-size: clamp(80px, 7.2vw, 104px); }
  .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 72px; align-items: start; }
  .illus { width: 100%; justify-self: end; margin-top: 12px; }
  .trois-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 72px; }
  .visages { justify-self: end; width: 100%; }
  .sketches.strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
  .sketches figcaption.hand { font-size: 20px; }
}

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