/* discover.nsi.xyz — base.css
   Squelette commun : tokens, grille, rythme, dock, transitions.
   Aucun style "branché" ici : les neuf thèmes réécrivent l'apparence
   via des sélecteurs du type [data-style="…"] .classe. */

:root {
  /* couleur */
  --bg: #EFEFF2;
  --surface: #FFFFFF;
  --ink: #15161A;
  --ink-soft: #5B5F6B;
  --accent: #2447F0;
  --accent-2: #FF4B1F;
  --line: #DEDFE5;

  /* forme & relief */
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 14px 34px -18px rgba(21, 22, 26, .45);

  /* typographie */
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* rythme */
  --gutter: clamp(20px, 5vw, 48px);
  --section-y: clamp(56px, 9vw, 104px);

  /* couleurs du code */
  --code-k: #2447F0;
  --code-f: #15161A;
  --code-s: #C2410C;
  --code-n: #7A3BE0;
  --code-c: #9AA0AE;
}

/* ---------- remise à plat ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  padding-bottom: 96px; /* place pour le dock */
  transition: background-color .3s ease, color .3s ease;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip:focus { left: 16px; top: 16px; }

.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 28px;
  padding-block: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  letter-spacing: -.01em;
}
.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent-2);
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: .95rem;
}
.masthead nav a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color .2s ease;
}
.masthead nav a:hover { color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
  padding-block: clamp(36px, 6vw, 80px) var(--section-y);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 6.6vw, 5.2rem);
  font-weight: 700;
  line-height: .96;
  letter-spacing: -.025em;
  text-wrap: balance;
  margin-top: 18px;
}
h1 em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  margin-top: 22px;
  font-size: clamp(1.02rem, 1.4vw, 1.15rem);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 56ch;
}

kbd, .lede code, .foot code, .reasons code, .hint code {
  font-family: var(--font-mono);
  font-size: .86em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
kbd { font-weight: 700; }

.hint {
  margin-top: 20px;
  font-size: .86rem;
  color: var(--ink-soft);
}

/* puce inspecteur — l'élément signature */
.inspector {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: .84rem;
  color: var(--ink-soft);
  box-shadow: var(--shadow);
}
.inspector code { background: none; border: none; padding: 0; font-size: 1em; }
.inspector b { color: var(--accent); font-weight: 700; }
.inspector .live {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 1.8s ease-in-out infinite;
}
.inspector-note {
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
@keyframes pulse { 50% { opacity: .3; } }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease,
              transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); }

/* ---------- spécimen de code ---------- */
.specimen {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.specimen-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.specimen pre {
  padding: 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .85rem;
  line-height: 1.75;
  tab-size: 4;
}
.specimen .k { color: var(--code-k); font-weight: 700; }
.specimen .f { color: var(--code-f); font-weight: 700; }
.specimen .s { color: var(--code-s); }
.specimen .n { color: var(--code-n); }
.specimen .c { color: var(--code-c); font-style: italic; }

/* ---------- sections ---------- */
.section {
  border-top: 1px solid var(--line);
  padding-block: var(--section-y);
  transition: border-color .3s ease;
}

.section-head {
  display: grid;
  gap: 14px;
  margin-bottom: clamp(30px, 4vw, 48px);
  max-width: 66ch;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.section-head p:not(.eyebrow) {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------- cartes du programme ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background-color .25s ease, border-color .25s ease,
              box-shadow .25s ease, transform .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.card p { color: var(--ink-soft); font-size: .96rem; }

.tags {
  list-style: none;
  padding: 0;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 6px;
}
.tag {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* ---------- bandeau projet ---------- */
.band {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(150px, auto) 1fr;
  gap: 8px 32px;
  align-items: baseline;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 38px);
  transition: background-color .3s ease, border-radius .3s ease;
}
.band-label {
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.band p:last-child { font-size: 1.04rem; line-height: 1.6; }

/* ---------- épreuve du bac ---------- */
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
  gap: 20px;
  counter-reset: none;
}
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.step-n {
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}
.step h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 12px;
  letter-spacing: -.015em;
}
.step .meta {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--accent-2);
  margin-top: 6px;
  font-weight: 700;
}
.step p:last-child {
  color: var(--ink-soft);
  margin-top: 14px;
  font-size: .97rem;
}

.note {
  margin-top: 28px;
  border-left: 3px solid var(--accent-2);
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: .95rem;
  max-width: 74ch;
  transition: border-color .3s ease;
}

/* ---------- raisons ---------- */
.reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px 44px;
}
.reasons div {
  border-top: 2px solid var(--ink);
  padding-top: 16px;
  transition: border-color .3s ease;
}
.reasons dt {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.reasons dd {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: .97rem;
}

/* ---------- pied de page ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding-block: 44px 40px;
  color: var(--ink-soft);
  font-size: .92rem;
  transition: border-color .3s ease;
}
.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 28px 40px;
}
.foot-label {
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 10px;
}
.foot kbd { background: var(--surface); }

/* ---------- dock des styles ---------- */
.dock {
  position: fixed;
  z-index: 60;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  gap: 4px;
  max-width: calc(100vw - 24px);
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  scrollbar-width: none;
  transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.dock::-webkit-scrollbar { display: none; }

.dock button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: .78rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease,
              border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.dock .key { font-weight: 700; }
.dock button:hover { color: var(--ink); background: var(--line); }
.dock button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

@media (max-width: 780px) {
  .dock .name { display: none; }
  .dock button { padding: 9px 11px; }
  .inspector-note { display: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
  .band { grid-template-columns: 1fr; }
}

/* ---------- accessibilité & transitions ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .card:hover, .btn:hover { transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: .32s;
    animation-timing-function: cubic-bezier(.4, 0, .2, 1);
  }
}
