/* =========================================================
   degree 9 — feuille de style « terminal »
   Tout le site adopte l'aspect d'une fenêtre de terminal :
   fond sombre, monospace, invites de commande.
   Lisibilité préservée : corps à 15px, interligne 1.7,
   largeur de ligne limitée, contrastes AA.
   ========================================================= */

/* Polices auto-hébergées (aucune requête vers un tiers).
   Fichiers JetBrains Mono récupérés depuis Google Fonts. */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;

  --bg:          #0d0e12;
  --surface:     #14161b;
  --surface-alt: #191c22;
  --border:      #2a2e37;
  --border-soft: #21242c;

  --text:        #d8dbe2;
  --text-soft:   #a6abb5;
  --text-faint:  #717885;

  --accent:      #ff7a3c;   /* orange degree 9 */
  --green:       #5dc27a;   /* invite de commande */
  --cyan:        #4ec9b0;   /* titres, clés */
  --red:         #ff5f56;
  --yellow:      #ffbd2e;

  --radius:      10px;
  --radius-sm:   5px;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

strong { color: var(--text); font-weight: 600; }

h1, h2, h3 { font-weight: 600; margin: 0 0 .6em; line-height: 1.35; }
h1 { font-size: clamp(1.4rem, 3.6vw, 1.95rem); color: var(--text); }
h2 { font-size: 1.15rem; color: var(--cyan); margin-top: 2.4rem; }
h2::before { content: "## "; color: var(--text-faint); font-weight: 400; }
h3 { font-size: .98rem; color: var(--text); }

p { margin: 0 0 1rem; }

.container {
  width: 100%;
  max-width: 940px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.muted { color: var(--text-soft); }
.small { font-size: .85rem; }
.mono  { font-family: var(--mono); }

/* Lien d'évitement */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #10110f;
  padding: .55rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------------------- Barre de titre ---------------------- */

.site-header {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

/* En-tête de lettre : gros logo + raison sociale */
.letterhead {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  padding-block: 2.1rem;
  border-bottom: 1px solid var(--border);
}
.lh-logo { flex: none; display: flex; border-radius: var(--radius-sm); }
.lh-logo img { width: clamp(68px, 14vw, 92px); height: auto; display: block; }
.lh-id { display: flex; flex-direction: column; line-height: 1.2; }
.lh-name {
  font-size: clamp(1.6rem, 5.5vw, 2.2rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.lh-name .n9 { margin-left: .15em; }
.lh-role { font-size: 1rem; color: var(--text-faint); margin-top: .25rem; }
.lh-contact { margin-left: auto; font-size: 1rem; color: var(--text-faint); white-space: nowrap; }
@media (max-width: 560px) {
  .letterhead { padding-block: 1.25rem; }
  .lh-contact { display: none; }
}

.tbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 50px;
}
.tbar-dots { display: flex; gap: .5rem; flex: none; }
.tbar-dots i { width: 13px; height: 13px; border-radius: 50%; background: var(--red); }
.tbar-dots i:nth-child(2) { background: var(--yellow); }
.tbar-dots i:nth-child(3) { background: var(--green); }
.tbar-title {
  color: var(--text-soft);
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tbar-cwd { color: var(--accent); }

.tnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem 1.3rem;
  padding-block: .75rem .85rem;
  border-top: 1px dashed var(--border-soft);
  font-size: 1.1rem;
}
.tnav-prompt { color: var(--green); }
.tnav a { color: var(--text-faint); }
.tnav a:hover { color: var(--text); text-decoration: none; }
.tnav a[aria-current="page"] { color: var(--accent); }
.tnav a[aria-current="page"]::before { content: "▸ "; }

/* -------------------------- Sections ------------------------- */

section { padding: clamp(2rem, 6vw, 3.4rem) 0; }
section + section { border-top: 1px dashed var(--border); }
.section-alt { background: var(--bg); }

.section-head { max-width: 68ch; margin-bottom: 2rem; }

.eyebrow {
  display: block;
  margin-bottom: .85rem;
  font-size: .9rem;
  color: var(--accent);
  word-break: break-word;
}
.eyebrow::before { content: "root@degree9:~# "; color: var(--green); }

/* Hero */
.hero { padding-top: 2.4rem; }
.hero .eyebrow::after {
  content: "";
  display: inline-block;
  width: .55em;
  height: 1.05em;
  margin-left: .35ch;
  background: var(--accent);
  vertical-align: -0.18em;
  animation: term-blink 1.05s steps(1) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }

.hero .lead,
p.lead {
  font-size: 1.05rem;
  color: var(--text);
  max-width: 70ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 1.7rem;
}

.tags {
  list-style: none;
  padding: 0;
  margin: 2.2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.tags li {
  font-size: .8rem;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .2rem .6rem;
}
.tags li::before { content: "#"; color: var(--text-faint); }

/* --------------------------- Boutons ------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--mono);
  font-size: .9rem;
  font-weight: 500;
  padding: .5rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn::before { content: "["; color: var(--text-faint); margin-right: .3ch; }
.btn::after  { content: "]"; color: var(--text-faint); margin-left: .3ch; }
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn-primary { border-color: var(--accent); color: var(--accent); }
.btn-primary:hover { background: var(--accent); color: #10110f; }
.btn-primary:hover::before, .btn-primary:hover::after { color: #10110f; }

/* --------------------------- Prose -------------------------- */

.prose { max-width: 74ch; }
.prose h2:first-child { margin-top: 0; }

.prose ul { list-style: none; padding-left: 1.3rem; margin: 0 0 1rem; }
.prose li { position: relative; margin-bottom: .4rem; }
.prose li::before { content: "-"; position: absolute; left: -1.3rem; color: var(--accent); }

/* ------------------------ Grille cartes --------------------- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
}
.card h3 {
  font-size: .95rem;
  color: var(--text);
  margin-bottom: .55rem;
  display: flex;
  gap: .5rem;
  align-items: baseline;
}
.card h3::before { content: "$"; color: var(--green); }
.card .num { color: var(--accent); }
.card p { color: var(--text-soft); font-size: .92rem; margin: 0; }

/* --------------------------- Étapes ------------------------- */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.1rem;
}
.steps li { position: relative; padding-left: 2.6rem; margin: 0; }
.steps li::before {
  counter-increment: step;
  content: "[" counter(step) "]";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-size: .85rem;
}
.steps li strong { display: block; color: var(--text); margin-bottom: .15rem; }

/* ----------------------- Split + panel ---------------------- */

.split {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.5fr 1fr;
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.3rem;
}
.panel h3 { margin-top: 0; color: var(--cyan); }
.panel h3::before { content: "## "; color: var(--text-faint); font-weight: 400; }
.panel dl { margin: 0; }
.panel dt {
  margin-top: 1rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
}
.panel dt:first-of-type { margin-top: 0; }
.panel dd { margin: .1rem 0 0; color: var(--text); }
.panel .certs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .3rem;
}
.panel .certs li { position: relative; padding-left: 1.1rem; color: var(--text); }
.panel .certs li::before { content: "-"; position: absolute; left: 0; color: var(--accent); }

/* --------------------------- CTA --------------------------- */

.cta-band { text-align: center; }
.cta-band .actions { justify-content: center; }

/* ----------------------- Terminal (prestations) ------------- */
/* La page entière étant déjà un terminal, on aplatit la
   sous-fenêtre : plus de chrome, le contenu coule normalement. */

.terminal {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-family: var(--mono);
  font-size: inherit;
  line-height: inherit;
  color: var(--text);
}
.term-bar { display: none; }
.term-body { padding: .25rem 0 0; overflow-x: auto; }
.term-body .tl { margin: 0; }
.term-body pre.tl { font: inherit; white-space: pre-wrap; }
.term-body .pr { color: var(--green); }
.term-body .ar { color: var(--accent); }
.term-body .files { color: var(--text-faint); margin: .1rem 0 1.6rem; }

.tent { margin: 0 0 1.7rem; }
.tent:last-of-type { margin-bottom: .8rem; }
.tman {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .2rem 1.4rem;
  margin: .4rem 0 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--border);
}
.tman dt {
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .76rem;
  padding-top: .12rem;
}
.tman dd { margin: 0; }

.cur {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  background: var(--accent);
  vertical-align: -0.2em;
  animation: term-blink 1.05s steps(1) infinite;
}
@media (max-width: 620px) {
  .tman { grid-template-columns: 1fr; gap: 0; }
  .tman dt { margin-top: .55rem; }
}

/* -------------------------- Formulaire --------------------- */

.form { display: grid; gap: 1rem; max-width: 620px; }
.form .row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }

.field { display: grid; gap: .35rem; }
.field label { font-size: .85rem; color: var(--green); }
.field label::before { content: "> "; color: var(--text-faint); }
.field .hint { font-size: .8rem; color: var(--text-faint); }

.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--text);
  background: #0f1116;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-faint); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 60, .16);
}

.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .85rem; color: var(--text-soft); }
.check input { margin-top: .25rem; flex: none; }

.form-status { border-radius: var(--radius-sm); padding: .8rem 1rem; font-size: .9rem; display: none; }
.form-status.ok  { display: block; background: rgba(93, 194, 122, .12); border: 1px solid var(--green); color: var(--text); }
.form-status.err { display: block; background: rgba(255, 95, 86, .12); border: 1px solid var(--red); color: #ffd7d3; }

/* Encart contact */
.contact-aside {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.3rem;
  font-size: .9rem;
}
.contact-aside h3::before { content: "## "; color: var(--text-faint); font-weight: 400; }
.contact-aside p { margin-bottom: .55rem; }
.contact-aside .mono { word-break: break-all; color: var(--accent); }
.contact-aside .pgp-key {
  font-family: var(--mono);
  font-size: .68rem;
  line-height: 1.55;
  color: var(--text-faint);
  background: #0f1116;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem .8rem;
  margin: .3rem 0 .9rem;
  overflow-x: auto;
  white-space: pre;
}

/* --------------------------- Pied -------------------------- */

.site-footer {
  border-top: 1px dashed var(--border);
  background: var(--surface-alt);
  padding: 1.8rem 0;
  font-size: .82rem;
  color: var(--text-faint);
}
.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  text-align: center;
}
.site-footer .container > div:first-child::before { content: "# "; color: var(--green); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.site-footer a { color: var(--text-soft); }
.site-footer a:hover { color: var(--accent); text-decoration: none; }

/* ------------------------- Mouvement ----------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .hero .eyebrow::after,
  .cur { animation: none; opacity: .6; }
}
