/* Portfolio Mohamed Abdaim — néo-brutaliste, thème données */
:root {
  --papier: #EEF2F5;
  --blanc: #FFFFFF;
  --noir: #000000;
  --jaune: #FFD23F;
  --rose: #FF3D7F;
  --cyan: #29C5F6;
  --vert: #2BD47D;
  --gris: #4A5563;

  --bord: 3px solid var(--noir);
  --ombre: 6px 6px 0 var(--noir);
  --ombre-petite: 3px 3px 0 var(--noir);

  --titre: "Archivo", "Arial Black", sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--titre); font-size: 1.02rem; line-height: 1.6; color: var(--noir);
  background-color: var(--papier);
  /* papier millimétré */
  background-image:
    linear-gradient(rgba(0,0,0,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.06) 1px, transparent 1px);
  background-size: 28px 28px;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; }
::selection { background: var(--jaune); }

.page { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ---------- Barre de navigation ---------- */
.barre {
  position: sticky; top: 0; z-index: 20;
  background: var(--blanc); border-bottom: var(--bord);
}
.barre .page { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }
.logo {
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem; text-decoration: none;
  background: var(--jaune); border: var(--bord); box-shadow: var(--ombre-petite);
  padding: 6px 12px; white-space: nowrap;
}
.logo .curseur { display: inline-block; width: .6em; animation: clignote 1s steps(1) infinite; }
@keyframes clignote { 50% { opacity: 0; } }

.menu { display: flex; gap: 6px; list-style: none; }
.menu a {
  display: block; padding: 8px 14px; font-weight: 700; font-size: .95rem; text-decoration: none;
  border: 3px solid transparent;
}
.menu a:hover { border-color: var(--noir); background: var(--papier); }
.menu a[aria-current="page"], .menu a.actif { background: var(--jaune); border-color: var(--noir); box-shadow: var(--ombre-petite); }

.bouton-menu {
  display: none; font-family: var(--mono); font-weight: 700; font-size: .95rem;
  background: var(--blanc); border: var(--bord); box-shadow: var(--ombre-petite);
  padding: 8px 14px; cursor: pointer;
}

/* ---------- Boutons ---------- */
.bouton {
  display: inline-block; font-weight: 800; text-decoration: none; font-size: 1rem;
  padding: 12px 20px; border: var(--bord); box-shadow: var(--ombre);
  transition: transform .1s ease, box-shadow .1s ease;
}
.bouton:hover { transform: translate(2px, 2px); box-shadow: 4px 4px 0 var(--noir); }
.bouton:active { transform: translate(6px, 6px); box-shadow: none; }
.bouton-jaune { background: var(--jaune); }
.bouton-blanc { background: var(--blanc); }
.bouton-rose { background: var(--rose); color: var(--blanc); }

/* ---------- Ouverture ---------- */
.ouverture { padding: 56px 0 40px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.statut {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: .85rem; font-weight: 600;
  background: var(--blanc); border: var(--bord); padding: 4px 10px;
}
.statut::before { content: ""; width: 10px; height: 10px; background: var(--vert); border: 2px solid var(--noir); border-radius: 50%; }
.ouverture h1 {
  font-weight: 900; font-stretch: 112%; text-transform: uppercase;
  font-size: clamp(2.8rem, 8vw, 5.6rem); line-height: .9; letter-spacing: -0.03em; margin: 18px 0 18px;
}
.ouverture h1 span { display: inline-block; background: var(--rose); color: var(--blanc); padding: 0 .12em; border: var(--bord); box-shadow: var(--ombre); }
.ouverture .chapeau { font-size: 1.15rem; max-width: 30rem; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* Terminal SQL */
.terminal { background: var(--blanc); border: var(--bord); box-shadow: 10px 10px 0 var(--noir); min-width: 0; }
.terminal .entete {
  display: flex; align-items: center; gap: 8px; background: var(--noir); color: var(--blanc);
  font-family: var(--mono); font-size: .85rem; padding: 8px 12px;
}
.terminal .entete i { width: 12px; height: 12px; border: 2px solid var(--blanc); display: inline-block; }
.terminal .entete i:nth-child(1) { background: var(--rose); }
.terminal .entete i:nth-child(2) { background: var(--jaune); }
.terminal .entete i:nth-child(3) { background: var(--vert); }
.terminal .entete span { margin-left: auto; }
.terminal pre {
  font-family: var(--mono); font-size: .92rem; line-height: 1.6; padding: 16px; margin: 0;
  white-space: pre-wrap; word-break: break-word; border-bottom: var(--bord);
}
.k { color: #C2185B; font-weight: 700; }
.s { color: #0A7A3E; }
.c { color: var(--gris); }
.resultat { overflow-x: auto; }
.resultat table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: .85rem; }
.resultat th, .resultat td { border: 2px solid var(--noir); padding: 7px 10px; text-align: left; white-space: nowrap; }
.resultat tr > *:first-child { border-left: 0; }
.resultat tr > *:last-child { border-right: 0; }
.resultat thead th { background: var(--cyan); border-top: 0; }
.resultat tbody tr:last-child td { border-bottom: 0; }
.resultat .meta { font-family: var(--mono); font-size: .8rem; padding: 8px 12px; color: var(--gris); }

/* ---------- Ruban défilant ---------- */
.ruban { background: var(--noir); color: var(--jaune); border-block: var(--bord); overflow: hidden; margin: 24px 0 8px; }
.ruban div { display: flex; width: max-content; animation: defile 28s linear infinite; }
.ruban span { font-family: var(--mono); font-weight: 700; font-size: .95rem; padding: 12px 22px; white-space: nowrap; }
.ruban span:nth-child(3n+2) { color: var(--rose); }
.ruban span:nth-child(3n) { color: var(--cyan); }
@keyframes defile { to { transform: translateX(-50%); } }

/* ---------- Cartes « fichier » ---------- */
.zone { padding: 40px 0; }
.carte { background: var(--blanc); border: var(--bord); box-shadow: var(--ombre); margin-top: 22px; }
.onglet {
  display: inline-block; font-family: var(--mono); font-weight: 700; font-size: .85rem;
  border: var(--bord); border-bottom: 0; padding: 6px 14px; background: var(--jaune);
  position: relative; top: 3px;
}
.onglet.rose { background: var(--rose); color: var(--blanc); }
.onglet.cyan { background: var(--cyan); }
.onglet.vert { background: var(--vert); }
.zone h2 {
  font-weight: 900; font-stretch: 112%; font-size: clamp(1.8rem, 4.5vw, 2.8rem); line-height: 1;
  letter-spacing: -0.02em; text-transform: uppercase;
}
.zone .sous { font-family: var(--mono); font-size: .9rem; color: var(--gris); margin-top: 8px; }

/* Lignes (expérience, réalisations, semaines, articles) */
.ligne { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 8px 24px; padding: 20px 22px; }
.ligne + .ligne { border-top: var(--bord); }
.date {
  align-self: start; justify-self: start; font-family: var(--mono); font-weight: 700; font-size: .82rem;
  background: var(--papier); border: 2px solid var(--noir); padding: 3px 8px;
}
.ligne h3 { font-weight: 800; font-size: 1.15rem; line-height: 1.3; }
.ligne h3 a { text-decoration: none; background: linear-gradient(var(--jaune), var(--jaune)) 0 100% / 0 40% no-repeat; transition: background-size .2s; }
.ligne h3 a:hover { background-size: 100% 40%; }
.ligne p { margin-top: 4px; }
.ligne .retenir { margin-top: 8px; font-weight: 600; }
.ligne .retenir::before { content: "→ "; color: var(--rose); }

.puces { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.puces li {
  font-family: var(--mono); font-weight: 600; font-size: .8rem;
  border: 2px solid var(--noir); padding: 3px 10px; background: var(--blanc);
}
.puces li:nth-child(4n+1) { background: var(--jaune); }
.puces li:nth-child(4n+2) { background: var(--cyan); }
.puces li:nth-child(4n+3) { background: #FFC2D6; }
.puces li:nth-child(4n) { background: #BDF3D6; }

.liste { padding: 20px 22px 20px 42px; }
.liste li + li { margin-top: 6px; }
.liste li::marker { content: "> "; font-family: var(--mono); font-weight: 700; color: var(--rose); }

/* Grilles */
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.bloc { padding: 20px 22px; }
.bloc h3 { font-weight: 800; font-size: 1.05rem; }
.paires { display: grid; grid-template-columns: max-content 1fr; }
.paires dt, .paires dd { padding: 12px 22px; }
.paires dt { font-family: var(--mono); font-weight: 700; background: var(--papier); border-right: var(--bord); }
.paires dt:not(:first-of-type), .paires dt:not(:first-of-type) + dd { border-top: var(--bord); }

/* Planche */
.planche img { border-bottom: 0; }
.planche figcaption { font-family: var(--mono); font-size: .82rem; padding: 10px 14px; border-top: var(--bord); background: var(--papier); }

/* Contact */
.contact { background: var(--jaune); border: var(--bord); box-shadow: 10px 10px 0 var(--noir); padding: clamp(24px, 5vw, 48px); margin-top: 22px; }
.contact .courriel {
  display: inline-block; margin-top: 16px; font-weight: 900; font-size: clamp(1.05rem, 4vw, 2rem);
  word-break: break-all; text-decoration: none; background: var(--blanc); border: var(--bord); box-shadow: var(--ombre); padding: 10px 16px;
}

/* Preuves */
.preuves { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 22px; margin-top: 22px; }
.preuve { background: var(--blanc); border: var(--bord); box-shadow: var(--ombre); }
.preuve img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: var(--bord); cursor: zoom-in; }
.preuve figcaption { font-family: var(--mono); font-size: .85rem; padding: 10px 12px; }
.visionneuse { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.88); display: none; place-items: center; padding: 20px; cursor: zoom-out; }
.visionneuse.ouverte { display: grid; }
.visionneuse img { max-height: 90vh; border: var(--bord); }

/* Classeur SQL façon Excel */
.classeur .bloc { border-bottom: var(--bord); }
.classeur .requete { border: 0; box-shadow: none; border-bottom: var(--bord); }
.classeur .requete pre { border-bottom: 0; font-size: .85rem; white-space: pre; overflow-x: auto; word-break: normal; }
.barre-formule { display: flex; font-family: var(--mono); font-size: .82rem; border-bottom: 2px solid var(--noir); background: var(--blanc); }
.barre-formule span { padding: 6px 12px; }
.barre-formule span:first-child { font-style: italic; font-weight: 700; border-right: 2px solid var(--noir); background: var(--papier); }
.tableur { overflow-x: auto; background: var(--blanc); }
.tableur table { border-collapse: collapse; font-family: var(--mono); font-size: .84rem; min-width: 100%; }
.tableur th, .tableur td { border: 1px solid #B8C0CC; padding: 6px 12px; white-space: nowrap; text-align: left; }
.tableur thead th { background: #E7EBF0; font-weight: 600; text-align: center; color: var(--gris); }
.tableur th.num { background: #E7EBF0; color: var(--gris); font-weight: 600; text-align: center; width: 2.6rem; }
.tableur td.entete-col { background: var(--cyan); font-weight: 700; border-color: var(--noir); }
.tableur td.droite { text-align: right; }
.tableur tbody tr:not(:first-child):hover td { background: #FFF6CC; }
.feuilles { display: flex; flex-wrap: wrap; gap: 0; border-top: var(--bord); background: #E7EBF0; padding: 0 8px; }
.feuilles button {
  font-family: var(--mono); font-weight: 600; font-size: .82rem; cursor: pointer;
  background: transparent; border: 2px solid transparent; border-top: 0; padding: 8px 14px; margin-top: -3px;
}
.feuilles button:hover { background: var(--blanc); }
.feuilles button[aria-selected="true"] { background: var(--blanc); border-color: var(--noir); border-bottom: 4px solid #217346; color: #217346; font-weight: 700; }

/* Camembert */
.graphique { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 28px; align-items: center; padding: 22px; border-top: var(--bord); }
.graphique svg { width: 100%; height: auto; overflow: visible; }
.graphique .part { stroke: var(--noir); stroke-width: 2.5; stroke-linejoin: round; transition: transform .15s; transform-origin: 120px 120px; cursor: help; }
.graphique .part:hover, .graphique .part:focus { transform: scale(1.04); outline: none; }
.graphique .etiquette { font-family: var(--mono); font-weight: 700; font-size: 11px; text-anchor: middle; dominant-baseline: middle; fill: var(--noir); paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 3px; pointer-events: none; }
.titre-graph { font-weight: 800; font-size: 1.05rem; }
.legende { list-style: none; margin-top: 12px; font-family: var(--mono); font-size: .85rem; }
.legende li { display: grid; grid-template-columns: 18px 1fr 4rem 4.5rem; gap: 10px; align-items: center; padding: 6px 0; }
.legende li + li { border-top: 1px solid #D5DBE3; }
.legende i { width: 16px; height: 16px; border: 2px solid var(--noir); }
.legende .droite { text-align: right; }
.graphique .total { font-family: var(--mono); font-size: .8rem; color: var(--gris); margin-top: 10px; }
@media (max-width: 760px) { .graphique { grid-template-columns: 1fr; padding: 16px; } .graphique svg { max-width: 260px; margin: 0 auto; } }

/* En-tête des pages intérieures */
.titre-page { padding: 48px 0 8px; }
.titre-page h1 {
  font-weight: 900; font-stretch: 112%; text-transform: uppercase;
  font-size: clamp(2.4rem, 7vw, 4.4rem); line-height: .95; letter-spacing: -0.03em; margin-top: 16px;
}
.titre-page .chapeau { margin-top: 16px; font-size: 1.12rem; max-width: 40rem; font-weight: 500; }

/* Pied */
.pied { background: var(--noir); color: var(--blanc); border-top: var(--bord); margin-top: 56px; }
.pied .page { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-block: 22px; font-family: var(--mono); font-size: .85rem; }
.pied a { color: var(--jaune); }

/* ---------- Tablette ---------- */
@media (max-width: 980px) {
  .ouverture { grid-template-columns: 1fr; }
  .grille-2 { grid-template-columns: 1fr; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  :root { --ombre: 4px 4px 0 var(--noir); }
  html { scroll-padding-top: 76px; }
  .barre .page { height: 64px; }
  .bouton-menu { display: block; }
  .menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; background: var(--blanc); border-bottom: var(--bord);
  }
  .menu.ouvert { display: flex; }
  .menu a { padding: 14px 20px; border: 0; border-top: 2px solid var(--noir); font-size: 1.05rem; }
  .menu a[aria-current="page"], .menu a.actif { box-shadow: none; border-color: var(--noir); }
  .ouverture { padding: 32px 0 24px; gap: 32px; }
  .terminal { box-shadow: 6px 6px 0 var(--noir); }
  .terminal pre { font-size: .82rem; }
  .ligne { grid-template-columns: 1fr; padding: 16px; }
  .liste { padding: 16px 16px 16px 34px; }
  .bloc { padding: 16px; }
  .paires { grid-template-columns: 1fr; }
  .paires dt { border-right: 0; border-bottom: 2px solid var(--noir); }
  .paires dt:not(:first-of-type) { border-top: var(--bord); }
  .paires dt:not(:first-of-type) + dd { border-top: 0; }
  .paires dt, .paires dd { padding: 10px 16px; }
  .contact { box-shadow: 6px 6px 0 var(--noir); }
  .zone { padding: 28px 0; }
}
