/* ========== Tokens ========== */
:root {
  --bg: #050C1F;        /* deep navy */
  --surface: #0A1631;   /* inputs, raised */
  --line: #1A2A52;      /* hairlines */
  --text: #F2F7FF;      /* white light */
  --muted: #9FB0D4;     /* secondary */
  --accent: #7CC4FF;    /* light electric blue */
  --error: #FFB4A8;

  --font: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1160px;
  --pad: clamp(20px, 5vw, 56px);
}

/* language visibility */
html[lang="fr"] [data-lang="en"],
html[lang="en"] [data-lang="fr"] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--text); text-decoration: none; }
h1, h2, h3 { font-weight: 500; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--text); color: var(--bg); border-radius: 8px; }
.skip:focus { top: 12px; }

/* ========== Header ========== */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s;
}
.header.scrolled {
  background: rgba(5, 12, 31, .8);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.header-inner { height: 72px; display: flex; align-items: center; gap: 32px; }
.logo { font-weight: 600; font-size: 18px; letter-spacing: .02em; display: flex; align-items: center; gap: 4px; }
.logo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.nav { display: flex; gap: 32px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 15px; font-weight: 400; transition: color .2s; }
.nav a:hover { color: var(--text); }

.header-tools { display: flex; align-items: center; gap: 12px; }
.lang-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.lang-switch button {
  min-width: 44px; height: 34px;
  background: none; border: 0; border-radius: 999px;
  color: var(--muted); font: 500 13px var(--font); cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.menu-btn {
  display: none; width: 44px; height: 44px;
  background: none; border: 1px solid var(--line); border-radius: 50%;
  cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
}
.menu-bar { width: 16px; height: 1.5px; background: var(--text); transition: transform .25s; }
.menu-btn[aria-expanded="true"] .menu-bar:nth-of-type(1) { transform: translateY(3.75px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-bar:nth-of-type(2) { transform: translateY(-3.75px) rotate(-45deg); }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 15px var(--font); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-line { border-color: var(--line); color: var(--text); }
.btn-line:hover { border-color: var(--accent); }

/* ========== Hero ========== */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 120px 0 80px; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(40px, 7vw, 100px); align-items: center; width: 100%;
}
.status { display: flex; align-items: center; gap: 10px; margin: 0 0 28px; color: var(--muted); font-size: 14px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.hero h1 {
  font-size: clamp(46px, 7vw, 92px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
}
.role { margin: 22px 0 0; font-size: clamp(17px, 1.8vw, 20px); color: var(--accent); font-weight: 400; }
.lead { margin: 18px 0 40px; max-width: 32em; color: var(--muted); font-size: 17px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* portrait */
.portrait { position: relative; justify-self: center; width: min(100%, 420px); aspect-ratio: 1; }
.photo {
  position: absolute; inset: 9%;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.orbit {
  position: absolute; inset: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  animation: spin 24s linear infinite;
}
.orbit span {
  position: absolute; top: -4px; left: 50%;
  width: 8px; height: 8px; margin-left: -4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px 2px var(--accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* the one load moment: a light scan reveals the portrait */
.scan {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--accent);
  box-shadow: 0 0 18px 4px rgba(124, 196, 255, .55);
  opacity: 0;
}
.js .photo img { clip-path: inset(0 0 100% 0); }
.loaded .photo img { clip-path: inset(0 0 0 0); transition: clip-path 1.3s cubic-bezier(.65,0,.35,1) .2s; }
.loaded .scan { animation: scan 1.3s cubic-bezier(.65,0,.35,1) .2s forwards; }
@keyframes scan {
  0% { top: 0; opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ========== Sections ========== */
.section { padding: clamp(80px, 11vw, 140px) 0; border-top: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.section h2 { font-size: clamp(28px, 3vw, 36px); letter-spacing: -0.02em; position: sticky; top: 104px; }
.big { margin: 0; font-size: clamp(19px, 2vw, 23px); line-height: 1.6; color: var(--text); max-width: 34em; }

.keys { list-style: none; margin: 36px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.keys li { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--muted); }

/* jobs */
.jobs { list-style: none; margin: 0; padding: 0; }
.job { padding: 0 0 44px 28px; border-left: 1px solid var(--line); position: relative; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: -4px; top: 9px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.job-date { margin: 0 0 6px; font-size: 14px; color: var(--accent); }
.job h3 { font-size: 22px; line-height: 1.3; }
.job-co { margin: 4px 0 14px; color: var(--muted); }
.job ul { margin: 0; padding-left: 18px; color: var(--muted); }
.job li { margin-bottom: 4px; }

/* projects */
.projects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.projects li { padding: 24px 0; border-bottom: 1px solid var(--line); }
.projects li:nth-child(-n+2) { border-top: 1px solid var(--line); }
.projects h3 { font-size: 19px; line-height: 1.35; }
.projects p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.projects .tech { color: var(--accent); font-size: 13px; margin-top: 10px; }

/* skills */
.skills { margin: 0; }
.skills div { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.skills div:first-child { border-top: 1px solid var(--line); }
.skills dt { color: var(--muted); font-size: 15px; }
.skills dd { margin: 0; font-weight: 400; }
.sub { margin: 56px 0 16px; font-size: 18px; }
.edu { list-style: none; margin: 0; padding: 0; }
.edu li { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 12px 0; font-weight: 400; }
.edu-y { color: var(--accent); font-size: 14px; }

/* contact */
.contact h2 { position: static; }
.contact-intro { margin: 16px 0 28px; color: var(--muted); max-width: 22em; }
.direct { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.direct a { color: var(--text); border-bottom: 1px solid var(--line); transition: border-color .2s; }
.direct a:hover { border-color: var(--accent); }
.contact .two-col { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  font: 400 16px var(--font);
  transition: border-color .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field-error { margin: 0; min-height: 0; font-size: 13px; color: var(--error); }
.field-error:empty { display: none; }
.form .btn { justify-self: start; }
.form-status { margin: 0; font-size: 15px; }
.form-status.ok { color: var(--accent); }
.form-status.err { color: var(--error); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; }
.footer p { margin: 0; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(70vw, 300px); justify-self: start; }
  .two-col, .contact .two-col { grid-template-columns: 1fr; }
  .section h2 { position: static; }
  .projects { grid-template-columns: 1fr; }
  .projects li:nth-child(2) { border-top: 0; }
}

@media (max-width: 760px) {
  .menu-btn { display: flex; }
  .header { background: rgba(5, 12, 31, .85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .nav {
    position: fixed; inset: 72px 0 auto 0;
    flex-direction: column; gap: 0;
    padding: 8px var(--pad) 24px;
    background: rgba(5, 12, 31, .97);
    border-bottom: 1px solid var(--line);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 14px 0; font-size: 18px; border-bottom: 1px solid var(--line); }
  .header-tools { margin-left: auto; }
  .skills div, .edu li { grid-template-columns: 1fr; gap: 4px; }
  .hero { padding-top: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .photo img { clip-path: none; }
}
