/* ==========================================================================
   Michaël St-Louis — portfolio
   Dark page, one electric-green accent, self-hosted fonts.
   The "agents" layer (assets/js/site.js) is progressive enhancement: every
   rule that hides content is scoped to html.js-build, which only the inline
   <head> script sets, and html.all-built (safety timer) undoes it.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #08090a;
  --bg-raise: #101213;
  --bg-raise-2: #161819;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #eef0ec;
  --text-muted: #a2a8a4;
  --text-faint: #767c78;
  --accent: #2eff8c;
  --accent-hover: #6dffad;
  --accent-ink: #04140b;
  --accent-soft: rgba(46, 255, 140, .14);
  --gold: #f2c14e;
  --silver: #c9ced4;

  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 56px);
  --pill: 999px;
  --radius: 16px;
  --nav-h: 76px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (pointer: fine) { html { overscroll-behavior: none; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(46, 255, 140, .18);
}
a { color: inherit; }
a, button { touch-action: manipulation; }
img { display: block; max-width: 100%; height: auto; }
p, h1, h2, h3, dl, dd, figure, ol, ul { margin: 0; }
ol[class], ul[class] { list-style: none; padding: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: calc(var(--nav-h) + 12px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* FR / EN */
html:not([lang="en"]) [lang="en"] { display: none !important; }
html[lang="en"] [lang="fr"] { display: none !important; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ── Buttons, tags, chips ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--pill);
  font: 600 15px/1 var(--font-body);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-hover); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--text); }

.tag {
  display: inline-flex; align-items: center;
  padding: 5px 10px; border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  font: 500 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
  white-space: nowrap;
}
.tag--accent { border-color: rgba(46, 255, 140, .4); color: var(--accent); background: var(--accent-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  padding: 5px 10px; border-radius: 8px;
  background: var(--bg-raise-2); border: 1px solid var(--line);
  font: 400 12px/1.3 var(--font-mono); color: var(--text-muted);
}
.chips--lg li { padding: 10px 14px; font-size: 13px; color: var(--text); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); flex: none; }

/* ── Nav ── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  transition: background-color .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(8, 9, 10, .82); border-bottom-color: var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.nav__brand {
  justify-self: start;
  font: 800 22px/1 var(--font-display); font-stretch: 112%;
  letter-spacing: -.02em; text-decoration: none;
}
.nav__brand span { color: var(--accent); }
.nav__pill {
  display: flex; gap: 2px; padding: 5px;
  border: 1px solid var(--line-strong); border-radius: var(--pill);
  background: rgba(16, 18, 19, .72);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.nav__pill a {
  padding: 9px 16px; border-radius: var(--pill);
  font: 500 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none;
  transition: color .18s ease, background-color .18s ease;
}
.nav__pill a:hover { color: var(--text); }
.nav__pill a[aria-current="true"] { color: var(--text); background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px var(--line-strong); }
.nav__end { justify-self: end; display: flex; align-items: center; gap: 10px; }
.nav__lang, .nav__menu {
  height: 40px; min-width: 48px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--pill);
  background: transparent; color: var(--text-muted);
  font: 500 12px/1 var(--font-mono); letter-spacing: .08em; cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.nav__lang:hover, .nav__menu:hover { color: var(--text); border-color: var(--text); }
.nav__menu { display: none; position: relative; width: 44px; min-width: 44px; padding: 0; }
.nav__menu-bars, .nav__menu-bars::before {
  position: absolute; left: 13px; width: 16px; height: 1.5px; background: currentColor;
  transition: transform .2s ease;
}
.nav__menu-bars { top: 22px; transform: translateY(-3px); }
.nav__menu-bars::before { content: ""; left: 0; top: 6px; }
.nav__menu[aria-expanded="true"] .nav__menu-bars { transform: translateY(2px) rotate(45deg); }
.nav__menu[aria-expanded="true"] .nav__menu-bars::before { transform: translateY(-6px) rotate(-90deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 25;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 32px;
  background: rgba(8, 9, 10, .97);
  overscroll-behavior: contain;
}
.mobile-menu nav { display: flex; flex-direction: column; }
.mobile-menu a {
  padding: 16px 0; border-bottom: 1px solid var(--line);
  font: 800 34px/1.1 var(--font-display); font-stretch: 110%; letter-spacing: -.02em; text-transform: uppercase;
  text-decoration: none;
}
.mobile-menu a:hover { color: var(--accent); }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: max(100vh, 760px); min-height: max(100svh, 760px);
  overflow: hidden;
  isolation: isolate;
}
.hero__grid {
  position: absolute; inset: 0; z-index: -2;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 100%);
  opacity: .35;
  transition: opacity .8s ease;
}
.hero__rulers { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .6s ease; }
.ruler { position: absolute; background-color: rgba(8, 9, 10, .8); }
.ruler--x {
  left: 0; right: 0; top: 0; height: 16px;
  border-bottom: 1px solid var(--accent-soft);
  background-image: repeating-linear-gradient(90deg, var(--accent-soft) 0 1px, transparent 1px 10px),
                    repeating-linear-gradient(90deg, rgba(46, 255, 140, .4) 0 1px, transparent 1px 80px);
  background-size: auto 6px, auto 16px; background-repeat: repeat-x; background-position: bottom left;
}
.ruler--y {
  top: 0; bottom: 0; left: 0; width: 16px;
  border-right: 1px solid var(--accent-soft);
  background-image: repeating-linear-gradient(0deg, var(--accent-soft) 0 1px, transparent 1px 10px),
                    repeating-linear-gradient(0deg, rgba(46, 255, 140, .4) 0 1px, transparent 1px 80px);
  background-size: 6px auto, 16px auto; background-repeat: repeat-y; background-position: top right;
}
.hero__glow {
  position: absolute; z-index: -1;
  left: 50%; bottom: -10%; width: min(1100px, 120vw); aspect-ratio: 1.3;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(46, 255, 140, .16), rgba(46, 255, 140, .05) 55%, transparent 100%);
}
.hero__title {
  position: absolute; left: 0; right: 0; top: clamp(96px, 13vh, 132px);
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--font-display); font-weight: 900; font-stretch: 118%;
  font-size: clamp(64px, 14.2vw, 230px);
  line-height: .84; letter-spacing: -.035em; text-transform: uppercase;
  text-align: center; white-space: nowrap;
}
.hero__line { display: block; }
.hero__line--fade {
  background: linear-gradient(180deg, var(--text) 8%, rgba(238, 240, 236, .35) 48%, rgba(238, 240, 236, 0) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ch { display: inline-block; }
.hero__portrait {
  position: absolute; z-index: 2;
  left: 50%; bottom: 0; transform: translateX(-50%);
  height: min(74%, 900px); aspect-ratio: 721 / 1164;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 98%);
          mask-image: linear-gradient(180deg, #000 62%, transparent 98%);
}
.hero__portrait img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 -2px 18px rgba(46, 255, 140, .12)); }
.hero__intro {
  position: absolute; z-index: 3;
  left: var(--gutter); bottom: clamp(32px, 7vh, 72px);
  width: min(400px, 30vw);
}
.eyebrow {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font: 500 12px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
}
.hero__lede { font-size: 16px; line-height: 1.6; color: var(--text-muted); margin-bottom: 22px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero__facts {
  position: absolute; z-index: 3;
  right: var(--gutter); bottom: clamp(32px, 7vh, 72px);
  display: flex; flex-direction: column; gap: 14px;
  width: 230px;
}
.hero__facts div { display: grid; grid-template-columns: 74px 1fr; align-items: baseline; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-strong); }
.hero__facts dt { font: 800 28px/1 var(--font-display); font-stretch: 110%; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero__facts dd { font-size: 13px; line-height: 1.4; color: var(--text-muted); }
.build-log {
  position: absolute; z-index: 3;
  left: 50%; bottom: 18px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: var(--pill);
  border: 1px solid var(--line-strong); background: rgba(16, 18, 19, .8);
  font: 500 11px/1 var(--font-mono); letter-spacing: .06em; color: var(--text-muted);
  white-space: nowrap;
}
.build-log .dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px var(--accent-soft); }

/* ── Sections ── */
.section { position: relative; padding-block: clamp(88px, 12vw, 152px); border-top: 1px solid var(--line); }
.section__head { max-width: 860px; margin-bottom: clamp(40px, 6vw, 72px); }
.kicker {
  display: flex; gap: 12px; align-items: center; margin-bottom: 18px;
  font: 500 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted);
}
.kicker > span:first-child { color: var(--accent); }
.section__head h2 {
  font: 900 clamp(38px, 6.2vw, 84px)/.95 var(--font-display); font-stretch: 112%;
  letter-spacing: -.035em; text-transform: uppercase;
}
.section__lede { margin-top: 20px; max-width: 560px; color: var(--text-muted); font-size: 17px; }

/* 01 Profil */
.about { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.about__text p { color: var(--text-muted); font-size: 17px; }
.about__text p + p { margin-top: 18px; }
.about__lead.about__lead { color: var(--text); font: 600 clamp(22px, 2.3vw, 28px)/1.4 var(--font-body); letter-spacing: -.01em; }
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skills > li { background: var(--bg); padding: 22px; min-width: 0; }
.skills { transition: background-color .4s ease, border-color .4s ease; }
.js-build:not(.all-built) [data-build-section]:not(.is-built) .skills { background-color: transparent; border-color: transparent; }
.skills h3 { margin-bottom: 12px; font: 500 12px/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.skills__langs { font: 400 13px/1.8 var(--font-mono); color: var(--text-muted); }

/* 02 Expériences */
.xp { display: flex; flex-direction: column; }
.xp__item {
  display: grid; grid-template-columns: 170px 1fr 320px; gap: clamp(20px, 3vw, 48px);
  padding-block: 36px; border-top: 1px solid var(--line);
}
.xp__item:last-child { border-bottom: 1px solid var(--line); }
.xp__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.xp__meta time { font: 500 13px/1.3 var(--font-mono); color: var(--text-muted); }
.xp__body { min-width: 0; }
.xp__body h3 { font: 800 clamp(24px, 2.4vw, 32px)/1.1 var(--font-display); font-stretch: 108%; letter-spacing: -.02em; }
.xp__org { margin: 8px 0 14px; color: var(--accent); font-size: 14px; font-weight: 500; }
.xp__body > p:not(.xp__org) { color: var(--text-muted); margin-bottom: 18px; max-width: 620px; }

.viz {
  position: relative; height: 100%; min-height: 168px;
  padding: 40px 18px 18px; border-radius: var(--radius);
  background: var(--bg-raise); border: 1px solid var(--line);
  overflow: hidden;
}
.viz__title { position: absolute; left: 18px; top: 14px; font: 400 11px/1 var(--font-mono); color: var(--text-faint); }
.viz--bars { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.viz--bars i { position: relative; display: block; height: 10px; border-radius: 4px; background: var(--bg-raise-2); overflow: hidden; }
.viz--bars i::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--accent);
  transform: scaleX(var(--v)); transform-origin: left; transition: transform .9s cubic-bezier(.2, .7, .2, 1);
}
.viz--bars i:nth-child(odd)::after { opacity: .55; }
.viz--flow { display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.viz__node {
  position: relative; align-self: flex-start;
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--bg);
  font: 500 12px/1 var(--font-mono); color: var(--text);
}
.viz__node:nth-of-type(2) { margin-left: 40px; border-color: rgba(46, 255, 140, .45); color: var(--accent); }
.viz__node:nth-of-type(3) { margin-left: 80px; }
.viz__node:not(:last-child)::after {
  content: ""; position: absolute; left: 20px; top: 100%; width: 40px; height: 18px;
  border-left: 1px dashed var(--line-strong); border-bottom: 1px dashed var(--line-strong); border-bottom-left-radius: 8px;
}
.viz--app { display: flex; flex-direction: column; gap: 8px; }
.viz--app i {
  display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: center;
  height: 30px; padding: 0 10px; border-radius: 8px; background: var(--bg-raise-2);
}
.viz--app i::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); opacity: .7; }
.viz--app i::after { content: ""; height: 6px; width: 70%; border-radius: 3px; background: var(--line-strong); }
.viz--app i:nth-child(3)::after { width: 52%; }
.viz--app i:nth-child(4)::after { width: 80%; }

/* 03 Projets */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project {
  display: flex; flex-direction: column; gap: 12px;
  padding: 26px; border-radius: var(--radius);
  background: var(--bg-raise); border: 1px solid var(--line);
  transition: transform .2s ease, border-color .2s ease;
  min-width: 0;
}
.project:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.project--feature {
  grid-column: span 2;
  background: radial-gradient(120% 120% at 100% 0%, rgba(46, 255, 140, .12), transparent 55%), var(--bg-raise);
  border-color: rgba(46, 255, 140, .28);
}
.project__top { display: flex; justify-content: space-between; align-items: center; }
.project__n { font: 500 12px/1 var(--font-mono); color: var(--text-faint); }
.project h3 { margin-top: 18px; font: 900 clamp(28px, 3vw, 40px)/1 var(--font-display); font-stretch: 112%; letter-spacing: -.03em; text-transform: uppercase; }
.project--feature h3 { font-size: clamp(40px, 5vw, 64px); }
.project__value { font: 500 12px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.project > p:not(.project__value) { color: var(--text-muted); font-size: 15px; flex: 1; }

/* 04 GitHub */
.live { display: grid; grid-template-columns: 1.1fr 1.1fr .9fr; gap: 16px; }
.live__panel { padding: 26px; border-radius: var(--radius); background: var(--bg-raise); border: 1px solid var(--line); min-width: 0; }
.live__panel h3 { margin-bottom: 20px; font: 500 12px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.live__bars, .live__feed { display: flex; flex-direction: column; gap: 14px; }
.live__bar-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.live__bar-row span:last-child { font-family: var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.live__track { height: 6px; border-radius: 3px; background: var(--bg-raise-2); overflow: hidden; }
.live__fill { height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.live__feed li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.live__feed li > span { min-width: 0; overflow-wrap: anywhere; }
.live__feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.live__feed time { flex: none; font: 400 12px/1.6 var(--font-mono); color: var(--text-faint); }
.live__now { display: flex; gap: 12px; align-items: baseline; font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
.live__now .dot { position: relative; top: -2px; animation: blink 1.6s ease-in-out infinite; }
.live__now a { color: var(--accent); text-underline-offset: 3px; }
.live__fallback { color: var(--text-muted); font-size: 14px; }
.live__fallback a { color: var(--accent); }
.skeleton { height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-raise-2), #1f2223, var(--bg-raise-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes blink { 50% { opacity: .3; } }

/* 05 Musique */
.section--music { background: radial-gradient(80% 60% at 0% 0%, rgba(242, 193, 78, .06), transparent 60%), var(--bg); }
.music { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.medals__title, .gigs h3 { margin-bottom: 16px; font: 500 12px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.medals__list li {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; align-items: center;
  padding-block: 18px; border-top: 1px solid var(--line);
}
.medals__list li:last-child { border-bottom: 1px solid var(--line); }
.medal {
  justify-self: start; padding: 6px 10px; border-radius: var(--pill);
  font: 600 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
}
.medal--gold { background: rgba(242, 193, 78, .14); color: var(--gold); border: 1px solid rgba(242, 193, 78, .4); }
.medal--silver { background: rgba(201, 206, 212, .1); color: var(--silver); border: 1px solid rgba(201, 206, 212, .35); }
.medal--final { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(46, 255, 140, .4); }
.medals__what { display: flex; flex-direction: column; font-weight: 600; font-size: 16px; line-height: 1.35; min-width: 0; }
.medals__what small { font-weight: 400; font-size: 13px; color: var(--text-muted); }
.medals__list time { font: 800 22px/1 var(--font-display); font-stretch: 108%; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.music__side { display: flex; flex-direction: column; gap: 48px; }
.gigs__by { margin: -8px 0 14px; color: var(--gold); font-weight: 600; font-size: 15px; }
.timeline { position: relative; display: flex; flex-direction: column; gap: 18px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--accent), rgba(46, 255, 140, .1)); }
.timeline li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 14px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent); }
.timeline time { font: 500 13px/1.6 var(--font-mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.timeline p { color: var(--text-muted); font-size: 15px; }

/* 06 Formation */
.edu { display: flex; flex-direction: column; gap: 12px; }
.edu__item {
  display: grid; grid-template-columns: 170px 1fr auto; gap: 24px; align-items: center;
  padding: 26px 28px; border-radius: var(--radius); background: var(--bg-raise); border: 1px solid var(--line);
}
.edu__item.is-current { border-color: rgba(46, 255, 140, .28); }
.edu__item time { font: 500 13px/1 var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.edu__item h3 { font: 800 clamp(20px, 2vw, 26px)/1.2 var(--font-display); font-stretch: 106%; letter-spacing: -.015em; }
.edu__item p { color: var(--text-muted); margin-top: 4px; }

/* 07 Contact */
.section--contact { background: radial-gradient(70% 70% at 50% 100%, rgba(46, 255, 140, .09), transparent 70%), var(--bg); }
.contact__title.contact__title { font-size: clamp(48px, 9vw, 128px); }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.intro-form { display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: var(--radius); background: var(--bg-raise); border: 1px solid var(--line); }
.intro-form label { font: 500 12px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.intro-form label span { text-transform: none; letter-spacing: 0; color: var(--text-faint); }
.intro-form select, .intro-form textarea {
  width: 100%; margin-bottom: 8px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background-color: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font-body);
  transition: border-color .18s ease;
}
.intro-form select option { background-color: var(--bg); color: var(--text); }
.intro-form select:hover, .intro-form textarea:hover { border-color: var(--text-faint); }
.intro-form select:focus-visible, .intro-form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.intro-form textarea { resize: vertical; min-height: 96px; }
.intro-form .btn { align-self: flex-start; margin-top: 4px; }
.contact__direct { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.contact__methods { display: flex; flex-direction: column; width: 100%; font-style: normal; }
.contact__methods a {
  display: flex; flex-direction: column; gap: 6px; padding-block: 20px; border-top: 1px solid var(--line);
  text-decoration: none; transition: color .18s ease;
}
.contact__methods a:last-child { border-bottom: 1px solid var(--line); }
.contact__methods a:hover strong { color: var(--accent); }
.contact__methods small { font: 500 12px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.contact__methods strong { font: 700 clamp(18px, 2.2vw, 26px)/1.25 var(--font-display); font-stretch: 104%; overflow-wrap: anywhere; transition: color .18s ease; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials a {
  display: inline-flex; padding: 10px 14px; border-radius: var(--pill); border: 1px solid var(--line-strong);
  font: 500 13px/1 var(--font-mono); text-decoration: none; transition: border-color .18s ease, color .18s ease;
}
.socials a:hover { border-color: var(--accent); color: var(--accent); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-block: 28px 80px; }
.footer small { font: 400 12px/1 var(--font-mono); color: var(--text-faint); letter-spacing: .06em; }

/* ── Agents toggle ── */
.agents-toggle {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--pill);
  border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--text-muted);
  font: 500 11px/1 var(--font-mono); letter-spacing: .04em; cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.agents-toggle:hover { color: var(--text); border-color: var(--text); }
.agents-toggle .dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px var(--accent-soft); }
.agents-toggle__off { display: none; }
.agents-off .agents-toggle__on { display: none; }
.agents-off .agents-toggle__off { display: inline; }
.agents-off .agents-toggle .dot { background: var(--text-faint); box-shadow: none; }
.agents-off .agents, .agents-off .build-log { display: none; }

/* ── Build states (only while html.js-build and not html.all-built) ── */
.js-build:not(.all-built) .nav:not(.is-placed) { opacity: 0; }
.js-build:not(.all-built) .nav.is-placed { transition: opacity .45s ease; }
.js-build:not(.all-built) [data-hero]:not(.is-built) [data-build]:not(.is-placed),
.js-build:not(.all-built) [data-build-section]:not(.is-built) [data-build]:not(.is-placed) { opacity: 0; }
.js-build:not(.all-built) [data-build].is-placed { transition: opacity .45s ease; }
.js-build:not(.all-built) [data-hero]:not(.is-built) .ch:not(.on) { opacity: 0; }
.js-build:not(.all-built) [data-hero]:not(.is-built) .hero__rulers { opacity: 1; }
.js-build:not(.all-built) [data-hero]:not(.is-built) .hero__grid { opacity: .9; }
.js-build:not(.all-built) [data-hero]:not(.is-built) .hero__portrait.is-placed img { animation: develop 1s cubic-bezier(.2, .7, .2, 1) both; }
.js-build:not(.all-built) [data-hero]:not(.is-built) .build-log .dot { animation: blink .9s ease-in-out infinite; }
.js-build:not(.all-built) [data-build-section]:not(.is-built) .section__head.is-placed h2 { animation: type-in .7s steps(22, end) both; }
.js-build:not(.all-built) [data-build-section]:not(.is-built) [data-build]:not(.is-placed) .viz--bars i::after { transform: scaleX(0); }
@keyframes develop {
  from { clip-path: inset(100% 0 0 0); filter: brightness(2.4) saturate(0); }
  to   { clip-path: inset(0 0 0 0);    filter: brightness(1); }
}
@keyframes type-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ── Agent overlay ── */
.agents { position: absolute; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; }
.wire {
  position: absolute;
  border: 1px solid var(--c);
  background: color-mix(in srgb, var(--c) 5%, transparent);
}
.wire::before, .wire::after,
.wire > i::before, .wire > i::after {
  content: ""; position: absolute; width: 7px; height: 7px;
  background: var(--bg); border: 1px solid var(--c);
}
.wire::before { left: -4px; top: -4px; }
.wire::after { right: -4px; top: -4px; }
.wire > i::before { left: -4px; bottom: -4px; }
.wire > i::after { right: -4px; bottom: -4px; }
.wire > b {
  position: absolute; left: -1px; bottom: calc(100% + 6px);
  padding: 3px 6px; border-radius: 3px;
  background: var(--c); color: #08090a;
  font: 500 10px/1 var(--font-mono); letter-spacing: .04em; white-space: nowrap;
}
.wire--text { background-image: repeating-linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, transparent) 0 10px, transparent 10px 20px); background-size: 72% 100%; background-repeat: no-repeat; background-position: 14px 14px; }
.wire--image {
  background-image:
    linear-gradient(to top right, transparent calc(50% - .5px), color-mix(in srgb, var(--c) 45%, transparent) 50%, transparent calc(50% + .5px)),
    linear-gradient(to bottom right, transparent calc(50% - .5px), color-mix(in srgb, var(--c) 45%, transparent) 50%, transparent calc(50% + .5px));
}
.wire.is-done { opacity: 0; transition: opacity .35s ease; }
.agent { position: absolute; left: 0; top: 0; will-change: transform; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
.agent svg { display: block; width: 20px; height: 22px; }
.agent .ibeam { display: none; transform: translate(-10px, -11px); }
.agent.is-typing .arrow { display: none; }
.agent.is-typing .ibeam { display: block; }
.agent__tag {
  position: absolute; left: 16px; top: 18px;
  padding: 4px 7px; border-radius: 4px 10px 10px 10px;
  background: var(--c); color: #08090a;
  font: 500 10px/1 var(--font-mono); letter-spacing: .03em; white-space: nowrap;
  transition: opacity .3s ease;
}
.agent.is-quiet .agent__tag { opacity: 0; }
.hover-ring { position: absolute; border: 1px dashed var(--c); border-radius: 6px; opacity: 0; transition: opacity .3s ease; }
.hover-ring.on { opacity: .8; }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .hero__facts { display: none; }
  .hero__intro { width: min(360px, 38vw); }
  .xp__item { grid-template-columns: 150px 1fr; }
  .xp__visual { grid-column: 2; max-width: 420px; }
  .projects { grid-template-columns: 1fr 1fr; }
  .live { grid-template-columns: 1fr 1fr; }
  .live__panel--now { grid-column: span 2; }
}
@media (max-width: 860px) {
  .about, .music, .contact { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --nav-h: 64px; }
  .nav { grid-template-columns: 1fr auto; }
  .nav__pill, .nav__cta { display: none; }
  .nav__menu { display: inline-block; }
  .hero__title { top: 92px; font-size: 19vw; font-stretch: 100%; }
  .hero__portrait { height: 58%; bottom: auto; top: calc(92px + 19vw * 1.25); }
  .hero__intro {
    left: var(--gutter); right: var(--gutter); bottom: 64px; width: auto;
    padding-top: 40px;
    background: linear-gradient(180deg, transparent, var(--bg) 38%);
  }
  .hero__lede { font-size: 15px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .build-log { bottom: 14px; left: var(--gutter); transform: none; }
  .section__head h2 { font-stretch: 100%; }
  .skills { grid-template-columns: 1fr; }
  .xp__item { grid-template-columns: 1fr; gap: 16px; padding-block: 28px; }
  .xp__meta { flex-direction: row; align-items: center; }
  .xp__visual { grid-column: auto; max-width: none; }
  .projects, .live { grid-template-columns: 1fr; }
  .project--feature, .live__panel--now { grid-column: auto; }
  .medals__list li { grid-template-columns: 74px 1fr auto; gap: 12px; }
  .medals__list time { font-size: 17px; }
  .edu__item { grid-template-columns: 1fr; gap: 10px; padding: 22px; }
  .edu__item .tag { justify-self: start; }
  .intro-form .btn, .contact__direct .btn { align-self: stretch; }
  .agents-toggle { width: 36px; padding: 0; justify-content: center; }
  .agents-toggle__on, .agents-toggle__off { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .agents, .agents-toggle, .build-log { display: none; }
}

/* ── 01 Portfolio IA teaser ── */
.section--ia { background: radial-gradient(70% 80% at 100% 0%, rgba(46, 255, 140, .09), transparent 65%), var(--bg); }
.ia-teaser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.ia-teaser .section__head { margin-bottom: 0; }
.ia-teaser .section__lede { margin-bottom: 28px; }
.ia-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.ia-list a {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 14px; align-items: baseline;
  padding: 18px 6px; border-bottom: 1px solid var(--line); text-decoration: none;
  transition: background-color .2s ease, padding-left .25s ease;
}
.ia-list a:hover { background: rgba(46, 255, 140, .05); padding-left: 14px; }
.ia-list__n { grid-row: 1 / 3; font: 500 12px/1.6 var(--font-mono); color: var(--accent); }
.ia-list b { font: 800 clamp(17px, 1.6vw, 21px)/1.2 var(--font-display); font-stretch: 104%; letter-spacing: -.01em; }
.ia-list__k { grid-row: 1 / 3; grid-column: 3; align-self: center; font: 900 clamp(20px, 2vw, 26px)/1 var(--font-display); font-stretch: 106%; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ia-list small { grid-column: 2; font-size: 13px; color: var(--text-muted); }
.xp__item--now { border-top-color: rgba(46, 255, 140, .35); }
.xp__link { display: inline-flex; margin-top: 16px; color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.xp__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.skills__ai { grid-column: 1 / -1; background: radial-gradient(100% 140% at 0% 0%, rgba(46, 255, 140, .1), transparent 60%), var(--bg) !important; }
@media (max-width: 860px) {
  .ia-teaser { grid-template-columns: minmax(0, 1fr); }
}
