/* Layout : page de présentation lisible en 1 minute — en-tête + chiffres clés, puis sections alternées clair / teinté */
:root {
  --bg: #f6f7f4;
  --bg-tint: #ebeee9;
  --surface: #ffffff;
  --ink: #142029;
  --muted: #59646d;
  --line: #d8ddd6;
  --accent: #1d6b58;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe4;
  --warm: #9a5b00;
  --warm-soft: #f5e7d0;
  --contact-bg: #142029;
  --contact-fg: #eef2ec;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 32, 41, 0.06), 0 8px 24px -12px rgba(20, 32, 41, 0.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10171c; --bg-tint: #141d23; --surface: #1a252c; --ink: #e6eae4; --muted: #9ba6ac;
    --line: #2b3840; --accent: #5cc6a6; --accent-ink: #0c1a15; --accent-soft: #1b3730;
    --warm: #e6a84a; --warm-soft: #3a2c17; --contact-bg: #1d2a31; --contact-fg: #eef2ec;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10171c; --bg-tint: #141d23; --surface: #1a252c; --ink: #e6eae4; --muted: #9ba6ac;
  --line: #2b3840; --accent: #5cc6a6; --accent-ink: #0c1a15; --accent-soft: #1b3730;
  --warm: #e6a84a; --warm-soft: #3a2c17; --contact-bg: #1d2a31; --contact-fg: #eef2ec;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6;
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; }
/* Texte réservé aux lecteurs d'écran */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap {
  max-width: 68rem; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Navigation */
body::before {
  content: ""; position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg);
}
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 1.5rem; padding-block: 0.7rem; }
.nav-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.mono {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 700;
}
.nav-links { display: flex; gap: 1.4rem; list-style: none; margin: 0 0 0 auto; padding: 0; font-size: 0.93rem; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
@media (max-width: 720px) { .nav-links { display: none; } .nav .btn-small { margin-left: auto; } }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 0.97rem var(--font-body); padding: 0.8rem 1.3rem; border-radius: 10px;
  text-decoration: none; border: 1.5px solid var(--line); color: var(--ink); background: var(--surface);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.08); }
.btn-small { padding: 0.5rem 0.95rem; font-size: 0.88rem; }

/* En-tête */
.hero { padding-block: 4.5rem 3rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
@media (max-width: 860px) { .hero { padding-block: 2.5rem 2rem; } .hero-grid { grid-template-columns: 1fr; gap: 2rem; } }
.pill {
  display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 600;
  padding: 0.35rem 0.8rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}
.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.hero h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.035em;
  font-size: clamp(2.8rem, 7.5vw, 5rem); line-height: 1; margin: 1.1rem 0 0.4rem;
}
.role { font-family: var(--font-display); font-size: clamp(1.3rem, 2.6vw, 1.75rem); font-weight: 600; color: var(--accent); margin: 0 0 1.1rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 36rem; margin: 0; }
.lead strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.8rem; }

.profile-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); min-width: 0;
}
.card-label { margin: 0 0 1rem; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.profile-card dl { margin: 0; display: grid; gap: 0; }
.profile-card dl > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; padding-block: 0.65rem; border-top: 1px solid var(--line); }
.profile-card dl > div:first-child { border-top: 0; padding-top: 0; }
.profile-card dt { color: var(--muted); font-size: 0.9rem; }
.profile-card dd { margin: 0; font-weight: 600; font-size: 0.95rem; }
@media (max-width: 420px) { .profile-card dl > div { grid-template-columns: 1fr; gap: 0.1rem; } }

.stats {
  list-style: none; margin: 3rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stats li { padding: 1.3rem 1.4rem; display: grid; gap: 0.2rem; border-left: 1px solid var(--line); }
.stats li:first-child { border-left: 0; }
.stats strong { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats span { font-size: 0.9rem; color: var(--muted); }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 2rem; }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Sections */
section > .wrap { padding-block: 4.5rem; }
@media (max-width: 720px) { section > .wrap { padding-block: 3rem; } }
.tinted { background: var(--bg-tint); }
.eyebrow { margin: 0 0 0.5rem; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em; color: var(--accent); }
h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 3.8vw, 2.5rem); letter-spacing: -0.025em; line-height: 1.12; margin: 0 0 2.2rem; max-width: 40rem; }
h3 { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: -0.01em; margin: 0; line-height: 1.3; }

/* Atouts */
.cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 860px) { .cards-3 { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; display: grid; gap: 0.7rem; align-content: start; }
.feature p { margin: 0; color: var(--muted); }
.icon { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-bottom: 0.3rem; }
.icon svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Compétences */
.skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 960px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .skills { grid-template-columns: 1fr; } }
.skill-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; display: grid; gap: 0.9rem; align-content: start; }
.skill-group h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 0.6rem; }
.sg-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.sg-icon svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Logos des technologies, aux couleurs des marques (ajustées en sombre pour rester lisibles) */
.tags-logo li { display: inline-flex; align-items: center; gap: 0.4rem; }
.lg { width: 0.95rem; height: 0.95rem; flex-shrink: 0; fill: currentColor; }
.lg-java { color: #ed8b00; }
.lg-spring { color: #6db33f; }
.lg-groovy { color: #4298b8; }
.lg-hibernate { color: #59666c; }
.lg-angular { color: #dd0031; }
.lg-vue { color: #42b883; }
.lg-typescript { color: #3178c6; }
.lg-postgresql { color: #4169e1; }
.lg-mysql { color: #4479a1; }
.lg-docker { color: #2496ed; }
.lg-maven { color: #c71a36; }
.lg-gitlab { color: #fc6d26; }
.lg-argo { color: #ef7b4d; }
.lg-git { color: #f05032; }
.lg-claude { color: #d97757; }
.lg-junit { color: #25a162; }
.lg-vitest { color: #6e9f18; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lg-hibernate { color: #a3b0b6; }
  :root:not([data-theme="light"]) .lg-postgresql { color: #6f8ff0; }
  :root:not([data-theme="light"]) .lg-mysql { color: #6f9fd0; }
  :root:not([data-theme="light"]) .lg-maven { color: #e9506b; }
}
:root[data-theme="dark"] .lg-hibernate { color: #a3b0b6; }
:root[data-theme="dark"] .lg-postgresql { color: #6f8ff0; }
:root[data-theme="dark"] .lg-mysql { color: #6f9fd0; }
:root[data-theme="dark"] .lg-maven { color: #e9506b; }
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; margin: 0; padding: 0; }
.tags li { font-size: 0.87rem; font-weight: 500; padding: 0.3rem 0.65rem; border-radius: 7px; background: var(--bg-tint); color: var(--ink); }
.skill-group .tags li { background: var(--bg); }
.tags-outline li { background: transparent; border: 1.5px dashed var(--warm); color: var(--warm); }
.tags-small li { font-size: 0.8rem; padding: 0.2rem 0.55rem; }

/* Frise du parcours */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; top: 0.6rem; bottom: 0.6rem; left: 12.4rem; width: 2px; background: var(--line); }
.job { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 3rem; padding-bottom: 2.2rem; position: relative; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: 12.4rem; top: 0.45rem; width: 14px; height: 14px; margin-left: -6px;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--accent);
}
.job-compact::before { border-color: var(--line); background: var(--bg); }
.when { display: grid; align-content: start; gap: 0.35rem; justify-items: end; text-align: right; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 0.15rem; }
.dur { font-size: 0.76rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.job-compact .dur { background: var(--bg-tint); color: var(--muted); }
.what { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; display: grid; gap: 0.6rem; min-width: 0; }
.job-compact .what { background: transparent; border-style: dashed; padding-block: 0.9rem; gap: 0.2rem; }
.company { margin: 0; color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.job-compact .company { color: var(--muted); font-weight: 500; }
.job-ctx { margin: 0; color: var(--muted); font-size: 0.88rem; }
.job-compact .job-ctx { margin-top: 0.2rem; }

/* Pastilles de contexte d'une mission : secteur (mis en avant), équipe, type de mission */
.job-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: -0.1rem 0 0; padding: 0; }
.job-meta li {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.22rem 0.65rem 0.22rem 0.5rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; line-height: 1.3;
  background: var(--bg-tint); color: var(--muted);
}
.job-meta li.m-sector { background: var(--accent-soft); color: var(--accent); }
.job-meta svg { width: 0.95rem; height: 0.95rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.job-compact .job-meta { margin-top: 0.3rem; }
.what > ul:not(.tags, .job-meta) { margin: 0.2rem 0 0.3rem; padding-left: 1.1rem; display: grid; gap: 0.3rem; color: var(--muted); }
.what > ul:not(.tags, .job-meta) li::marker { color: var(--accent); }
@media (max-width: 720px) {
  .timeline::before { left: 6px; }
  .job { grid-template-columns: 1fr; gap: 0.6rem; padding-left: 1.9rem; }
  .job::before { left: 6px; }
  .when { justify-items: start; text-align: left; grid-auto-flow: column; justify-content: start; align-items: center; gap: 0.6rem; }
}

/* Projets */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 800px) { .projects { grid-template-columns: 1fr; } }
/* Projet mis en avant : pleine largeur, capture à gauche et texte à droite sur grand écran */
.project-wide { grid-column: 1 / -1; }
.project-points { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; color: var(--muted); font-size: 0.95rem; }
.project-points li::marker { color: var(--accent); }
/* Survol (ou focus clavier) : la carte se soulève et la capture zoome doucement */
.project.project-wide { transition: opacity 0.6s ease, transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; transition-delay: 0s; }
.project.project-wide:hover, .project.project-wide:focus-within {
  transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 2px 4px rgba(20, 32, 41, 0.06), 0 22px 40px -18px rgba(20, 32, 41, 0.35);
}
.project-wide .mock-stream img { transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transform-origin: 50% 0; }
.project-wide:hover .mock-stream img, .project-wide:focus-within .mock-stream img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) {
  .project.project-wide:hover, .project.project-wide:focus-within, .project-wide:hover .mock-stream img, .project-wide:focus-within .mock-stream img { transform: none; }
}
.projects-more { margin: 1.4rem 0 0; text-align: center; }
@media (min-width: 900px) {
  /* Texte plus large que la capture : la carte reste basse, la hauteur suit le contenu */
  .project.project-wide { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
  .project-wide .mock { aspect-ratio: auto; height: 100%; border-bottom: 0; border-right: 1px solid var(--line); }
  .project-wide .project-body { padding: 1.4rem 1.6rem; gap: 0.55rem; }
  .project-wide .project-points { font-size: 0.9rem; gap: 0.15rem; }
}
.project { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); min-width: 0; }
.project-body { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.project-body p { margin: 0; color: var(--muted); }
.project-body .tags { margin-top: auto; padding-top: 0.3rem; }
.status { align-self: flex-start; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.status-wip { background: var(--warm-soft); color: var(--warm); }
.link-arrow { font-weight: 600; font-size: 0.93rem; text-decoration: none; }
.link-arrow::after { content: " →"; }
.link-arrow:hover { text-decoration: underline; }

.project-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }


/* Aperçus illustratifs des interfaces */
.mock { aspect-ratio: 16 / 8; max-width: 100%; padding: 0.9rem 1.1rem; display: grid; grid-template-rows: auto auto 1fr; gap: 0.7rem; border-bottom: 1px solid var(--line); }
.mock-stream { background: #17202a; display: block; padding: 0; overflow: hidden;}
.mock-stream img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top;}
.mock-chips { display: flex; gap: 6px; }
.mock-chips b { height: 10px; width: 46px; border-radius: 5px; background: rgba(255, 255, 255, 0.18); }
.mock-chips b:first-child { background: #5cc6a6; }
.mock-posters { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; }
.mock-posters span { aspect-ratio: 2 / 3; border-radius: 4px; background: linear-gradient(160deg, #2f4a5c, #1f2d38); }
.mock-posters span:nth-child(3n+1) { background: linear-gradient(160deg, #5cc6a6, #1d6b58); }
.mock-posters span:nth-child(4n+2) { background: linear-gradient(160deg, #e6a84a, #9a5b00); }

/* Formation */
.edu { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 720px) { .edu { grid-template-columns: 1fr; } }
.edu li { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 1rem; align-items: start; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.year { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.edu h3 { font-size: 1.02rem; }
.edu p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.92rem; }

/* Contact */
.contact { background: var(--contact-bg); color: var(--contact-fg); }
.contact h2 { color: var(--contact-fg); margin-bottom: 0.8rem; }
.eyebrow-light { color: #5cc6a6; }
.contact-lead { margin: 0; color: color-mix(in srgb, var(--contact-fg) 70%, transparent); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; gap: 1.5rem; } }
.contact-box { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: var(--radius); padding: 1.4rem; display: grid; gap: 1.1rem; }
.contact-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.contact-row > div { display: grid; gap: 0.1rem; min-width: 0; }
.contact-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: color-mix(in srgb, var(--contact-fg) 60%, transparent); }
.contact-row code { font-family: var(--font-mono); font-size: 1rem; user-select: all; word-break: break-all; }
.copy-btn { font: 600 0.86rem var(--font-body); background: #5cc6a6; color: #0c1a15; border: 0; border-radius: 8px; padding: 0.5rem 0.95rem; cursor: pointer; }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.3rem; padding-top: 0.9rem; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.contact-links a { color: var(--contact-fg); font-weight: 600; display: inline-flex; align-items: center; gap: 0.45rem; }
.contact-links svg, .call-btn svg, .mail-btn svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-links svg { color: #5cc6a6; }
/* Appeler et Écrire : uniquement sur les appareils tactiles (téléphones, tablettes) ; Copier : uniquement avec souris */
.call-btn, .mail-btn { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .call-btn, .mail-btn { display: none; } }
@media (hover: none), (pointer: coarse), (pointer: none) { #copy-email { display: none; } }

footer .wrap { padding-block: 1.8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem; font-size: 0.88rem; color: var(--muted); }

/* Parallaxe : décor de l'en-tête et aperçus des projets */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero > .wrap { position: relative; z-index: 1; }
.hero-decor { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-decor > * { position: absolute; will-change: transform; }
.dots {
  inset: -20% 0 0 45%;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 22%, transparent) 1.2px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 70%);
}
.shape { border-radius: 50%; }
.s1 { width: 28rem; height: 28rem; right: -8rem; top: -10rem; background: var(--accent-soft); opacity: 0.7; }
.s2 { width: 9rem; height: 9rem; left: 46%; top: 62%; border: 2px solid var(--warm); opacity: 0.35; }
.s3 { width: 3.2rem; height: 3.2rem; right: 6%; bottom: 18%; border-radius: 12px; background: var(--warm-soft); transform-origin: center; }
@media (max-width: 860px) { .s1 { width: 18rem; height: 18rem; right: -7rem; top: -6rem; } .s2 { display: none; } }
[data-speed], [data-rel] { will-change: transform; }
.mock { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { [data-speed], [data-rel] { transform: none !important; } }

/* Squelette de chargement */
.skeleton {
  position: fixed; inset: 0; z-index: 50; overflow: hidden;
  background: var(--bg); padding-top: env(safe-area-inset-top, 0px);
  opacity: 0; visibility: hidden; transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
html.is-loading .skeleton { opacity: 1; visibility: visible; transition: none; }
html.is-loading body { overflow: hidden; }
.sk {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, var(--bg-tint) 25%, color-mix(in srgb, var(--surface) 70%, var(--bg-tint)) 50%, var(--bg-tint) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-nav { border-bottom: 1px solid var(--line); }
.sk-nav .wrap { display: flex; align-items: center; gap: 0.8rem; padding-block: 0.7rem; }
.sk-logo { width: 2rem; height: 2rem; }
.sk-line { height: 0.9rem; width: 100%; }
.sk-btn-s { width: 5rem; height: 2.1rem; margin-left: auto; border-radius: 10px; }
.sk-hero { padding-block: 4.5rem 0; }
.sk-col { display: grid; gap: 0.9rem; justify-items: start; }
.sk-col .sk-line { max-width: 34rem; }
.sk-pill { width: 11rem; height: 1.8rem; border-radius: 999px; }
.sk-title { width: min(26rem, 90%); height: clamp(2.8rem, 7.5vw, 4.6rem); border-radius: 12px; }
.sk-sub { width: min(18rem, 70%); height: 1.6rem; margin-bottom: 0.4rem; }
.sk-row { display: flex; gap: 0.75rem; margin-top: 0.8rem; }
.sk-btn { width: 9rem; height: 2.9rem; border-radius: 10px; }
.sk-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: grid; gap: 1.1rem; background: var(--surface); }
.sk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 3rem; }
.sk-stats .sk { height: 5.2rem; border-radius: var(--radius); }
@media (max-width: 860px) { .sk-hero { padding-block: 2.5rem 0; } }
@media (max-width: 760px) { .sk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 2rem; } }

/* Apparition des blocs au défilement (seulement ceux hors écran au chargement) */
.reveal-pending { opacity: 0; transform: translateY(24px); }
.reveal-in {
  opacity: 1; transform: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}

/* Bouton retour en haut, avec anneau de progression de lecture */
.to-top {
  position: fixed; z-index: 20;
  right: calc(1.2rem + env(safe-area-inset-right, 0px));
  bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  width: 3.1rem; height: 3.1rem; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  display: grid; place-items: center; color: var(--accent-ink);
  background:
    radial-gradient(closest-side, var(--accent) 82%, transparent 84%),
    conic-gradient(var(--warm) calc(var(--progress, 0) * 1turn), var(--line) 0);
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}
.to-top.visible { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s ease, transform 0.25s ease; }
.to-top:hover { transform: translateY(-2px); }
.to-top svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
  .reveal-pending { opacity: 1; transform: none; }
}

/* Interrupteur de mode */
.mode-switch {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-left: auto;
  background: transparent; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 0.3rem 0.4rem 0.3rem 0.75rem; color: var(--ink); font: 600 0.85rem var(--font-body); cursor: pointer;
}
.mode-switch:hover { border-color: var(--accent); }
.ms-icon { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }
.ms-track { width: 2.1rem; height: 1.2rem; border-radius: 999px; background: var(--bg-tint); border: 1px solid var(--line); position: relative; }
.ms-track span { position: absolute; top: 2px; left: 2px; width: 0.85rem; height: 0.85rem; border-radius: 50%; background: var(--muted); transition: transform 0.2s ease, background 0.2s ease; }
.mode-switch:hover .ms-track span { transform: translateX(0.85rem); background: var(--accent); }
.nav-links { margin-left: auto; }
.nav-links + .mode-switch { margin-left: 0; }
@media (max-width: 720px) { .nav-links + .mode-switch { margin-left: auto; } .nav .btn-small { margin-left: 0; } }
@media (max-width: 400px) { .ms-text { display: none; } }

html[data-mode="dev"] body { background: #0b0f14; }

/* Transition entre les modes : un balayage façon écran cathodique */
.mode-flash { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0; background: #0b0f14; }
.mode-flash::after {
  content: ""; position: absolute; left: 0; right: 0; height: 3px; top: 0;
  background: #49cc90; box-shadow: 0 0 24px 6px rgba(73, 204, 144, 0.6);
}
html.switching .mode-flash { animation: flash 0.55s ease forwards; }
html.switching .mode-flash::after { animation: scan 0.55s ease-in-out forwards; }
@keyframes flash { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
@keyframes scan { 0% { top: 0; } 100% { top: 100%; } }
@media (prefers-reduced-motion: reduce) { html.switching .mode-flash, html.switching .mode-flash::after { animation: none; } }
