/* ═══════════════════════════════════════════════════════════
   TERMINAL-V1 — feuille de style canonique
   NE PAS MODIFIER en dehors des tokens :root (écrits par bake.mjs).
   ═══════════════════════════════════════════════════════════ */

:root {
  --ink-rgb: 220, 228, 210;
  --bg: #0b0d0a;
  --ink: #dce4d2;
  --muted: #7a8470;
  --surface: #121510;
  --line: rgba(var(--ink-rgb), 0.12);
  --panel: #10140e;

  --accent: #f1e2b8;
  --accent-ink: #1a1915;

  --sans: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(18px, 3.6vw, 56px);
  --t-xl: clamp(40px, 7.6vw, 118px);
  --t-l: clamp(28px, 4vw, 58px);
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-inout: cubic-bezier(0.77, 0, 0.175, 1);
}
html[data-theme="light"] {
  --ink-rgb: 18, 22, 14;
  --bg: #eef1e8;
  --ink: #12160e;
  --muted: #5c6454;
  --surface: #ffffff;
  --line: rgba(var(--ink-rgb), 0.12);
  --panel: #f7f8f2;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.35;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
h1, h2, h3 { font-weight: 400; }
mark { background: none; color: inherit; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.45; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 300; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; }
.skip:focus { left: 12px; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.si-loader {
  position: fixed; inset: 0; z-index: 400;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--bg);
  transition: clip-path .9s var(--ease-inout);
  clip-path: inset(0 0 0 0);
}
.si-loader p { font-family: var(--mono); font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; }
.si-loader span { width: 140px; height: 1px; background: var(--line); overflow: hidden; }
.si-loader i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease-out); }
.si-loader.run i { transform: scaleX(1); }
.si-loader.out { clip-path: inset(0 0 100% 0); }

.scene { position: relative; height: calc(var(--len, 2) * 100vh); }
.sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.rv { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: calc(var(--i, 0) * 60ms); }
.rv.in { opacity: 1; transform: none; }

/* HUD */
.tm-hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 120;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transform: translateY(-100%); transition: transform .55s var(--ease-out);
}
body.is-ready .tm-hud { transform: none; }
.tm-hud-mid { opacity: .55; }
.tm-hud .mono { font-size: 10px; letter-spacing: 0.14em; }

.tm-bar {
  position: fixed; top: 34px; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  transform: translateY(-120%); transition: transform .65s var(--ease-out) .05s;
}
body.is-ready .tm-bar { transform: none; }
.tm-wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.16em;
}
.tm-wordmark i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent);
  animation: tm-pulse 2.4s ease-out infinite;
}
@keyframes tm-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.tm-nav { display: flex; gap: 26px; }
.tm-nav a { opacity: .7; transition: opacity .3s; }
.tm-nav a:hover { opacity: 1; }
.tm-cta {
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; white-space: nowrap;
  transition: transform .35s var(--ease-out), background .3s;
}
.tm-cta:hover { transform: translateY(-2px); }

/* HERO */
.tm-hero .sticky {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  background: var(--bg);
}
.tm-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, #000 20%, transparent 75%);
}
.tm-hero-panel {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: center;
  padding: 12vh var(--gutter) 8vh;
  border-right: 1px solid var(--line);
}
.tm-kicker { margin-bottom: 18px; }
.tm-boot { margin-bottom: 28px; min-height: 4.2em; }
.tm-boot-line {
  opacity: 0; transform: translateY(6px);
  color: var(--muted); text-transform: none; letter-spacing: 0.02em; font-size: 12px;
}
body.is-ready .tm-boot-line { opacity: 1; transform: none; transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
body.is-ready .tm-boot-line:nth-child(2) { transition-delay: .12s; }
body.is-ready .tm-boot-line:nth-child(3) { transition-delay: .24s; color: var(--accent); }
.tm-title { font-size: var(--t-xl); line-height: 0.96; letter-spacing: -0.04em; margin-bottom: 22px; }
.tm-title span { display: block; }
.tm-title em { font-style: normal; color: var(--muted); }
body:not(.static) .tm-title span { opacity: 0; transform: translateY(36%); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
body.is-ready .tm-title span { opacity: 1; transform: none; }
body.is-ready .tm-l2 { transition-delay: .1s; }
.tm-prompt { display: flex; align-items: center; gap: 4px; margin-bottom: 18px; text-transform: none; letter-spacing: 0; font-size: 13px; }
.tm-prompt-user { color: var(--accent); }
.tm-prompt-sep, .tm-prompt-sym { color: var(--muted); }
.tm-prompt-path { color: var(--ink); }
.tm-cursor {
  width: 8px; height: 1.05em; background: var(--accent);
  animation: tm-blink 1.05s steps(1) infinite;
}
@keyframes tm-blink { 50% { opacity: 0; } }
.tm-pos { max-width: 28ch; color: var(--muted); font-size: 16px; }
.tm-hero-scan {
  position: relative; overflow: hidden; background: var(--panel);
}
.tm-hero-scan img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
  transform: scale(1.08); will-change: transform;
}
.tm-hero-scan::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.08) 2px 3px
  );
  opacity: .45;
}

/* MANIFESTO */
.tm-manifesto .sticky {
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter); background: var(--bg);
}
.tm-code { color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 12px; margin-bottom: 18px; }
.tm-code-end { margin-top: 18px; margin-bottom: 0; }
.tm-cmt { color: color-mix(in srgb, var(--muted) 80%, var(--accent)); }
.tm-key { color: var(--accent); }
.tm-str { color: var(--ink); }
.tm-man-text {
  font-size: clamp(28px, 4.2vw, 54px); line-height: 1.15; letter-spacing: -0.03em;
  max-width: 22ch;
}
.tm-mark {
  box-shadow: inset 0 -0.35em 0 color-mix(in srgb, var(--accent) 55%, transparent);
  padding: 0 .08em;
}

/* PROOF */
.tm-proof { padding: 18vh var(--gutter) 14vh; border-top: 1px solid var(--line); }
.tm-head { margin-bottom: 48px; max-width: 40rem; }
.tm-h2 { font-size: var(--t-l); letter-spacing: -0.03em; margin: 10px 0 12px; }
.tm-sub { color: var(--muted); max-width: 40ch; }
.tm-bento {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  grid-template-rows: auto auto; gap: 14px;
}
.tm-mod {
  background: var(--panel); border: 1px solid var(--line);
  padding: 14px; min-height: 220px;
  display: flex; flex-direction: column; gap: 12px;
}
.tm-big { grid-column: span 2; }
.tm-tall { grid-row: span 2; min-height: 460px; }
.tm-mod-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.tm-mod-img { flex: 1; overflow: hidden; border: 1px solid var(--line); background: #000; }
.tm-mod-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.35); }
.tm-mod-title { font-size: 28px; letter-spacing: -0.03em; }
.tm-ls { border-top: 1px solid var(--line); }
.tm-ls-row {
  display: grid; grid-template-columns: 40px 1fr auto 72px;
  gap: 16px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.tm-ls-name { font-size: 22px; letter-spacing: -0.02em; }
.tm-ls-thumb { width: 72px; height: 48px; overflow: hidden; border: 1px solid var(--line); }
.tm-ls-thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.4); }

/* MOTTO / FLAGS */
.tm-motto .sticky {
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter); background: var(--panel);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.tm-motto-kicker { margin-bottom: 36px; }
.tm-flags { display: grid; gap: 22px; }
.tm-flag {
  display: grid; grid-template-columns: minmax(120px, 180px) minmax(140px, 1fr) 1.4fr;
  gap: 18px; align-items: baseline;
  opacity: 0.18; transform: translateX(-12px);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
}
.tm-flag.on { opacity: 1; transform: none; }
.tm-flag-key { color: var(--accent); text-transform: none; letter-spacing: 0.02em; font-size: 13px; }
.tm-flag-word { font-size: clamp(36px, 5vw, 72px); letter-spacing: -0.04em; line-height: 1; }
.tm-flag-hint { text-transform: none; letter-spacing: 0; font-size: 13px; }

/* PIPELINE */
.tm-intro { padding: 16vh var(--gutter) 6vh; }
.tm-intro-line { font-size: var(--t-l); letter-spacing: -0.03em; margin-bottom: 28px; }
.tm-accent { color: var(--accent); }
.tm-band { border: 1px solid var(--line); overflow: hidden; max-height: 42vh; }
.tm-band img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.8); }
.tm-pipe .sticky {
  display: flex; flex-direction: column;
  padding: 10vh var(--gutter) 8vh; background: var(--bg);
}
.tm-pipe-chrome {
  display: flex; justify-content: space-between;
  padding: 10px 14px; border: 1px solid var(--line); border-bottom: 0;
  background: var(--panel); color: var(--muted); font-size: 11px;
}
.tm-pipe-body {
  flex: 1; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 0;
  border: 1px solid var(--line); min-height: 0;
}
.tm-pipe-list { padding: 28px; position: relative; }
.tm-pipe-step {
  position: absolute; left: 28px; right: 28px; top: 28px;
  opacity: 0; visibility: hidden;
}
.tm-pipe-step h3 { font-size: clamp(34px, 4.5vw, 64px); letter-spacing: -0.035em; margin: 8px 0 12px; }
.tm-pipe-step p { color: var(--muted); max-width: 34ch; }
.tm-log-line { margin-top: 22px; color: var(--accent); text-transform: none; letter-spacing: 0; font-size: 12px; }
.tm-console {
  border-left: 1px solid var(--line); padding: 22px;
  background: #070907; font-family: var(--mono); font-size: 12px;
}
.tm-console-out { margin-top: 14px; color: var(--muted); text-transform: none; letter-spacing: 0; line-height: 1.7; min-height: 8em; }
.tm-console-out .ok { color: var(--accent); display: block; }
.tm-step-cta {
  align-self: flex-start; margin-top: 18px;
  border: 1px solid var(--line); padding: 12px 18px;
  opacity: 0; pointer-events: none;
  transition: opacity .4s, border-color .3s, color .3s;
}
.tm-step-cta:hover { border-color: var(--accent); color: var(--accent); }

/* QUOTE */
.tm-quote { padding: 18vh var(--gutter); border-top: 1px solid var(--line); }
.tm-q { font-size: clamp(26px, 3.4vw, 44px); letter-spacing: -0.03em; line-height: 1.2; max-width: 18ch; margin: 18px 0 28px; }
.tm-sign { display: flex; flex-wrap: wrap; gap: 18px 40px; align-items: baseline; }
.tm-author { font-size: 16px; }
.tm-fig { font-family: var(--mono); font-size: clamp(40px, 6vw, 80px); letter-spacing: -0.04em; color: var(--accent); line-height: 1; }
.tm-fig-unit { font-size: .4em; margin-left: .15em; color: var(--muted); }

/* OBJECTIONS */
.tm-obj .sticky {
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--gutter); background: var(--panel);
}
.tm-obj-list { display: grid; gap: 16px; margin-bottom: 36px; }
.tm-obj-list li {
  display: flex; gap: 16px; align-items: baseline;
  font-size: clamp(22px, 3vw, 36px); letter-spacing: -0.025em;
  opacity: 0; transform: translateY(16px);
}
.tm-rej { color: color-mix(in srgb, #ff6b5a 80%, var(--ink)); font-size: 11px; }
.tm-finale { font-size: clamp(28px, 4vw, 52px); letter-spacing: -0.03em; opacity: 0; }
.tm-pill {
  display: inline-block; padding: 0 .2em;
  background: var(--accent); color: var(--accent-ink);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* FOOTER */
.tm-footer {
  padding: 16vh var(--gutter) 48px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.tm-mail {
  display: inline-block; margin: 16px 0;
  font-size: clamp(28px, 5vw, 64px); letter-spacing: -0.035em;
  border-bottom: 1px solid var(--line);
}
.tm-mail:hover { border-color: var(--accent); color: var(--accent); }
.tm-book {
  display: inline-flex; margin: 22px 0 40px; padding: 12px 18px;
  background: var(--accent); color: var(--accent-ink);
}
.tm-giant {
  font-size: clamp(28px, 6vw, 88px); letter-spacing: -0.04em;
  color: color-mix(in srgb, var(--ink) 22%, transparent);
  margin: 8vh 0 6vh; white-space: nowrap; overflow: hidden;
}
.tm-bottom {
  display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between;
  border-top: 1px solid var(--line); padding-top: 22px;
}
.tm-bottom a { margin-right: 14px; }

@media (max-width: 960px) {
  .tm-hero .sticky { grid-template-columns: 1fr; }
  .tm-hero-panel { border-right: 0; border-bottom: 1px solid var(--line); padding-top: 16vh; }
  .tm-hero-scan { min-height: 42vh; }
  .tm-bento { grid-template-columns: 1fr 1fr; }
  .tm-big, .tm-tall { grid-column: span 1; grid-row: span 1; min-height: 240px; }
  .tm-flag { grid-template-columns: 1fr; gap: 6px; }
  .tm-pipe-body { grid-template-columns: 1fr; }
  .tm-console { border-left: 0; border-top: 1px solid var(--line); min-height: 120px; }
  .tm-nav { display: none; }
  .tm-hud-mid { display: none; }
  .tm-ls-row { grid-template-columns: 32px 1fr; }
  .tm-ls-meta, .tm-ls-thumb { display: none; }
}
@media (max-width: 520px) {
  .tm-bento { grid-template-columns: 1fr; }
  .tm-bar { top: 30px; }
}

body.static .tm-flag,
body.static .tm-obj-list li,
body.static .tm-finale,
body.static .tm-step-cta { opacity: 1; transform: none; visibility: visible; pointer-events: auto; }
body.static .tm-pipe-step { position: relative; left: auto; right: auto; top: auto; opacity: 1; visibility: visible; margin-bottom: 28px; }
body.static .tm-cursor { animation: none; }
