/* ============ Tokens ============ */
:root {
  --paper: #F4F2ED;
  --paper-2: #ECE9E1;
  --card: #FBFAF7;
  --ink: #131318;
  --ink-2: #3B3B45;
  --muted: #6C6A72;
  --line: #DAD6CC;
  --accent: #3A36E0;
  --accent-ink: #2B28B8;
  --accent-soft: #E4E3FB;
  --real: #1F7A4D;
  --real-soft: #DDF0E5;
  --demo: #8A5A12;
  --demo-soft: #F5E8CF;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
strong, b { font-weight: 600; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: .78em; letter-spacing: .02em; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 500 15px/1 var(--sans); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), background-color .25s, color .25s, border-color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--accent); }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }

/* ============ Header ============ */
.header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.header.scrolled { border-bottom-color: var(--line); }
.header-in { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--ink); color: var(--paper); font: 600 13px/1 var(--mono); letter-spacing: .04em;
}
.logo-name { font-weight: 600; letter-spacing: -.01em; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  position: relative; padding: 8px 12px; border-radius: 8px; text-decoration: none;
  font-size: 15px; color: var(--ink-2); transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a.active { color: var(--ink); }
.nav a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang {
  min-width: 44px; height: 38px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font: 500 13px/1 var(--mono); cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.lang:hover { border-color: var(--ink); background: var(--card); }

/* ============ Hero ============ */
.hero { padding: clamp(40px, 7vw, 96px) 0 0; }
.hero-in {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.status {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px;
  padding: 7px 14px 7px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); font: 500 13px/1.3 var(--mono); color: var(--ink-2);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #22A35A; flex: none; }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #22A35A;
  opacity: 0; animation: pulse 2.2s var(--ease) infinite;
}
@keyframes pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

.display {
  margin: 0; font: 500 clamp(40px, 6.6vw, 84px)/1.0 var(--sans); letter-spacing: -.035em;
  text-wrap: balance;
}
.display em { letter-spacing: -.01em; color: var(--accent); font-size: 1.08em; }
.display-sm { font-size: clamp(36px, 5.4vw, 68px); }
.lead { margin: 28px 0 0; max-width: 37em; font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); }
.lead strong { color: var(--ink); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero-portrait { position: relative; margin: 0; max-width: 460px; justify-self: end; width: 100%; }
.hero-portrait img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%;
  box-shadow: 0 0 0 10px var(--card), 0 0 0 11px var(--line), 0 40px 80px -30px rgba(40, 30, 120, .35);
}
.tag {
  position: absolute; display: inline-flex; gap: 8px; align-items: center;
  padding: 9px 14px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .25);
}
.tag .mono { color: var(--accent); }
.tag-a { top: 8%; left: -6%; }
.tag-b { top: 46%; right: -8%; }
.tag-c { bottom: 6%; left: 4%; }
.js .tag { animation: float 6s ease-in-out infinite; }
.js .tag-b { animation-delay: -2s; }
.js .tag-c { animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-8px); } }

.facts {
  display: grid; grid-template-columns: repeat(4, 1fr); margin: clamp(56px, 7vw, 88px) 0 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.facts > div { padding: 26px 24px 26px 0; }
.facts > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.facts dt { font: 500 clamp(30px, 3.4vw, 44px)/1 var(--sans); letter-spacing: -.03em; }
.facts dt small { font-size: .5em; color: var(--muted); letter-spacing: 0; }
.facts dd { margin: 10px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); max-width: 22ch; }

.ticker { overflow: hidden; padding: 22px 0; border-bottom: 1px solid var(--line); }
.ticker-track { display: flex; width: max-content; animation: ticker 48s linear infinite; }
.ticker span {
  padding: 0 22px; font: 400 clamp(20px, 2.2vw, 28px)/1 var(--serif); font-style: italic; color: var(--ink-2);
  white-space: nowrap;
}
.ticker span::after { content: "✦"; margin-left: 44px; font-style: normal; font-size: .55em; color: var(--accent); vertical-align: middle; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ============ Sections ============ */
.section { padding: clamp(80px, 11vw, 140px) 0; }
.section-alt { background: var(--paper-2); }
.section-dark { background: var(--ink); color: var(--paper); }
.sec-head { max-width: 760px; margin-bottom: clamp(44px, 6vw, 72px); }
.eyebrow {
  display: flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font: 500 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
}
.eyebrow .mono { color: var(--accent); font-size: 1em; }
.section-dark .eyebrow { color: #A7A6B2; }
.section-dark .eyebrow .mono { color: #9C9AF7; }
.h2 { margin: 0; font: 500 clamp(32px, 4.4vw, 56px)/1.04 var(--sans); letter-spacing: -.03em; text-wrap: balance; }
.h2 em { color: var(--accent); }
.section-dark .h2 em { color: #9C9AF7; }
.h3 { margin: 0; font: 500 clamp(28px, 3vw, 38px)/1.1 var(--sans); letter-spacing: -.025em; }
.h4 { margin: 0; font: 600 19px/1.3 var(--sans); letter-spacing: -.01em; }
.sec-lead { margin: 20px 0 0; font-size: 18px; color: var(--ink-2); max-width: 40em; }
.section-dark .sec-lead { color: #C9C8D2; }

/* ============ Case studies ============ */
.case {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px); align-items: start;
  padding: clamp(40px, 5vw, 64px) 0; border-top: 1px solid var(--line);
}
.case-rev .case-shot { order: 2; }
.case-shot {
  position: sticky; top: 96px; display: block; overflow: hidden; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); text-decoration: none;
  box-shadow: 0 30px 60px -36px rgba(20, 20, 40, .45);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.case-shot:hover { transform: translateY(-6px); box-shadow: 0 44px 80px -40px rgba(20, 20, 40, .55); }
.case-shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform .8s var(--ease); }
.case-shot:hover img { transform: scale(1.025); }
.frame { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.frame i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.frame .url {
  margin-left: 12px; padding: 3px 12px; border-radius: 6px; background: var(--paper-2);
  font: 12px/1.4 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.case-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; color: var(--muted); }
.pill { display: inline-flex; padding: 5px 11px; border-radius: 999px; font: 500 12px/1.2 var(--mono); letter-spacing: .02em; }
.pill-real { background: var(--real-soft); color: var(--real); }
.pill-demo { background: var(--demo-soft); color: var(--demo); }
.case-lead { margin: 14px 0 0; font-size: 18px; color: var(--ink-2); }
.case-grid { display: grid; gap: 18px; margin: 26px 0 0; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case-grid dt { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.case-grid dd { margin: 8px 0 0; font-size: 15.5px; color: var(--ink-2); }
.ticks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; font-size: 15.5px; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 12px; height: 2px; background: var(--accent);
}
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0 0; }
.stack span { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; font: 12.5px/1.2 var(--mono); color: var(--ink-2); background: var(--card); }
.link {
  display: inline-flex; margin-top: 26px; font-weight: 500; text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 2px no-repeat;
  padding-bottom: 3px; transition: color .2s, background-size .3s var(--ease);
}
.link:hover { color: var(--accent); background-size: 40% 2px; }

.files { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.files a { color: var(--ink-2); }
.files a:hover { color: var(--accent); }

.concepts {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 4vw, 64px);
  margin-top: 8px; padding: clamp(32px, 4vw, 48px); border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
}
.concepts-head p { margin: 12px 0 0; font-size: 15.5px; color: var(--muted); }
.concept-list { list-style: none; margin: 0; padding: 0; }
.concept-list li {
  display: grid; grid-template-columns: 28px minmax(0, 190px) minmax(0, 1fr); gap: 12px; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.concept-list li:first-child { padding-top: 0; }
.concept-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.concept-list .mono { color: var(--accent); }
.concept-list li > span:last-child { color: var(--muted); }

/* ============ Expertise ============ */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skill { position: relative; padding: clamp(26px, 3vw, 38px); background: var(--paper-2); transition: background-color .35s; }
.skill:hover { background: var(--card); }
.skill .mono { display: block; margin-bottom: 40px; color: var(--accent); }
.skill p { margin: 12px 0 0; font-size: 15.5px; color: var(--ink-2); }

/* ============ Method ============ */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.steps li { padding: 26px 0 0; border-top: 1px solid #3A3A46; }
.steps .mono { color: #9C9AF7; }
.steps h3 { margin: 16px 0 0; font: 500 24px/1.2 var(--sans); letter-spacing: -.02em; }
.steps p { margin: 10px 0 0; font-size: 15.5px; color: #B9B8C4; }

/* ============ Parcours ============ */
.parcours { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.parcours .sec-head { position: sticky; top: 110px; margin-bottom: 0; }
.tl-title { margin: 0 0 6px; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.tl-title ~ .tl-title { margin-top: 44px; }
.timeline ol { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.timeline .when { padding-top: 3px; color: var(--muted); font-size: 13px; }
.timeline b { display: block; font-weight: 600; font-size: 16.5px; }
.timeline li span:not(.when):not(.mono) { display: block; margin-top: 4px; font-size: 15px; color: var(--muted); }
.timeline .when span { display: inline; margin: 0; font-size: inherit; color: inherit; }
.langs { margin: 14px 0 0; color: var(--ink-2); }

/* ============ Contact ============ */
.contact { text-align: center; border-top: 1px solid var(--line); }
.contact-in { display: flex; flex-direction: column; align-items: center; }
.contact .eyebrow { justify-content: center; }
.contact .sec-lead { margin-left: auto; margin-right: auto; }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
.cv-links { margin: 28px 0 0; font-size: 15px; color: var(--muted); }
.cv-links a { color: var(--ink); font-weight: 500; }
.cv-links a:hover { color: var(--accent); }

/* ============ Footer ============ */
.footer { padding: 28px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ============ Reveal ============ */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }
.js .hero-text > * { animation: rise .9s var(--ease) both; }
.js .hero-text > :nth-child(2) { animation-delay: .08s; }
.js .hero-text > :nth-child(3) { animation-delay: .16s; }
.js .hero-text > :nth-child(4) { animation-delay: .24s; }
.js .hero-portrait { animation: rise 1.1s .2s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
}
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-portrait { order: -1; justify-self: start; max-width: 260px; }
  .tag-a { left: auto; right: -40%; top: 10%; }
  .tag-b { right: -52%; top: 44%; }
  .tag-c { left: auto; right: -38%; bottom: 10%; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .facts > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .case, .concepts, .parcours { grid-template-columns: 1fr; }
  .case-rev .case-shot { order: 0; }
  .case-shot, .parcours .sec-head { position: static; }
  .parcours .sec-head { margin-bottom: 8px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .header-in { height: 60px; gap: 12px; }
  .logo-name { display: none; }
  .hero-portrait { max-width: 200px; }
  .tag { font-size: 13px; padding: 7px 11px; }
  .tag-a { right: -62%; }
  .tag-b { right: -78%; }
  .tag-c { right: -58%; }
  .btn { width: 100%; }
  .header .btn { width: auto; }
  .facts > div, .facts > div + div { padding: 20px 12px 20px 0; }
  .facts > div:nth-child(even) { padding-left: 14px; }
  .skills { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .concept-list li { grid-template-columns: 24px minmax(0, 1fr); }
  .concept-list li > span:last-child { grid-column: 2; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .contact-links { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv { opacity: 1; transform: none; }
}

@media print {
  .header, .ticker, .cta, .contact-links { display: none; }
  .js .rv { opacity: 1; transform: none; }
  .section { padding: 32px 0; }
}
