/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --ink: #0B0E14;
  --surface: #12161F;
  --surface-2: #1A2029;
  --border: #262D3A;

  --text: #EDEFF4;
  --muted: #8A93A6;
  --dim: #565F72;

  --pass: #3ECF8E;
  --pass-dim: rgba(62, 207, 142, 0.12);
  --info: #5B8DEF;
  --info-dim: rgba(91, 141, 239, 0.12);
  --warn: #FFB454;
  --warn-dim: rgba(255, 180, 84, 0.12);
  --fail: #FF6B6B;
  --fail-dim: rgba(255, 107, 107, 0.12);

  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Manrope', -apple-system, sans-serif;

  --container: 1120px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-family: var(--sans); }
p { margin: 0; }

.dim { color: var(--dim); }
.str { color: var(--warn); }

/* subtle grain for texture, cheap trick but keeps flat dark bg from feeling sterile */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--pass); color: var(--ink); }

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

/* ============================================================
   SKIP LINK (RGAA 12.7)
   ============================================================ */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 999;
  background: var(--pass);
  color: #061711;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 0 0 8px 8px;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 20, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.nav__right {
  display: flex; align-items: center; gap: 16px;
}
.nav__logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.cursor-blink {
  color: var(--pass);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.nav__links {
  display: flex; gap: 28px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.nav__links a { transition: color 0.15s ease; white-space: nowrap; }
.nav__links a:hover { color: var(--text); }

.nav__cta {
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.nav__cta:hover { border-color: var(--pass); background: var(--pass-dim); }

@media (max-width: 860px) {
  .nav__links { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 56px 24px 0;
  position: relative;
  z-index: 2;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 940px) {
  .hero__inner { grid-template-columns: 1fr; }
}

/* --- terminal --- */
.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
}
.terminal__bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.terminal__dots { display: flex; gap: 6px; }
.terminal__dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--dim);
}
.terminal__dots span:nth-child(1) { background: var(--fail); }
.terminal__dots span:nth-child(2) { background: var(--warn); }
.terminal__dots span:nth-child(3) { background: var(--pass); }
.terminal__title {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
}
.terminal__body {
  padding: 20px 18px 24px;
  font-family: var(--mono);
  font-size: 13.5px;
  min-height: 320px;
}
.terminal__body .line {
  margin: 0 0 10px;
  opacity: 0;
  animation: reveal 0.4s ease forwards;
}
.line.l1 { animation-delay: 0.1s; }
.line.l2 { animation-delay: 0.45s; }
.line.l3 { animation-delay: 0.8s; }
.line.l4 { animation-delay: 1.05s; }
.line.l5 { animation-delay: 1.3s; }
.line.l6 { animation-delay: 1.55s; }
.line.l7 { animation-delay: 1.85s; }
.line.l8 { animation-delay: 2.15s; }
.line.l9 { animation-delay: 2.55s; }
.prompt { color: var(--pass); margin-right: 6px; }
.cmd { color: var(--text); }
.terminal__body .out { color: var(--muted); padding-left: 18px; display: block; }
.terminal__body .assert-pass { color: var(--pass); }
.terminal__body .assert-pass::before { content: "✓ "; }
.terminal__body .assert-info { color: var(--info); }
.terminal__body .assert-info::before { content: "→ "; }
.terminal__body .summary { color: var(--text); margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.terminal__body .summary .n-pass { color: var(--pass); font-weight: 600; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- identity --- */
.hero__identity { padding-top: 4px; }

.id-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 22px;
}
.id-badge__photo {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  border: 1px solid var(--border);
}
.id-badge__tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--pass);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}
.hero__name {
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.hero__role {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 22px;
}
.hero__bio {
  font-size: 16px;
  color: #C7CCD8;
  max-width: 54ch;
  margin-bottom: 26px;
}
.hero__bio strong { color: var(--text); font-weight: 700; }

.hero__tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 30px;
}
.tag {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.tag--pass { color: var(--pass); border-color: rgba(62,207,142,0.3); background: var(--pass-dim); }
.tag--info { color: var(--info); border-color: rgba(91,141,239,0.3); background: var(--info-dim); }
.tag--warn { color: var(--warn); border-color: rgba(255,180,84,0.3); background: var(--warn-dim); }

.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.btn {
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 7px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  display: inline-block;
}
.btn--primary {
  background: var(--pass);
  color: #061711;
  font-weight: 700;
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(62,207,142,0.5); }
.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--muted); }

.hero__meta {
  font-size: 13.5px;
  color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.hero__meta .dot { color: var(--dim); }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pass);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(62,207,142,0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(62,207,142,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(62,207,142,0); }
  100% { box-shadow: 0 0 0 0 rgba(62,207,142,0); }
}

/* --- stats strip --- */
.stats-strip {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat {
  padding: 28px 20px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat__num {
  display: block;
  font-family: var(--mono);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  color: var(--pass);
}
.stat__label {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
@media (max-width: 720px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
}

/* ============================================================
   SECTIONS (generic)
   ============================================================ */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 100px 24px 40px;
}
.section--alt { background: linear-gradient(180deg, transparent, var(--surface) 60px, var(--surface) calc(100% - 60px), transparent); }

.section__head { margin-bottom: 44px; }
.describe {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
}
.describe--close { margin-top: 8px; padding: 0 24px; max-width: var(--container); }
.section h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ============================================================
   EXPERIENCE
   ============================================================ */
.cases { display: flex; flex-direction: column; gap: 20px; }
.case {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--pass);
  border-radius: var(--radius);
  padding: 28px 30px;
}
.case:has(.case__status--running) { border-left-color: var(--info); }

.case__status {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.case__duration {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 5px;
}
.badge--pass { background: var(--pass-dim); color: var(--pass); }
.badge--info { background: var(--info-dim); color: var(--info); }
.badge--sm { padding: 2px 7px; font-size: 10px; }

.case__title {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.case__org { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.case__list { display: flex; flex-direction: column; gap: 10px; }
.case__list li {
  padding-left: 20px;
  position: relative;
  font-size: 14.5px;
  color: #C7CCD8;
}
.case__list li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--pass);
  font-size: 12px;
}
.case__list strong { color: var(--text); }

/* ============================================================
   SKILLS
   ============================================================ */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@media (max-width: 780px) { .skill-grid { grid-template-columns: 1fr; } }

.skill-group h3 {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13.5px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #D3D8E2;
}
.chip--cert {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--pass);
  border-color: rgba(62,207,142,0.3);
  background: var(--pass-dim);
}

/* ============================================================
   TIMELINE / EDUCATION
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 34px;
  margin-bottom: 50px;
}
.timeline__item { position: relative; }
.timeline__marker {
  position: absolute; left: -33px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--pass);
}
.timeline__top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.timeline__top h3 { font-size: 18px; font-weight: 700; }
.timeline__date { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.timeline__org { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.timeline__desc { font-size: 14.5px; color: #C7CCD8; max-width: 68ch; }

.certs__title {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
@media (max-width: 780px) { .project-grid { grid-template-columns: 1fr; } }

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project-card:hover { border-color: var(--pass); transform: translateY(-3px); }
.project-card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.project-card__date { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.project-card h3 { font-size: 18px; margin-bottom: 10px; }
.project-card p { font-size: 14.5px; color: #C7CCD8; }

/* ============================================================
   CONTACT
   ============================================================ */
.assertion {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 30px;
  display: inline-flex; align-items: center; gap: 10px;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  flex: 1 1 280px;
  max-width: 340px;
}
@media (max-width: 480px) {
  .contact-card { flex-basis: 100%; max-width: none; }
}
a.contact-card:hover { border-color: var(--pass); background: var(--pass-dim); transform: translateY(-3px); }
.contact-card__label {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.contact-card__value { font-size: 15px; font-weight: 600; word-break: break-word; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: 40px 24px 60px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* ============================================================
   A11Y TOGGLE — mode accessible (pur CSS via :has(), zéro JS)
   ============================================================ */
.a11y-toggle {
  display: flex; align-items: center; gap: 9px;
  cursor: pointer;
}
.a11y-toggle input[type="checkbox"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.a11y-toggle input:focus-visible ~ .a11y-toggle-track {
  outline: 2px solid var(--info);
  outline-offset: 3px;
}
.a11y-toggle-track {
  position: relative;
  width: 40px; height: 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.a11y-toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s ease, background 0.15s ease;
}
.a11y-toggle input:checked ~ .a11y-toggle-track { background: var(--pass-dim); border-color: var(--pass); }
.a11y-toggle input:checked ~ .a11y-toggle-track .a11y-toggle-knob {
  transform: translateX(18px);
  background: var(--pass);
}
.a11y-toggle-text {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
@media (max-width: 860px) {
  .a11y-toggle-text { display: none; }
}

/* ---- Overrides appliquées quand le mode accessible est actif ---- */
body:has(#a11y-toggle-input:checked) {
  --ink: #000000;
  --surface: #000000;
  --surface-2: #0A0A0A;
  --border: #FFFFFF;
  --text: #FFFFFF;
  --muted: #FFFFFF;
  --dim: #DDDDDD;
  --pass: #00E676;
  --pass-dim: rgba(0, 230, 118, 0.28);
  --info: #7FB8FF;
  --info-dim: rgba(127, 184, 255, 0.28);
  --warn: #FFD166;
  --warn-dim: rgba(255, 209, 102, 0.28);
  font-size: 120%;
  line-height: 1.75;
}

/* Coupe toutes les animations/transitions décoratives */
body:has(#a11y-toggle-input:checked) * {
  animation: none !important;
  transition: none !important;
}
/* Les lignes du terminal utilisent "animation forwards" pour apparaître :
   sans animation il faut forcer leur opacité finale à 1 */
body:has(#a11y-toggle-input:checked) .line,
body:has(#a11y-toggle-input:checked) .cursor-blink {
  opacity: 1 !important;
}
body:has(#a11y-toggle-input:checked) .grain { display: none; }
body:has(#a11y-toggle-input:checked) .status-dot { box-shadow: none; }

/* L'information ne doit jamais reposer sur la seule couleur : on souligne les liens */
body:has(#a11y-toggle-input:checked) a:not(.btn):not(.nav__cta):not(.a11y-toggle) {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Contraste renforcé sur les cartes et zones texte */
body:has(#a11y-toggle-input:checked) .case,
body:has(#a11y-toggle-input:checked) .project-card,
body:has(#a11y-toggle-input:checked) .contact-card,
body:has(#a11y-toggle-input:checked) .terminal,
body:has(#a11y-toggle-input:checked) .stat,
body:has(#a11y-toggle-input:checked) .assertion,
body:has(#a11y-toggle-input:checked) .chip,
body:has(#a11y-toggle-input:checked) .tag {
  border-width: 1.5px;
}
body:has(#a11y-toggle-input:checked) .hero__bio,
body:has(#a11y-toggle-input:checked) .case__list li,
body:has(#a11y-toggle-input:checked) .timeline__desc,
body:has(#a11y-toggle-input:checked) .project-card p {
  color: var(--text);
}
body:has(#a11y-toggle-input:checked) .project-card:hover,
body:has(#a11y-toggle-input:checked) a.contact-card:hover {
  transform: none;
}
