/* Portfolio de Maxime Forest — feuille de style
   Thème : plan technique (papier, encre, une couleur de câble). */

:root {
  --paper: #f3eee2;
  --sheet: #faf7ef;
  --ink: #1c2127;
  --soft: #4a5560;
  --hair: rgba(28, 33, 39, .18);
  --grid: rgba(28, 33, 39, .055);
  --cable: #e8590c;
  --cable-text: #b8380a;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 78px; }
body {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  overflow-wrap: break-word;
}
img { max-width: 100%; display: block; }
ul { list-style: none; }
a { color: var(--cable-text); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--cable); outline-offset: 3px; }
.wrap { width: min(1100px, 100% - 40px); margin-inline: auto; }
.mono { font-family: var(--mono); }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; }
.skip:focus { left: 12px; top: 12px; }

/* ---------- En-tête ---------- */
.top { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 2px solid var(--ink); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--ink); font-weight: 800; text-decoration: none; letter-spacing: -.3px; }
.brand .logo { display: grid; place-items: center; width: 34px; height: 34px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 13px; font-weight: 700; border-bottom: 4px solid var(--cable); }
.nav ul { display: flex; gap: 2px; }
.nav a { display: block; white-space: nowrap; padding: 7px 11px; color: var(--ink); font-family: var(--mono); font-size: 13.5px; text-decoration: none; border: 1.5px solid transparent; }
.nav a:hover { border-color: var(--ink); }
.nav a.on { background: var(--ink); color: var(--paper); }
.burger { display: none; width: 44px; height: 44px; background: var(--sheet); color: var(--ink); border: 1.5px solid var(--ink); cursor: pointer; }
.burger svg { display: block; margin: auto; }

/* ---------- Accueil ---------- */
.hero { border-bottom: 2px solid var(--ink); }
.hero .wrap { padding-block: 28px 40px; }
.intro { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; }
.kicker { font-family: var(--mono); font-size: 13.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--soft); }
.kicker b { color: var(--cable-text); font-weight: 700; }
h1 { font-size: clamp(46px, 8vw, 84px); line-height: .94; letter-spacing: -.045em; font-weight: 800; margin-top: 10px; }
.lead { font-size: clamp(19px, 2.4vw, 25px); font-weight: 600; margin-top: 14px; letter-spacing: -.01em; }
.lead u { text-decoration-color: var(--cable); text-decoration-thickness: 4px; text-underline-offset: 5px; }
.note { margin-top: 20px; max-width: 62ch; padding: 11px 16px; background: var(--sheet); border: 1.5px solid var(--ink); border-left: 7px solid var(--cable); font-size: 16px; }
.note b { font-family: var(--mono); font-size: 12.5px; letter-spacing: 1.4px; margin-right: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; padding: 10px 17px; background: var(--sheet); color: var(--ink); border: 1.5px solid var(--ink); font-weight: 600; font-size: 15.5px; text-decoration: none; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.main { background: var(--cable); }
.btn.main:hover { background: var(--ink); }

.fig { width: 178px; }
.fig .frame { background: var(--sheet); border: 1.5px solid var(--ink); padding: 6px; }
.fig img, .fig .initials { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; filter: grayscale(1) contrast(1.06); }
.fig .initials { display: none; place-items: center; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 46px; font-weight: 700; filter: none; }
.fig.sans-photo img { display: none; }
.fig.sans-photo .initials { display: grid; }
figcaption, .caption { font-family: var(--mono); font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--soft); margin-top: 7px; }
.fig figcaption { font-size: 10.5px; letter-spacing: .3px; white-space: nowrap; }

/* Schéma réseau */
.plan { margin-top: 24px; }
.plan .sheet { background-color: var(--sheet); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 12px 12px; border: 1.5px solid var(--ink); padding: 8px; }
.plan svg { display: block; width: 100%; height: auto; }
.plan .mobile { display: none; }
.lk { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.lk.fin { stroke-width: 1.2; }
.route { fill: none; stroke: transparent; stroke-width: 3.2; stroke-linejoin: round; pointer-events: none; }
.zone { fill: rgba(232, 89, 12, .04); stroke: var(--ink); stroke-width: 1; stroke-dasharray: 6 5; }
.pkt { fill: var(--cable); }
.ico * { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.ico .nf { fill: none; }
.ico .led { fill: var(--cable); stroke: none; }
.plan text { font-family: var(--sans); fill: var(--ink); }
.plan text.h, .plan text.z, .plan text.c { font-family: var(--mono); fill: var(--soft); }
.plan text.h { font-size: 10.5px; }
.plan text.t { font-size: 14.5px; font-weight: 700; }
.plan text.z { font-size: 10.5px; letter-spacing: 1.2px; }
.plan text.c { font-size: 10.5px; letter-spacing: .8px; }
.plan text.cv { font-size: 12.5px; font-weight: 600; }
.plan text.figt { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 1.4px; }
.plan text.figs { font-size: 13px; fill: var(--soft); }
.cart { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.2; }
.plan a { cursor: pointer; }
.plan a:hover .route, .plan a:focus-visible .route { stroke: var(--cable); }
.plan a:hover .ico *, .plan a:focus-visible .ico * { stroke: var(--cable-text); }
.plan a:hover .ico .led, .plan a:focus-visible .ico .led { stroke: none; }
.plan a:hover text.t, .plan a:focus-visible text.t { fill: var(--cable-text); text-decoration: underline; }
.plan a:focus-visible { outline: none; }
.hit { fill: transparent; stroke: none; }

/* ---------- Rubriques ---------- */
section { padding-block: 64px; }
.folio { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; border-top: 2px solid var(--ink); padding-top: 18px; }
.folio .n { display: grid; place-items: center; width: 54px; height: 54px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 20px; font-weight: 700; border-bottom: 5px solid var(--cable); }
.folio .host { font-family: var(--mono); font-size: 12.5px; letter-spacing: 1px; color: var(--soft); }
h2 { font-size: clamp(28px, 4.4vw, 42px); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; }
.sub { color: var(--soft); max-width: 68ch; margin-top: 18px; }
h3 { font-size: 19px; line-height: 1.28; letter-spacing: -.01em; }
.grid { display: grid; gap: 16px; margin-top: 28px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--sheet); border: 1.5px solid var(--ink); padding: 20px; }
.card > p:not(.meta) { color: var(--soft); font-size: 16px; margin-top: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags li { font-family: var(--mono); font-size: 12.5px; border: 1px solid var(--ink); padding: 2px 8px; }
.meta { font-family: var(--mono); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--cable-text); margin-bottom: 6px; }

/* À propos */
.about { display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px; margin-top: 28px; align-items: start; }
.about p + p { margin-top: 14px; }
.facts { background: var(--sheet); border: 1.5px solid var(--ink); }
.facts div { display: grid; grid-template-columns: 112px 1fr; border-bottom: 1px solid var(--ink); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--soft); padding: 12px; border-right: 1px solid var(--ink); }
.facts dd { padding: 10px 12px; font-size: 15.5px; font-weight: 600; }

/* Compétences */
.skill h3 { display: flex; align-items: center; gap: 10px; }
.skill h3::before { content: ""; flex: none; width: 10px; height: 10px; background: var(--cable); }
.skill .niv { font-family: var(--mono); font-size: 11.5px; font-weight: 400; letter-spacing: 1px; text-transform: uppercase; color: var(--cable-text); border: 1px solid currentColor; padding: 1px 6px; }
.tags.bases li { border-style: dashed; }

/* Projets */
.year { display: flex; align-items: baseline; gap: 14px; margin-top: 40px; }
.year h3 { font-size: 23px; letter-spacing: -.02em; }
.year span { font-family: var(--mono); font-size: 13px; color: var(--soft); }
.project { display: flex; flex-direction: column; scroll-margin-top: 86px; }
.project .tags { margin-top: auto; padding-top: 14px; }
.project.wide > p:not(.meta), .project.wide .fiche { max-width: 780px; }
details { margin-top: 14px; border-top: 1px dashed var(--ink); padding-top: 12px; }
summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15.5px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: grid; place-items: center; width: 20px; height: 20px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 14px; line-height: 1; }
details[open] > summary::before { content: "–"; background: var(--cable); color: var(--ink); }
summary:hover { color: var(--cable-text); }
.fiche { margin-top: 12px; font-size: 15.5px; }
.fiche h4 { font-family: var(--mono); font-size: 12px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--soft); margin-top: 14px; }
.fiche p { margin-top: 4px; }
.fiche ul { margin-top: 6px; }
.fiche li { position: relative; padding-left: 18px; margin-top: 4px; }
.fiche li::before { content: ""; position: absolute; left: 1px; top: .62em; width: 7px; height: 7px; background: var(--cable); }
.doc { display: inline-block; margin-top: 14px; font-size: 15px; font-weight: 700; }

/* Parcours */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; margin-top: 30px; }
.cols h3 { font-size: 23px; letter-spacing: -.02em; margin-bottom: 18px; }
.line { border-left: 2px solid var(--ink); padding-left: 22px; }
.line > li { position: relative; padding-bottom: 26px; }
.line > li:last-child { padding-bottom: 0; }
.line > li::before { content: ""; position: absolute; left: -30px; top: 6px; width: 14px; height: 14px; background: var(--paper); border: 2px solid var(--ink); }
.line > li.now::before { background: var(--cable); }
.when { font-family: var(--mono); font-size: 13px; color: var(--cable-text); }
.line h4 { font-size: 17.5px; line-height: 1.3; margin-top: 2px; }
.where { color: var(--soft); font-size: 15.5px; }
.line ul { margin-top: 8px; font-size: 15.5px; }
.line ul li { position: relative; padding-left: 16px; margin-top: 4px; }
.line .more { margin-top: 10px; font-size: 15px; font-weight: 700; }
.line ul li::before { content: ""; position: absolute; left: 0; top: .68em; width: 6px; height: 2px; background: var(--ink); }

/* Certifications */
.cert { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start; }
.cert .badge { width: 96px; height: 96px; display: grid; place-items: center; border: 1.5px solid var(--ink); background: var(--paper); font-family: var(--mono); font-size: 12.5px; overflow: hidden; }
.cert .badge img { width: 100%; height: 100%; object-fit: contain; }
.x509 { margin-top: 10px; font-size: 14.5px; }
.x509 div { display: grid; grid-template-columns: 84px minmax(0, 1fr); padding: 4px 0; border-top: 1px dashed var(--hair); }
.x509 dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--soft); padding-top: 2px; }

/* Veille */
.sources li { padding-left: 0; font-size: 14px; }
.sources li::before { display: none; }
.sources a { overflow-wrap: anywhere; }

/* Contact */
.rules { width: 100%; margin-top: 26px; border-collapse: collapse; background: var(--sheet); border: 1.5px solid var(--ink); font-family: var(--mono); font-size: 14px; }
.rules caption { caption-side: top; text-align: left; font-size: 13px; color: var(--soft); padding-bottom: 8px; }
.rules th { text-align: left; font-size: 11.5px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--soft); font-weight: 400; }
.rules th, .rules td { padding: 11px 14px; border-bottom: 1px solid var(--ink); vertical-align: top; }
.rules tr:last-child td { border-bottom: 0; }
.rules .ok, .rules .ko { display: inline-block; padding: 1px 8px; font-weight: 700; font-size: 12.5px; }
.rules .ok { background: var(--ink); color: var(--paper); }
.rules .ko { border: 1.5px solid var(--ink); padding: 0 7px; }
.rules a { font-weight: 700; overflow-wrap: anywhere; }

footer { border-top: 2px solid var(--ink); padding: 22px 0 34px; font-family: var(--mono); font-size: 13px; color: var(--soft); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: space-between; }

/* ---------- Petits écrans ---------- */
@media (max-width: 1080px) {
  .nav a { padding: 7px 6px; font-size: 12.5px; }
}
@media (max-width: 900px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 2px solid var(--ink); padding: 8px 20px 14px; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { padding: 11px 12px; font-size: 15px; }
  .g3 { grid-template-columns: repeat(2, 1fr); }
  #certifications .g2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero .wrap { padding-block: 26px 34px; }
  .intro { grid-template-columns: 1fr; gap: 18px; }
  .fig { width: 104px; order: -1; }
  .fig figcaption { display: none; }
  .plan .desktop { display: none; }
  .plan .mobile { display: block; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  section { padding-block: 46px; }
  .folio .n { width: 46px; height: 46px; font-size: 17px; }
  .rules .opt { display: none; }
  .rules th, .rules td { padding: 10px; }
  .facts dt { font-size: 10.5px; letter-spacing: .5px; }
}
@media (max-width: 560px) {
  .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  body { font-size: 16px; }
  .g2, .cols { grid-template-columns: 1fr; }
  .cert { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 96px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  .top, .burger, .actions, .pkt { display: none; }
  body { background: #fff; }
  details > .fiche { display: block; }
}
