/* ---------- Tokens ---------- */
:root {
  --bg: #0b0d10;
  --bg-2: #101318;
  --surface: #14181f;
  --surface-2: #191e26;
  --line: #232a34;
  --text: #f4f7fb;
  --muted: #c3ccd8;
  --faint: #8b96a4;
  --accent: #ff8b52;      /* warm amber */
  --accent-2: #58d3d1;    /* cool cyan */
  --radius: 16px;
  --max: 1080px;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --display: "Space Grotesk", "Inter", sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }
strong { color: var(--text); font-weight: 600; }

/* ---------- Ambient background ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.14;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  z-index: -2;
}
.bg-glow {
  position: fixed;
  top: -260px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 700px;
  background: radial-gradient(circle at 35% 40%, rgba(255,139,82,0.20), transparent 60%),
              radial-gradient(circle at 70% 30%, rgba(88,211,209,0.16), transparent 55%);
  filter: blur(30px);
  z-index: -1;
  pointer-events: none;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 60px);
  backdrop-filter: blur(12px);
  background: rgba(11,13,16,0.6);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.nav__logo img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--line);
  transition: border-color .2s, transform .2s;
}
.nav__logo:hover img { border-color: var(--accent); transform: scale(1.05); }
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 32px);
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--muted);
}
.nav__links a { transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__cta {
  color: var(--accent) !important;
  border: 1px solid var(--line);
  padding: 7px 16px;
  border-radius: 999px;
  transition: border-color .2s, background .2s;
}
.nav__cta:hover { border-color: var(--accent); background: rgba(255,139,82,0.08); }

/* ---------- Layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }

.section { padding: clamp(70px, 12vh, 130px) 0; }
.section__head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 48px;
}
.section__num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 15px;
}
.section__title {
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: -.5px;
}
.section__title::after {
  content: "";
  display: inline-block;
  width: clamp(40px, 20vw, 260px);
  height: 1px;
  background: var(--line);
  vertical-align: middle;
  margin-left: 20px;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(70px, 16vh, 150px) clamp(20px, 5vw, 40px) clamp(40px, 8vh, 90px);
}
.hero__eyebrow {
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 14px;
  margin-bottom: 22px;
}
.hero__title {
  font-family: var(--display);
  font-size: clamp(52px, 11vw, 118px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -2px;
}
.hero__title .accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__role {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 28px 0 24px;
}
.tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--surface);
}
.hero__lede {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 18.5px);
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 36px 0 26px; }
.hero__socials {
  display: flex;
  gap: 22px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--faint);
}
.hero__socials a { display: inline-flex; align-items: center; gap: 8px; transition: color .2s; }
.hero__socials a:hover { color: var(--accent); }
.hero__socials svg { width: 17px; height: 17px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .18s ease, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #1a0f08; font-weight: 600; }
.btn--primary:hover { background: #ffa06f; }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent-2); }
.btn--lg { padding: 16px 30px; font-size: 16px; }

/* ---------- About ---------- */
.about { max-width: 760px; }
.about p { color: var(--muted); font-size: 17px; margin-bottom: 20px; }
.about__facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  list-style: none;
  margin-top: 40px;
}
.about__facts li {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.4;
}
.about__facts span {
  display: block;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

/* ---------- Timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 8px; }
.job {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
.job__date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
}
.job__body h3 { font-family: var(--display); font-size: 21px; font-weight: 600; }
.job__co { color: var(--accent); font-weight: 500; }
.job__desc { color: var(--muted); margin: 8px 0 16px; font-size: 15px; }
.job__body ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.job__body li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 15px;
}
.job__body li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent-2);
}

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .25s ease, border-color .25s, background .25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--surface-2);
}
.card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.card__label { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.card__badge {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent-2);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
}
.card__badge--link:hover { border-color: var(--accent-2); color: var(--text); }
.card h3 { font-family: var(--display); font-size: 24px; font-weight: 600; margin-bottom: 12px; }
.card__host { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--faint); }
.card p { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.card__sub {
  border-left: 2px solid var(--line);
  padding-left: 20px;
  margin: 0 0 24px;
  transition: border-color .25s;
}
.card:hover .card__sub { border-left-color: var(--accent); }
.card__sub h4 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.card__subtag {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--accent-2);
}
.card__subdesc {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 14px;
}
.card__points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 22px;
}
.card__points li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.card__points li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.card__points code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent-2);
}
.card__tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.card__tags li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 6px;
}

/* ---------- Stack ---------- */
.stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.stack__group h4 {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 14px;
  text-transform: lowercase;
}
.stack__group ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.stack__group li {
  color: var(--muted);
  font-size: 15px;
  padding-left: 16px;
  position: relative;
}
.stack__group li::before {
  content: "";
  position: absolute; left: 0; top: 10px;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent-2);
}

/* ---------- Contact ---------- */
.section--contact { text-align: center; }
.contact { max-width: 620px; margin: 0 auto; }
.contact__eyebrow { font-family: var(--mono); color: var(--accent-2); font-size: 14px; margin-bottom: 18px; }
.contact__title { font-family: var(--display); font-size: clamp(30px, 5vw, 46px); font-weight: 700; letter-spacing: -1px; }
.contact__lede { color: var(--muted); font-size: 17px; margin: 20px 0 34px; }
.contact__socials {
  display: flex; justify-content: center; gap: 26px;
  margin-top: 34px;
  font-family: var(--mono); font-size: 14px; color: var(--faint);
}
.contact__socials a { display: inline-flex; align-items: center; gap: 8px; transition: color .2s; }
.contact__socials a:hover { color: var(--accent); }
.contact__socials svg { width: 18px; height: 18px; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px clamp(20px, 5vw, 40px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

/* ---------- Résumé PDF modal ---------- */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vw, 48px);
}
.pdf-modal.is-open { display: flex; }
.pdf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 9, 0.78);
  backdrop-filter: blur(6px);
  animation: fade .25s ease;
}
.pdf-modal__panel {
  position: relative;
  width: min(920px, 100%);
  height: min(90vh, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  animation: pop .28s ease;
}
.pdf-modal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.pdf-modal__title {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--muted);
}
.pdf-modal__actions { display: flex; align-items: center; gap: 10px; }
.pdf-modal__actions .btn { padding: 8px 16px; font-size: 13px; }
.pdf-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.pdf-modal__close:hover { border-color: var(--accent); color: var(--text); background: var(--surface-2); }
.pdf-modal__frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #525659;
}
body.modal-open { overflow: hidden; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav__links a:not(.nav__cta) { display: none; }
  .job { grid-template-columns: 1fr; gap: 12px; }
  .projects { grid-template-columns: 1fr; }
  .about__facts { grid-template-columns: 1fr; }
}
