/* ────────────────────────────────────────────────────────────
   Salim Mabed — Portfolio 2026 · "From Complexity to Clarity"
   Shared stylesheet for fr / en / ar
   ──────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/files/SpaceGrotesk-Variable.woff2') format('woff2-variations'), url('/fonts/files/SpaceGrotesk-Variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #08090c;
  --bg-alt: #0b0d11;
  --bg-card: #0a0b0f;
  --bg-panel: #0d1015;
  --text: #eceef1;
  --text-dim: #d5d8dd;
  --muted-1: #9aa0aa;
  --muted-2: #8b9099;
  --muted-3: #7f858e;
  --muted-4: #787e88;
  --muted-5: #747a84;
  --muted-6: #4f545c;
  --muted-7: #454a53;
  --muted-8: #3f444c;
  --accent: #7fd6f2;
  --accent-soft: rgba(127,214,242,.1);
  --amber: #d9a05b;
  --line-1: rgba(255,255,255,.06);
  --line-2: rgba(255,255,255,.07);
  --line-3: rgba(255,255,255,.08);
  --line-4: rgba(255,255,255,.09);
  --line-5: rgba(255,255,255,.1);
  --line-6: rgba(255,255,255,.12);
  --line-7: rgba(255,255,255,.14);
  --font-display: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color-scheme: dark;

  /* même nuage de particules cyan que les figures 3D (voir buildHero() dans
     main.js) : une seule définition, réutilisée sur le body et tous les
     grands panneaux de contenu qui avaient sinon un fond --bg/--bg-alt plat */
  --starfield:
    radial-gradient(2.2px 2.2px at 12% 18%, rgba(127,214,242,.4) 45%, transparent 70%),
    radial-gradient(1.6px 1.6px at 34% 6%, rgba(127,214,242,.55), transparent),
    radial-gradient(2.4px 2.4px at 56% 40%, rgba(127,214,242,.35) 45%, transparent 70%),
    radial-gradient(1.4px 1.4px at 72% 12%, rgba(127,214,242,.5), transparent),
    radial-gradient(1.8px 1.8px at 6% 54%, rgba(127,214,242,.6), transparent),
    radial-gradient(1.4px 1.4px at 28% 68%, rgba(127,214,242,.45), transparent),
    radial-gradient(2.2px 2.2px at 82% 58%, rgba(127,214,242,.4) 45%, transparent 70%),
    radial-gradient(1.4px 1.4px at 47% 78%, rgba(127,214,242,.5), transparent),
    radial-gradient(1.8px 1.8px at 94% 22%, rgba(127,214,242,.55), transparent),
    radial-gradient(1.4px 1.4px at 62% 92%, rgba(127,214,242,.45), transparent),
    radial-gradient(2px 2px at 18% 88%, rgba(127,214,242,.5), transparent),
    radial-gradient(1.4px 1.4px at 88% 84%, rgba(127,214,242,.4), transparent),
    radial-gradient(1.6px 1.6px at 40% 30%, rgba(127,214,242,.5), transparent),
    radial-gradient(1.4px 1.4px at 8% 8%, rgba(127,214,242,.4), transparent);
  --starfield-size: 260px 260px;
}

/* Arabic pages keep body/mono type on Inter/Fira Code's Arabic fallback stack,
   and headings fall back to system-ui since Space Grotesk has no Arabic glyphs. */
:root[dir="rtl"] {
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; background: var(--bg); }

/* ── fond étoilé partagé par toutes les pages : le même nuage de
   particules cyan que celui des figures 3D (voir buildHero() dans
   main.js), plutôt qu'un noir plat derrière le contenu. Motif tuilé sur
   le fond du body lui-même (pas un calque séparé) pour défiler avec la
   page sans dépendre de background-attachment:fixed, peu fiable sur iOS. */
body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: var(--starfield);
  background-repeat: repeat;
  background-size: var(--starfield-size);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }
input, textarea, button { font-family: inherit; }
img { max-width: 100%; display: block; }
::selection { background: rgba(127,214,242,.25); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(127,214,242,.35); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes softPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.skip-link {
  position: absolute; top: -100px; left: 1rem; z-index: 1000;
  background: var(--accent); color: #08090c; padding: .7rem 1.2rem;
  border-radius: 6px; font-weight: 600; font-size: .88rem; transition: top .2s ease;
}
.skip-link:focus { top: 1rem; color: #08090c; }

/* ── progress bar ── */
#progress-bar { position: fixed; top: 0; left: 0; height: 1px; z-index: 300; background: var(--accent); width: 0%; transition: width .1s linear; }

/* ── nav ── */
nav {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 1.1rem clamp(1.25rem, 5vw, 4rem);
  background: rgba(8,9,12,.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line-1);
}
.nav-logo {
  display: flex; align-items: baseline; gap: .5rem; color: var(--text);
  font-family: var(--font-display); font-size: 1rem; font-weight: 600; letter-spacing: -.01em;
}
.nav-logo .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: softPulse 2.6s ease-in-out infinite; }
.nav-links {
  display: flex; gap: clamp(.9rem, 2vw, 2rem); list-style: none; align-items: center;
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em;
}
.nav-links a { color: var(--muted-2); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: .9rem; }
.nav-contact {
  padding: .45rem 1rem; border: 1px solid rgba(127,214,242,.4); border-radius: 6px;
  color: var(--accent); font-family: var(--font-mono); font-size: .72rem; transition: background .25s, color .25s;
  white-space: nowrap;
}
.nav-contact:hover { background: var(--accent-soft); color: #fff; }

.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: .4rem; }
.burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }

/* ── language dropdown ── */
.lang-dropdown { position: relative; }
.lang-dropdown-toggle {
  display: flex; align-items: center; gap: .4rem; height: 32px; padding: 0 .65rem;
  border: 1px solid var(--line-4); border-radius: 6px; background: transparent; color: var(--muted-2);
  font-family: var(--font-mono); font-size: .7rem; font-weight: 600; cursor: pointer; transition: all .25s;
}
.lang-dropdown-toggle:hover, .lang-dropdown.open .lang-dropdown-toggle { border-color: rgba(127,214,242,.5); color: var(--accent); }
.lang-dropdown-caret { width: 8px; height: 8px; transition: transform .25s; flex-shrink: 0; }
.lang-dropdown.open .lang-dropdown-caret { transform: rotate(180deg); }
.lang-dropdown-menu {
  position: absolute; top: calc(100% + .6rem); inset-inline-end: 0; min-width: 140px;
  background: var(--bg-panel); border: 1px solid var(--line-4); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(0,0,0,.4); padding: .35rem; margin: 0; list-style: none;
  opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .22s ease, transform .22s ease; z-index: 200;
}
.lang-dropdown.open .lang-dropdown-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.lang-option {
  display: flex; align-items: center; gap: .5rem; padding: .55rem .65rem; border-radius: 6px;
  font-size: .8rem; font-family: var(--font-mono); color: var(--text); transition: background .2s;
}
a.lang-option:hover { background: var(--line-2); color: var(--text); }
.lang-option-current { color: var(--accent); font-weight: 700; }

/* ── generic section scaffolding ── */
section { position: relative; }
.section-pad { padding: clamp(4rem, 10vh, 8rem) clamp(1.25rem, 5vw, 4rem); }
.section-alt { border-block: 1px solid var(--line-1); }
.section-top-border { border-top: 1px solid var(--line-1); }
.section-inner { max-width: 1200px; margin: 0 auto; }
.eyebrow { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; color: var(--accent); margin-bottom: 1.2rem; }
.eyebrow-big { margin-bottom: 2.4rem; }
.h2 {
  font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.5rem); font-weight: 500;
  letter-spacing: -.028em; line-height: 1.18; text-wrap: pretty;
}
.section-head-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2.6rem;
}
.section-sub { max-width: 26rem; font-size: .9rem; color: var(--muted-3); text-wrap: pretty; }

.card-grid {
  display: grid; gap: 1px; background: var(--line-2);
  border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden;
}
.card-flex { display: flex; flex-direction: column; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.card-cell { background-color: var(--bg); background-image: var(--starfield); background-repeat: repeat; background-size: var(--starfield-size); }

/* ── hero ── */
#top {
  min-height: 92vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center; gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(3rem, 8vh, 7rem) clamp(1.25rem, 5vw, 4rem) clamp(4rem, 9vh, 8rem);
}
.hero-kicker {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .16em; color: var(--accent);
  margin-bottom: 1.6rem; animation: fadeUp .8s ease both;
}
.hero-title {
  font-family: var(--font-display); font-size: clamp(2.6rem, 5.4vw, 4.6rem); font-weight: 500;
  line-height: 1.02; letter-spacing: -.035em; margin-bottom: 1.8rem; animation: fadeUp .9s .06s ease both;
}
.hero-title .accent { color: var(--accent); }
.hero-lead { max-width: 30rem; font-size: 1rem; color: var(--muted-1); margin-bottom: 2.4rem; text-wrap: pretty; animation: fadeUp .9s .14s ease both; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .8rem; animation: fadeUp .9s .22s ease both; }
.btn-solid {
  display: inline-flex; align-items: center; gap: .6rem; padding: .8rem 1.5rem; border-radius: 7px;
  background: var(--text); color: var(--bg); font-size: .86rem; font-weight: 600;
  transition: transform .25s, box-shadow .3s; border: none; cursor: pointer;
}
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(127,214,242,.16); color: var(--bg); }
.btn-outline {
  display: inline-flex; align-items: center; gap: .6rem; padding: .8rem 1.5rem; border-radius: 7px;
  border: 1px solid var(--line-6); color: var(--text); font-size: .86rem; font-weight: 500;
  transition: border-color .25s, transform .25s;
}
.btn-outline:hover { border-color: rgba(127,214,242,.5); transform: translateY(-2px); color: var(--text); }
.hero-motto {
  margin-top: 3.2rem; padding-top: 1.6rem; border-top: 1px solid var(--line-2);
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; line-height: 1.4;
  letter-spacing: -.01em; max-width: 22rem; animation: fadeUp .9s .3s ease both;
}
.hero-motto span { color: var(--muted-5); }
.hero-visual { position: relative; height: clamp(360px, 62vh, 640px); }
.hero-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-caption { position: absolute; bottom: 0; inset-inline-start: 0; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; color: var(--muted-7); }

/* ── about / engineer ── */
.engineer-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.engineer-grid p.body-p { color: var(--muted-1); font-size: .96rem; margin-bottom: 1.15rem; text-wrap: pretty; }
.engineer-quote {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; letter-spacing: -.015em;
  line-height: 1.45; color: var(--text); padding-inline-start: 1.2rem; border-inline-start: 1px solid var(--accent); margin-top: 2rem;
}
.engineer-side { display: flex; flex-direction: column; gap: 2.4rem; }
.stats-grid { grid-template-columns: repeat(3, 1fr); }
.stat-cell { padding: 1.5rem 1.1rem; text-align: center; }
.stat-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.stat-label { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .06em; color: var(--muted-4); margin-top: .6rem; }
.label-small { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em; color: var(--muted-5); margin-bottom: 1rem; }
/* ── expertise ── */
.expertise-grid { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.domain-cell { padding: clamp(1.5rem, 3vw, 2.2rem); display: flex; flex-direction: column; gap: 1.4rem; transition: background .3s; }
.domain-cell:hover { background: var(--bg-panel); }
.domain-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.domain-title { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.domain-num { font-family: var(--font-mono); font-size: .66rem; color: var(--muted-8); }
.domain-desc { font-size: .84rem; color: var(--muted-3); line-height: 1.6; text-wrap: pretty; }
.domain-items { list-style: none; display: flex; flex-direction: column; gap: .5rem; margin-top: auto; }
.domain-items li { display: flex; align-items: center; gap: .6rem; font-family: var(--font-mono); font-size: .76rem; color: #b6bbc3; }
.domain-items li::before { content: ''; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ── layers / architecture zoom ── */
.zoom-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.layer-btn {
  text-align: start; background-color: var(--bg); background-image: var(--starfield); background-repeat: repeat; background-size: var(--starfield-size);
  border: none; cursor: pointer; padding: 1rem 1.2rem;
  display: flex; align-items: center; gap: 1rem; width: 100%; transition: background-color .25s;
}
.layer-btn:hover { background: var(--bg-panel); }
.layer-btn.active { background: var(--bg-panel); }
.layer-num { font-family: var(--font-mono); font-size: .66rem; color: var(--muted-8); width: 1.4rem; flex-shrink: 0; }
.layer-btn.active .layer-num { color: var(--accent); }
.layer-text { flex: 1; }
.layer-title { display: block; font-family: var(--font-display); font-size: .93rem; font-weight: 600; letter-spacing: -.005em; color: var(--muted-1); }
.layer-btn.active .layer-title { color: var(--text); }
.layer-sub { display: block; font-size: .76rem; color: var(--muted-4); margin-top: .15rem; }
.layer-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-6); flex-shrink: 0; }
.layer-btn.active .layer-dot { background: var(--accent); }
.layer-canvas-wrap { position: relative; height: clamp(280px, 44vh, 420px); }
.layer-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.layer-detail {
  margin-top: 1.4rem; padding: 1.3rem 1.4rem; border: 1px solid var(--line-3); border-radius: 10px;
  background-color: var(--bg); background-image: var(--starfield); background-repeat: repeat; background-size: var(--starfield-size);
}
.layer-detail-title { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; color: var(--accent); margin-bottom: .9rem; }
.layer-detail-desc { font-size: .88rem; color: var(--muted-1); margin-bottom: 1.1rem; text-wrap: pretty; }
.tag-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.tag {
  padding: .28rem .68rem; border: 1px solid var(--line-5); border-radius: 5px;
  font-family: var(--font-mono); font-size: .7rem; color: #b6bbc3;
}

/* ── work / projects ── */
.projects-list { display: flex; flex-direction: column; gap: 1px; background: var(--line-2); border-block: 1px solid var(--line-2); }
.project-item {
  background-color: var(--bg); background-image: var(--starfield); background-repeat: repeat; background-size: var(--starfield-size);
  padding: clamp(1.8rem, 4vw, 3rem) 0;
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(1.2rem, 3vw, 2.6rem); align-items: start;
}
.project-num { font-family: var(--font-mono); font-size: .7rem; color: var(--muted-8); letter-spacing: .08em; padding-top: .35rem; }
.project-name { font-family: var(--font-display); font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-bottom: .7rem; }
.project-tagline { font-size: .9rem; color: var(--accent); margin-bottom: 1.2rem; text-wrap: pretty; }
.stack-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.2rem; }
.stack-tag { padding: .24rem .6rem; border: 1px solid var(--line-5); border-radius: 4px; font-family: var(--font-mono); font-size: .68rem; color: var(--muted-1); white-space: nowrap; }
.project-link { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--font-mono); font-size: .72rem; color: var(--accent); }
.project-locked { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--font-mono); font-size: .7rem; color: var(--amber); }
.project-detail-col { display: flex; flex-direction: column; gap: 1.4rem; }
.project-detail-label { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .12em; color: var(--muted-5); margin-bottom: .5rem; }
.project-detail-text { font-size: .89rem; color: var(--muted-1); text-wrap: pretty; }
.project-detail-text.outcome { color: var(--text); }

/* ── evolution ── */
.evo-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.evo-chip {
  padding: .38rem .8rem; border: 1px solid var(--line-5); border-radius: 40px; background: transparent;
  cursor: pointer; font-family: var(--font-mono); font-size: .7rem; color: var(--muted-3); transition: all .25s;
}
.evo-chip.active { border-color: rgba(127,214,242,.5); color: var(--accent); }
.evo-canvas-wrap {
  position: relative; height: clamp(230px, 34vh, 320px); border: 1px solid var(--line-3);
  border-radius: 14px; overflow: hidden;
  background-color: var(--bg); background-image: var(--starfield); background-repeat: repeat; background-size: var(--starfield-size);
}
.evo-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.evo-detail { margin-top: 1.6rem; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(1.2rem, 4vw, 3rem); align-items: baseline; }
.evo-year { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.evo-label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; color: var(--accent); margin-top: .6rem; }
.evo-desc { font-size: .95rem; color: var(--muted-1); text-wrap: pretty; }

/* ── AI section ── */
.ai-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.ai-grid p.body-p { font-size: .96rem; color: var(--muted-1); margin-bottom: 1.15rem; text-wrap: pretty; }
.ai-flow { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-family: var(--font-mono); font-size: .78rem; margin-top: 1.25rem; }
.ai-flow-step { padding: .45rem .9rem; border: 1px solid var(--line-5); border-radius: 5px; color: #b6bbc3; }
.ai-flow-step.accent { border: 1px solid rgba(127,214,242,.35); color: var(--accent); }
.ai-flow-step.solid { border-radius: 5px; background: var(--text); color: var(--bg); font-weight: 600; border: none; }
.ai-flow-arrow { color: var(--muted-8); }
.ai-canvas-wrap { position: relative; height: clamp(300px, 46vh, 460px); }
.ai-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── code tabs ── */
.code-tabs { display: flex; gap: 1px; padding: 2px; border: 1px solid var(--line-4); border-radius: 7px; }
.code-tab { padding: .45rem 1rem; border: none; border-radius: 5px; cursor: pointer; font-family: var(--font-mono); font-size: .7rem; background: transparent; color: var(--muted-3); transition: all .25s; }
.code-tab.active { background: var(--text); color: var(--bg); }
.code-stage {
  border: 1px solid var(--line-3); border-radius: 14px;
  background-color: var(--bg); background-image: var(--starfield); background-repeat: repeat; background-size: var(--starfield-size);
  padding: clamp(1.5rem, 4vw, 3rem); min-height: 340px; display: flex; align-items: center; justify-content: center;
}
.code-caption { margin-top: 1.4rem; font-size: .88rem; color: var(--muted-4); max-width: 40rem; text-wrap: pretty; }
.arch-diagram { display: flex; flex-direction: column; align-items: center; gap: 0; width: 100%; max-width: 460px; }
.arch-box { padding: .7rem 1.6rem; border: 1px solid var(--line-6); border-radius: 7px; font-family: var(--font-mono); font-size: .8rem; color: var(--text); }
.arch-box.accent { border-color: rgba(127,214,242,.4); color: var(--accent); }
.arch-box.dim { border-color: var(--line-5); color: #b6bbc3; font-size: .78rem; padding: .6rem 1.3rem; }
.arch-vline { width: 1px; height: 2.2rem; background: var(--line-7); }
.arch-branch { display: flex; gap: 3rem; position: relative; }
.arch-branch::before { content: ''; position: absolute; top: -2.2rem; inset-inline: 25%; height: 1px; background: var(--line-7); }
.logic-steps { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: .6rem; }
.logic-step {
  display: flex; align-items: center; gap: 1rem; padding: .85rem 1.2rem; border: 1px solid var(--line-4); border-radius: 8px;
  background-color: var(--bg-alt); background-image: var(--starfield); background-repeat: repeat; background-size: var(--starfield-size);
}
.logic-n { font-family: var(--font-mono); font-size: .68rem; color: var(--accent); width: 1.6rem; flex-shrink: 0; }
.logic-op { font-family: var(--font-mono); font-size: .8rem; color: var(--text); flex: 1; }
.logic-note { font-size: .76rem; color: var(--muted-4); }
.code-pre { width: 100%; max-width: 620px; font-family: var(--font-mono); font-size: .8rem; line-height: 1.9; color: #b6bbc3; overflow-x: auto; text-align: start; direction: ltr; }

/* ── beyond code ── */
.beyond-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: clamp(1.5rem, 4vw, 3.5rem); }
.beyond-item { padding-top: 1.4rem; border-top: 1px solid var(--line-6); }
.beyond-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 500; letter-spacing: -.02em; margin-bottom: 1rem; }
.beyond-desc { font-size: .88rem; color: var(--muted-3); margin-bottom: 1.3rem; text-wrap: pretty; }
.beyond-items { list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.beyond-items li { font-family: var(--font-mono); font-size: .76rem; color: #b6bbc3; }

/* ── credentials ── */
.cred-top-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); margin-bottom: 3.6rem; }
.edu-cell { padding: 1.2rem 1.3rem; }
.edu-degree { font-family: var(--font-display); font-size: .95rem; font-weight: 600; letter-spacing: -.008em; }
.edu-school { font-size: .8rem; color: var(--muted-3); margin-top: .25rem; }
.edu-years { font-family: var(--font-mono); font-size: .68rem; color: var(--accent); margin-top: .5rem; }
.lang-list { display: flex; flex-direction: column; gap: 1.1rem; }
.lang-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; }
.lang-row-head .name { font-size: .88rem; color: var(--text); }
.lang-row-head .level { font-family: var(--font-mono); font-size: .68rem; color: var(--muted-4); }
.lang-bar-track { height: 2px; background: var(--line-3); border-radius: 2px; overflow: hidden; }
.lang-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.certs-grid { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.cert-cell { padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .4rem; transition: background .25s; }
.cert-cell:hover { background: var(--bg-panel); }
.cert-head { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.cert-name { font-size: .87rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.cert-date { font-family: var(--font-mono); font-size: .64rem; color: var(--muted-6); white-space: nowrap; }
.cert-issuer { font-size: .78rem; color: var(--accent); }
.cert-topics { font-size: .76rem; color: var(--muted-4); line-height: 1.5; }
.cert-verify { font-family: var(--font-mono); font-size: .68rem; color: var(--muted-3); margin-top: .3rem; }
.cert-verify:hover { color: var(--accent); }
.cert-cell.featured { grid-column: 1 / -1; background: var(--accent-soft); border-left: 2px solid var(--accent); padding-left: 1.15rem; }
.cert-cell.featured .cert-name { font-size: .92rem; }
.cert-cell.featured .cert-issuer { color: var(--text); }
.cert-badge { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .08em; color: var(--accent); border: 1px solid var(--accent); border-radius: 40px; padding: .1rem .5rem; white-space: nowrap; }

/* ── testimonials ── */
.testi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem); }
.testi-card { display: flex; flex-direction: column; gap: 1.2rem; }
.testi-quote { font-family: var(--font-display); font-size: 1rem; font-weight: 400; line-height: 1.55; letter-spacing: -.01em; color: var(--text-dim); text-wrap: pretty; }
.testi-cap { padding-top: 1rem; border-top: 1px solid var(--line-4); }
.testi-name { font-size: .85rem; font-weight: 600; color: var(--text); }
.testi-role { font-size: .76rem; color: var(--muted-4); margin-top: .2rem; line-height: 1.45; }
.testi-link { display: inline-block; font-family: var(--font-mono); font-size: .66rem; color: var(--muted-3); margin-top: .5rem; }
.testi-link:hover { color: var(--accent); }

/* ── partners / investors ── */
.offers-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 2.6rem; }
.offer-cell { padding: 1.8rem 1.6rem; display: flex; flex-direction: column; gap: .7rem; }
.offer-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; }
.offer-text { font-size: .9rem; color: var(--muted-1); text-wrap: pretty; line-height: 1.55; }

/* ── contact / next ── */
#next { position: relative; overflow: hidden; padding: clamp(5rem, 14vh, 11rem) clamp(1.25rem, 5vw, 4rem); border-top: 1px solid var(--line-1); }
#planet-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.next-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 7vw, 6rem); align-items: start; }
.next-heading { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.02; margin-bottom: 1.6rem; }
.next-lead { font-size: 1.05rem; color: var(--muted-1); max-width: 26rem; margin-bottom: 2.4rem; text-wrap: pretty; }
.next-tagline { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; letter-spacing: -.02em; color: var(--accent); margin-bottom: 1rem; }
.next-proof { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .07em; color: var(--muted-4); margin-bottom: 2.4rem; }
.contact-list { display: flex; flex-direction: column; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; max-width: 26rem; }
.contact-row {
  background: var(--bg-alt); padding: .95rem 1.2rem; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; color: var(--text); transition: background .25s;
}
a.contact-row:hover { background: #12151b; color: var(--text); }
.contact-row .label { font-size: .88rem; }
.contact-row .value { font-family: var(--font-mono); font-size: .72rem; color: var(--muted-4); }

.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; color: var(--muted-5); }
.field input, .field textarea {
  background: transparent; border: none; border-bottom: 1px solid var(--line-7); padding: .7rem 0;
  color: var(--text); font-size: .95rem; outline: none; transition: border-color .25s;
}
.field input:focus, .field textarea:focus { border-bottom-color: var(--accent); }
.field textarea { resize: none; min-height: 6.5rem; }
.form-submit {
  margin-top: 1rem; align-self: flex-start; padding: .85rem 1.8rem; border: none; border-radius: 7px;
  background: var(--text); color: var(--bg); font-size: .88rem; font-weight: 600; cursor: pointer;
  transition: transform .25s, box-shadow .3s;
}
.form-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(127,214,242,.16); }
.form-submit:disabled { opacity: .7; cursor: default; transform: none; box-shadow: none; }
.form-status { font-family: var(--font-mono); font-size: .74rem; min-height: 1.2em; }
.form-status.ok { color: #7fe6b0; }
.form-status.err { color: #f2a17f; }

footer {
  padding: 2.2rem clamp(1.25rem, 5vw, 4rem); border-top: 1px solid var(--line-1);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  font-family: var(--font-mono); font-size: .7rem; color: var(--muted-6);
}
footer a { color: var(--muted-6); }
footer a:hover { color: var(--accent); }

/* ── responsive ── */
@media (max-width: 900px) {
  #top { grid-template-columns: 1fr; }
  .hero-visual { height: 320px; }
  .engineer-grid, .zoom-grid, .ai-grid, .next-grid { grid-template-columns: 1fr; }
  .project-item { grid-template-columns: 1fr; gap: .8rem; }
  .project-num { padding-top: 0; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .burger { display: flex; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 100%; inset-inline: 0;
    background: var(--bg-alt); padding: 1rem clamp(1.25rem, 5vw, 4rem) 1.5rem; border-bottom: 1px solid var(--line-1); gap: 1rem;
  }
}

/* ── cookie banner (kept from previous site) ── */
.cookie-banner {
  position: fixed; bottom: 1.2rem; left: 1.2rem; right: 1.2rem; max-width: 560px; margin: 0 auto;
  background: var(--bg-panel); border: 1px solid var(--line-4); border-radius: 14px; padding: 1.2rem 1.4rem;
  box-shadow: 0 10px 40px rgba(0,0,0,.4); z-index: 500;
  display: none; /* affiché par main.js (style.display) selon le choix enregistré */
}
.cookie-banner p { font-size: .83rem; color: var(--muted-1); line-height: 1.55; margin-bottom: 1rem; }
.cookie-banner-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.cookie-banner-actions button { padding: .55rem 1.1rem; font-size: .8rem; border-radius: 6px; cursor: pointer; }
.cookie-settings-link { background: none; border: none; color: var(--muted-4); font-size: .72rem; text-decoration: underline; cursor: pointer; padding: 0; font-family: inherit; }
.cookie-settings-link:hover { color: var(--accent); }

/* ── easter eggs (hidden "off the clock" hobbies, revealed a few playful ways) ── */
.egg-toast {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 9999; max-width: 260px;
  background: var(--bg-panel); border: 1px solid var(--line-6); border-radius: 12px;
  padding: 1rem 1.2rem; box-shadow: 0 18px 50px rgba(0,0,0,.5);
  font-family: var(--font-mono); font-size: .8rem; color: var(--text);
  opacity: 0; transform: translateY(14px) scale(.98);
  transition: opacity .35s ease, transform .35s ease; pointer-events: none;
}
.egg-toast.show { opacity: 1; transform: translateY(0) scale(1); }
.egg-toast-title { color: var(--accent); text-transform: uppercase; letter-spacing: .07em; font-size: .68rem; margin-bottom: .6rem; }
.egg-toast-list { display: flex; flex-direction: column; gap: .35rem; color: var(--text-dim); }
.egg-toast-list span::before { content: '◦ '; color: var(--accent); }

.egg-marquee {
  position: fixed; left: 0; right: 0; bottom: 2.2rem; z-index: 9999;
  overflow: hidden; pointer-events: none; height: 2rem;
}
.egg-marquee span {
  position: absolute; top: 0; white-space: nowrap; left: 100%;
  font-family: var(--font-mono); font-size: .85rem; letter-spacing: .04em;
  color: var(--accent); text-shadow: 0 0 14px rgba(127,214,242,.5);
  animation: egg-marquee-move 7s linear forwards;
}
@keyframes egg-marquee-move {
  to { transform: translateX(-140vw); }
}
@media (prefers-reduced-motion: reduce) {
  .egg-marquee span { animation: none; display: none; }
}

/* ── custom cursor (desktop): a small glowing node + a trailing ring,
   echoing the node/glow language of the 3D figures ── */
body.has-custom-cursor, body.has-custom-cursor a, body.has-custom-cursor button,
body.has-custom-cursor input, body.has-custom-cursor textarea, body.has-custom-cursor select,
body.has-custom-cursor [role="button"], body.has-custom-cursor label {
  cursor: none;
}
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9997;
  border-radius: 50%; opacity: 0; transition: opacity .3s ease;
}
.cursor-dot {
  width: 7px; height: 7px; background: var(--accent);
  box-shadow: 0 0 10px 2px rgba(127,214,242,.75), 0 0 22px 6px rgba(127,214,242,.3);
}
.cursor-ring {
  width: 32px; height: 32px; margin: 0;
  border: 1px solid rgba(127,214,242,.4);
  transition: width .22s ease, height .22s ease, border-color .22s ease, background .22s ease, opacity .3s ease;
}
.cursor-ring.hover {
  width: 54px; height: 54px;
  border-color: rgba(127,214,242,.85);
  background: rgba(127,214,242,.08);
}
.cursor-ring.down { width: 24px; height: 24px; border-color: var(--accent); }
@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ── mobile equivalent: a soft glow ripple where the finger lands ── */
.touch-ripple {
  position: fixed; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; pointer-events: none; z-index: 9997;
  border: 1px solid rgba(127,214,242,.75);
  background: rgba(127,214,242,.15);
  animation: touch-ripple-anim .6s ease-out forwards;
}
@keyframes touch-ripple-anim {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(4.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .touch-ripple { animation: none; display: none; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ── legal / policy pages ── */
.legal-page-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem clamp(1.25rem, 5vw, 4rem); border-bottom: 1px solid var(--line-1);
}
.legal-page-logo { font-family: var(--font-mono); font-weight: 700; font-size: .95rem; letter-spacing: .02em; color: var(--text); text-decoration: none; }
.legal-top-right { display: flex; align-items: center; gap: 1.4rem; }
.legal-langs { display: flex; gap: .6rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .04em; }
.legal-langs a, .legal-langs span { color: var(--muted-6); text-decoration: none; }
.legal-langs a:hover { color: var(--accent); }
.legal-langs span { color: var(--accent); }
.legal-back {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em;
  color: var(--muted-3); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem;
  transition: color .2s;
}
.legal-back:hover { color: var(--accent); }
.legal-hero { padding: clamp(3.5rem, 11vh, 6.5rem) clamp(1.25rem, 5vw, 4rem) clamp(2rem, 5vh, 3rem); max-width: 52rem; }
.legal-badge {
  display: inline-block; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--line-5); border-radius: 20px; padding: .35rem .9rem; margin-bottom: 1.6rem;
}
.legal-hero h1 { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.legal-meta { margin-top: 1.1rem; font-family: var(--font-mono); font-size: .78rem; color: var(--muted-5); }
.legal-body { padding: 0 clamp(1.25rem, 5vw, 4rem) clamp(4rem, 8vh, 6rem); max-width: 52rem; }
.legal-section { margin-top: 3rem; padding-top: 2.1rem; border-top: 1px solid var(--line-1); scroll-margin-top: 2rem; }
.legal-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.legal-section h2 { font-family: var(--font-display); font-size: 1.28rem; font-weight: 500; }
.legal-section p { margin-top: .9rem; color: var(--muted-1); font-size: .96rem; line-height: 1.65; text-wrap: pretty; }
.legal-section ul { margin-top: .9rem; padding-inline-start: 1.2rem; color: var(--muted-1); font-size: .96rem; line-height: 1.75; }
.legal-section li { margin-bottom: .4rem; }
.legal-section a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-section strong { color: var(--text); font-weight: 600; }
.legal-page-footer {
  padding: 2rem clamp(1.25rem, 5vw, 4rem) 3rem; border-top: 1px solid var(--line-1);
  font-family: var(--font-mono); font-size: .72rem; color: var(--muted-6);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.2rem;
}
.legal-page-footer a, .legal-page-footer button.cookie-settings-link { color: var(--muted-6); }
.legal-page-footer a:hover, .legal-page-footer button.cookie-settings-link:hover { color: var(--accent); }

/* ── onglets de code : seul « arch » est visible sans JavaScript (main.js bascule ensuite via style.display) ── */
.code-panel { display: none; }
.code-panel[data-panel="arch"] { display: flex; }

/* ── champ piège anti-spam du formulaire (masqué visuellement, pas hors écran : pas de défilement horizontal en RTL) ── */
.hp { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; pointer-events: none; }

/* ── utilitaires : remplacent d'anciens attributs style="" (la CSP n'autorise plus les styles en ligne).
   !important reproduit la priorité qu'avaient les styles en ligne sur .h2, .lang-bar-fill, etc. ── */
.mb-0 { margin-bottom: 0 !important; }
.mb-20 { margin-bottom: 2rem !important; }
.mb-30 { margin-bottom: 3rem !important; }
.mb-34 { margin-bottom: 3.4rem !important; }
.mw-28 { max-width: 28rem !important; }
.mw-30 { max-width: 30rem !important; }
.mw-32 { max-width: 32rem !important; }
.mw-34 { max-width: 34rem !important; }
.w-85 { width: 85% !important; }
.w-90 { width: 90% !important; }
.w-100 { width: 100% !important; }
.jc-start { justify-content: flex-start !important; }
.ai-grid-sep { margin-top: 3.4rem !important; padding-top: 3rem !important; border-top: 1px solid var(--line-1) !important; }
