/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #f7f7f4;
  --bg-alt: #efefea;
  --surface: #ffffff;
  --border: #e2e2dc;
  --text: #16191d;
  --text-muted: #5b626b;
  --accent: #0f8a6a;
  --accent-strong: #0b6f55;
  --accent-soft: rgba(15, 138, 106, 0.1);
  --gold: #b7791f;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --radius: 14px;
  --maxw: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f14;
    --bg-alt: #0f151c;
    --surface: #131a22;
    --border: #232d38;
    --text: #e7ecf1;
    --text-muted: #9aa6b2;
    --accent: #34d399;
    --accent-strong: #6ee7b7;
    --accent-soft: rgba(52, 211, 153, 0.12);
    --gold: #f6c453;
    --on-accent: #06281d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f14;
  --bg-alt: #0f151c;
  --surface: #131a22;
  --border: #232d38;
  --text: #e7ecf1;
  --text-muted: #9aa6b2;
  --accent: #34d399;
  --accent-strong: #6ee7b7;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --gold: #f6c453;
  --on-accent: #06281d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 750; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; height: auto; display: block; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
section[id] { scroll-margin-top: 80px; }

.icon { width: 1.1em; height: 1.1em; flex: none; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 28px; } }
.narrow { max-width: 820px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font: 600 0.78rem/1 var(--mono);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 62ch; }
.accent { color: var(--accent); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px;
  font: 600 0.95rem/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-sm { padding: 8px 12px; font-size: 0.88rem; }
.btn-lg { padding: 14px 20px; font-size: 1rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; margin-right: auto; }
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #fff; font: 700 0.85rem/1 var(--mono);
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) {
  color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  padding: 8px 12px; border-radius: 8px;
}
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.site-nav .btn { margin-left: 6px; }
.nav-toggle { display: none; }

.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .when-dark { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .when-light { display: none; }
}
.theme-toggle span { display: inline-grid; }

@media (max-width: 860px) {
  .js .nav-toggle { display: inline-grid; order: 2; }
  .js .theme-toggle { order: 1; }
  .js .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px 16px 18px; background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .js .site-nav.open { display: flex; }
  .js .site-nav .btn { margin: 8px 0 0; justify-content: center; }
  html:not(.js) .header-inner { flex-wrap: wrap; height: auto; padding-block: 12px; }
  html:not(.js) .site-nav { flex-wrap: wrap; order: 3; width: 100%; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: 72px 0 80px;
  background:
    radial-gradient(900px 400px at 85% -10%, var(--accent-soft), transparent 70%),
    radial-gradient(500px 260px at 0% 70%, color-mix(in srgb, var(--gold) 8%, transparent), transparent 70%);
}
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.35fr 1fr; } }
.hero h1 { max-width: 18ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 20px; }
.hero-meta { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.95rem; }

.hero-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 28px; box-shadow: var(--shadow); text-align: center;
}
.portrait {
  width: 150px; height: 150px; object-fit: cover; border-radius: 50%;
  margin: 0 auto 20px; border: 4px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}
.facts { margin: 0 0 20px; text-align: left; }
.facts div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.facts dt { font: 600 0.72rem/1.8 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.facts dd { margin: 0; font-weight: 500; font-size: 0.95rem; }

.social { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0; justify-content: center; }
.social a {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  color: var(--text-muted); border: 1px solid var(--border); background: var(--surface);
}
.social a:hover { color: var(--accent); border-color: var(--accent); }

/* ==========================================================================
   Sections & cards
   ========================================================================== */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { margin-bottom: 40px; }
.section-head.split { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.section-head h2 { margin-bottom: 0; }
.section-lead { color: var(--text-muted); font-size: 1.08rem; max-width: 65ch; margin-top: 14px; }

.grid { display: grid; gap: 20px; }
@media (min-width: 700px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card p { color: var(--text-muted); }
.card p:last-child { margin-bottom: 0; }

.service-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; font-size: 1.2rem;
}

.tags { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font: 500 0.78rem/1 var(--mono); padding: 6px 9px; border-radius: 6px;
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-muted);
}

.project { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.project .card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.project-shot { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; object-position: top; border-bottom: 1px solid var(--border); }
.card-link { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 18px; font-weight: 600; text-decoration: none; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline-item { display: grid; gap: 8px 32px; padding: 0 0 36px 28px; position: relative; }
.timeline-item::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: -8px; width: 2px; background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-item::after {
  content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
@media (min-width: 800px) {
  .timeline-item { grid-template-columns: 160px 1fr; padding-left: 0; }
  .timeline-item::before { left: 181px; }
  .timeline-item::after { left: 176px; }
  .timeline-body { padding-left: 32px; }
}
.timeline-meta { font: 600 0.85rem/1.8 var(--mono); color: var(--text-muted); }
.timeline-body ul { margin: 10px 0 0; color: var(--text-muted); }
.timeline-body li { margin-bottom: 6px; }
.timeline-body p, .resume-item p { color: var(--text-muted); margin: 10px 0 0; }
.at { color: var(--text-muted); font-weight: 500; }

.skill-group h3 { margin-bottom: 0; }

/* Articles */
.article-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.article-list a {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
  padding: 20px 4px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text);
}
.article-title { font-weight: 600; font-size: 1.08rem; }
.article-meta { grid-row: 2; color: var(--text-muted); font-size: 0.88rem; font-family: var(--mono); }
.article-arrow { grid-row: 1 / span 2; grid-column: 2; color: var(--text-muted); transition: transform .2s, color .2s; }
.article-list a:hover .article-title { color: var(--accent); }
.article-list a:hover .article-arrow { color: var(--accent); transform: translate(2px, -2px); }

/* Testimonial */
.testimonial { margin: 0; text-align: center; }
.testimonial blockquote { margin: 0 0 24px; position: relative; }
.testimonial blockquote::before {
  content: "\201C"; display: block; font: 700 4.5rem/0.6 Georgia, serif; color: var(--accent); margin-bottom: 18px;
}
.testimonial p { font-size: clamp(1.1rem, 2.2vw, 1.35rem); line-height: 1.6; }
.testimonial figcaption { display: flex; flex-direction: column; gap: 2px; }
.testimonial figcaption span { color: var(--text-muted); font-size: 0.92rem; }

.edu-period { font: 600 0.8rem/1 var(--mono); color: var(--accent) !important; margin-bottom: 12px; }
.edu h3 { margin-bottom: 6px; }

/* CTA */
.cta {
  display: grid; gap: 28px; align-items: center;
  padding: clamp(28px, 5vw, 56px); border-radius: 22px;
  background:
    radial-gradient(600px 240px at 100% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
@media (min-width: 900px) { .cta { grid-template-columns: 1.2fr 1fr; } }
.cta p { color: var(--text-muted); margin: 0; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; }
.cta-actions .btn { justify-content: center; overflow-wrap: anywhere; }

/* ==========================================================================
   Inner pages
   ========================================================================== */
.page-hero { padding: 64px 0 40px; border-bottom: 1px solid var(--border);
  background: radial-gradient(800px 300px at 90% -20%, var(--accent-soft), transparent 70%); }
.page-body { padding-top: 48px; padding-bottom: 88px; }
.subhead { font-size: 1.3rem; margin: 8px 0 20px; }
.subhead:not(:first-child) { margin-top: 56px; }
.more { margin-top: 40px; color: var(--text-muted); }

.resume { max-width: 860px; }
.resume-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 40px; }
.resume-loc { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.92rem; }
.resume section { margin-bottom: 44px; }
.resume h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent);
  padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.resume-item { margin-bottom: 24px; }
.resume-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.resume-row h3 { margin: 0; }
.resume-period { font: 500 0.88rem/1.4 var(--mono); color: var(--text-muted); }
.resume ul { color: var(--text-muted); margin: 10px 0 0; }
.resume li { margin-bottom: 5px; }
.resume-skills { margin: 0; }
.resume-skills div { display: grid; gap: 4px 20px; padding: 8px 0; }
@media (min-width: 640px) { .resume-skills div { grid-template-columns: 220px 1fr; } }
.resume-skills dt { font-weight: 600; }
.resume-skills dd { margin: 0; color: var(--text-muted); }

.not-found { text-align: left; padding: 120px 0; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--text-muted); font-size: 0.92rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-inner p { margin: 0; }
.disclaimer { margin: 16px 0 0; font-size: 0.8rem; opacity: 0.8; }

/* ==========================================================================
   Print (résumé)
   ========================================================================== */
@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --text-muted: #333; --border: #ccc; --accent: #0b6f55; }
  .site-header, .site-footer, .resume-actions .btn, .skip-link { display: none !important; }
  .page-hero { padding: 0 0 12px; background: none; }
  .page-body { padding: 16px 0 0; }
  .resume section { margin-bottom: 20px; break-inside: avoid-page; }
  a { color: inherit; text-decoration: none; }
}
