/* ============================================================
   Portfolio — thème sobre « bohème »
   Polices : Playfair Display (titres) · Source Serif 4 (corps)
             JetBrains Mono (accents/technique)
   ============================================================ */

:root {
  --bg: #f7f2e9;
  --surface: #fffdf8;
  --surface-2: #f1eadc;
  --ink: #2b2620;
  --muted: #6b6156;
  --border: #e3d9c7;
  --accent: #a16207;
  --accent-2: #845011;
  --btn-bg: #2b2620;
  --btn-ink: #f7f2e9;
  --rule: #d8ccb6;
  --shadow: 0 1px 0 rgba(43, 38, 32, 0.04), 0 8px 24px -18px rgba(43, 38, 32, 0.35);

  --font-hero: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-name: "Bitter", Georgia, "Times New Roman", serif;
  --font-system-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-display: "Alegreya", Georgia, "Times New Roman", serif;
  --font-section: "Alegreya", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1080px;
  --radius: 10px;
  --radius-lg: 14px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #14110c;
  --surface: #1c1810;
  --surface-2: #221d13;
  --ink: #ede6d8;
  --muted: #a79a85;
  --border: #332c20;
  --accent: #d4a03c;
  --accent-2: #e3b45a;
  --btn-bg: #ede6d8;
  --btn-ink: #14110c;
  --rule: #3a3225;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 30px -20px rgba(0, 0, 0, 0.8);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; transition: color 160ms ease; }
a:hover { color: var(--accent-2); }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--btn-ink); padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------------------------------------------------------- intro (ouverture) */
.intro {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: var(--bg);
  pointer-events: none;
  animation: introHide 600ms var(--ease-out) forwards;
  animation-delay: 750ms;
}
.intro-inner { display: flex; align-items: baseline; gap: 12px; animation: introUp 700ms var(--ease-out) both; }
.intro-mark { font-family: var(--font-system-mono); color: var(--accent); font-size: 1.8rem; }
.intro-name { font-family: var(--font-system-mono); font-weight: 700; font-size: clamp(1.3rem, 4.6vw, 2rem); letter-spacing: -0.01em; }
.intro-name::after { content: ""; display: inline-block; width: 2px; height: 1.1em; background: var(--accent); margin-left: 10px; vertical-align: -0.15em; animation: caret 1s steps(1) infinite; }
@keyframes introUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes introHide { to { opacity: 0; visibility: hidden; } }

/* ---------------------------------------------------------- reveal (motion) */
[data-reveal] {
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js [data-reveal] { opacity: 0; transform: translateY(18px); }
[data-reveal].is-visible { opacity: 1; transform: none; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; color: var(--ink); font-family: var(--font-name); font-size: 1.05rem; }
.brand:hover { color: var(--ink); }
.brand-mark { color: var(--accent); font-family: var(--font-mono); font-size: 1.2rem; }
.nav { display: flex; align-items: center; gap: 20px; }
.nav a { position: relative; color: var(--muted); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 260ms var(--ease-out); }
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer; transition: border-color 160ms ease, background 160ms ease;
}
.theme-toggle:hover { border-color: var(--accent); background: var(--surface-2); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (max-width: 720px) {
  .nav a { display: none; }
}

/* ---------------------------------------------------------- hero */
.hero { padding: 96px 24px 72px; max-width: 820px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  animation: breathe 2.6s var(--ease-soft) infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  50% { transform: scale(1.18); opacity: 1; box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.hero-title { font-family: var(--font-name); font-style: italic; font-size: clamp(2.4rem, 6.6vw, 4rem); letter-spacing: -0.01em; font-weight: 800; }
.hero-role { font-family: var(--font-mono); font-size: 1rem; color: var(--accent); margin: 0; letter-spacing: 0.02em; }
.hero-tagline {
  font-family: var(--font-body); font-style: normal; font-size: clamp(1.2rem, 3vw, 1.7rem);
  color: var(--ink); margin-top: 22px; border-left: 2px solid var(--accent); padding-left: 18px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }

.hero > * { animation: fadeUp 800ms var(--ease-out) both; }
.hero > .eyebrow { animation-delay: 780ms; }
.hero > .hero-title { animation-delay: 860ms; }
.hero > .hero-role { animation-delay: 940ms; }
.hero > .hero-tagline { animation-delay: 1020ms; }
.hero > .hero-actions { animation-delay: 1100ms; }

/* ---------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: var(--radius); border: 1px solid transparent;
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.02em;
  cursor: pointer; transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover { background: var(--accent); color: #fff; }
[data-theme="dark"] .btn-primary:hover { color: #14110c; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------- sections */
.section { padding: 64px 24px; border-top: 1px solid var(--border); }
.section-title {
  display: block;
  font-family: var(--font-section);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: clamp(1.7rem, 4.4vw, 2.4rem);
  margin-bottom: 36px;
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}
.js .section-title { opacity: 0; transform: translateY(14px); }
.section-title.is-visible { opacity: 1; transform: none; }
.section-index { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 400; color: var(--accent); letter-spacing: 0.05em; }
.sub-title { font-size: 1.15rem; margin-bottom: 16px; }
.prose p { color: var(--ink); text-align: justify; hyphens: auto; }

/* ---------------------------------------------------------- skills */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.skill-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.skill-card h3 { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 16px; }
.skill-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.skill-list li:last-child { border-bottom: 0; }
.skill-name { font-size: 0.96rem; }
.skill-meter { position: relative; flex: none; width: 72px; height: 5px; border-radius: 999px; background: var(--border); overflow: hidden; }
.skill-fill { display: block; height: 100%; width: var(--v, 0%); border-radius: 999px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 800ms var(--ease-out); }
.skill-card.is-visible .skill-fill { transform: scaleX(1); }

/* ---------------------------------------------------------- timeline */
.timeline { position: relative; padding-left: 36px; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--rule); }
.timeline-item { position: relative; padding-bottom: 38px; }
.timeline-item::before {
  content: ""; position: absolute; left: -34px; top: 7px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
  transition: box-shadow 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.timeline-item:hover::before { transform: scale(1.15); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-org { font-style: italic; color: var(--accent); margin: 0 0 6px; }
.timeline-role + .timeline-role { margin-top: 4px; }
.timeline-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 5px; }
.timeline-head h3 { font-size: 1.2rem; }
.timeline-date { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.bullets { display: grid; gap: 2px; }
.bullets li { position: relative; padding-left: 17px; color: var(--muted); line-height: 1.45; }
.bullets li::before { content: "–"; position: absolute; left: 0; color: var(--accent); }

/* ---------------------------------------------------------- cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform 180ms ease, border-color 180ms ease; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card-featured { border-left: 2px solid var(--accent); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h3 { font-size: 1.2rem; }
.card p { color: var(--muted); font-size: 0.96rem; }
.badge { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tags li { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.card-links { margin-top: auto; display: flex; gap: 16px; font-family: var(--font-mono); font-size: 0.78rem; }

/* ---------------------------------------------------------- lists / two-col */
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; }
.plain-list { display: grid; gap: 18px; }
.plain-list li strong { font-family: var(--font-display); font-size: 1.05rem; }

/* ---------------------------------------------------------- contact */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.contact-card { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink); box-shadow: var(--shadow); }
a.contact-card:hover { border-color: var(--accent); color: var(--ink); }
.contact-label { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.contact-value { font-size: 0.96rem; word-break: break-word; }

/* ---------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 30px 24px; font-size: 0.86rem; color: var(--muted); }
.footer-inner p { margin: 0; }
.footer-links { display: inline-flex; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 0.76rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

.terminal { margin-top: 10px !important; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); opacity: 0.75; }
.terminal .tprompt { color: var(--accent); }
.terminal .caret { display: inline-block; width: 8px; height: 1em; background: var(--accent); vertical-align: -0.18em; margin-left: 4px; animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------------------------------------------------------- flash */
.flash-wrap { padding-top: 20px; }
.flash { padding: 12px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); font-family: var(--font-mono); font-size: 0.82rem; }
.flash-success { border-color: var(--accent); color: var(--accent); }
.flash-error { border-color: #b3261e; color: #b3261e; }

/* ---------------------------------------------------------- admin */
.admin-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
.admin-title { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.admin-block { border-top: 1px solid var(--border); padding: 40px 24px; }
.admin-block h2 { display: flex; align-items: baseline; gap: 12px; font-size: 1.5rem; margin-bottom: 22px; }
.admin-block h2 .section-index { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 400; color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], textarea, select {
  width: 100%; padding: 11px 13px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font-body); font-size: 0.96rem;
  transition: border-color 150ms ease;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: none; }
.check { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.check input { width: auto; }

.admin-list { display: grid; gap: 12px; margin-top: 8px; }
.item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.item > summary { cursor: pointer; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; font-family: var(--font-display); font-size: 1.02rem; }
.item > summary::-webkit-details-marker { display: none; }
.item > summary::after { content: "▾"; color: var(--accent); font-family: var(--font-mono); transition: transform 160ms ease; }
.item[open] > summary::after { transform: rotate(180deg); }
.item-body { padding: 4px 18px 18px; border-top: 1px solid var(--border); }
.item-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.add-form { margin-top: 18px; padding: 20px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); }
.add-form > p.lead { font-family: var(--font-mono); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 14px; }

.promo-block { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); }
.promo-title { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 12px; }
.promo-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.promo-item > summary { cursor: pointer; padding: 11px 16px; font-size: 0.92rem; list-style: none; display: flex; align-items: center; gap: 8px; }
.promo-item > summary::-webkit-details-marker { display: none; }
.promo-item > summary::before { content: "↳"; color: var(--accent); font-family: var(--font-mono); }
.promo-body { padding: 4px 16px 16px; border-top: 1px solid var(--border); }

.btn-danger { background: transparent; border-color: var(--border); color: #b3261e; }
.btn-danger:hover { border-color: #b3261e; color: #fff; background: #b3261e; }
.btn-small { padding: 8px 15px; font-size: 0.74rem; }

.login-shell { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.login-card .muted { font-size: 0.9rem; margin-bottom: 24px; }
.login-card .field { margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  .intro { display: none !important; }
  .js [data-reveal], .js .section-title { opacity: 1 !important; transform: none !important; }
  .hero > * { opacity: 1 !important; }
  .dot { animation: none; opacity: 1; }
  .skill-fill { transform: none; }
  .terminal .caret, .intro-name::after { animation: none; }
}

/* ============================================================
   Enrichissements : relief, interactions, motion
   ============================================================ */
:root {
  --glow: color-mix(in srgb, var(--accent) 22%, transparent);
  --shadow-lift: 0 2px 0 rgba(43, 38, 32, 0.03), 0 22px 40px -24px rgba(43, 38, 32, 0.45);
}
[data-theme="dark"] { --shadow-lift: 0 2px 0 rgba(0, 0, 0, 0.3), 0 26px 50px -26px rgba(0, 0, 0, 0.95); }

::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--ink); }

/* grain papier */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.33 0 0 0 0 0.25 0 0 0 0.12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::before { mix-blend-mode: screen; opacity: 0.18; }
main, .site-footer { position: relative; z-index: 1; }

/* transition douce du thème */
body, .site-header, .card, .skill-card, .contact-card { transition: background-color 400ms var(--ease-soft), border-color 300ms ease, color 300ms ease; }

/* barre de progression */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: left; transform: scaleX(var(--progress, 0));
}

/* halo qui suit le curseur */
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 280px; height: 280px; margin: -140px 0 0 -140px; z-index: 0;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, var(--glow), transparent 65%);
  transform: translate3d(var(--mx, -999px), var(--my, -999px), 0);
  transition: opacity 500ms ease;
}
.has-pointer .cursor-glow { opacity: 0.55; }

/* header */
.site-header { transition: box-shadow 300ms ease, background-color 300ms ease; }
.site-header.is-scrolled { box-shadow: 0 10px 30px -22px rgba(0, 0, 0, 0.45); }
.brand-mark { display: inline-block; transition: transform 500ms var(--ease-out); }
.brand:hover .brand-mark { transform: rotate(-180deg) scale(1.2); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after { transform: scaleX(1); }
.theme-toggle svg { transition: transform 500ms var(--ease-out); }
.theme-toggle:hover svg { transform: rotate(40deg); }
.theme-toggle:active svg { transform: rotate(180deg) scale(0.8); }

.menu-toggle { display: none; }
@media (max-width: 720px) {
  .menu-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 50%;
    background: transparent; cursor: pointer;
  }
  .menu-toggle span { display: block; height: 1.5px; background: var(--ink); transition: transform 300ms var(--ease-out); }
  .nav.is-open .menu-toggle span:first-child { transform: translateY(3.75px) rotate(45deg); }
  .nav.is-open .menu-toggle span:last-child { transform: translateY(-3.75px) rotate(-45deg); }
  .nav { gap: 10px; }
  .nav a {
    display: block; position: fixed; left: 0; right: 0; z-index: 49;
    padding: 0 24px; font-size: 0.95rem; color: var(--ink);
    opacity: 0; pointer-events: none; transform: translateY(-8px);
    transition: opacity 260ms ease, transform 360ms var(--ease-out);
  }
  .nav a:nth-of-type(1) { top: 92px; } .nav a:nth-of-type(2) { top: 140px; } .nav a:nth-of-type(3) { top: 188px; }
  .nav a:nth-of-type(4) { top: 236px; } .nav a:nth-of-type(5) { top: 284px; }
  .nav a::after { display: none; }
  .nav::before {
    content: ""; position: fixed; left: 0; right: 0; top: 68px; height: 270px; z-index: 48;
    background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); opacity: 0; pointer-events: none; transition: opacity 260ms ease;
  }
  .nav.is-open::before { opacity: 1; pointer-events: auto; }
  .nav.is-open a { opacity: 1; pointer-events: auto; transform: none; }
  .nav.is-open a:nth-of-type(2) { transition-delay: 40ms; } .nav.is-open a:nth-of-type(3) { transition-delay: 80ms; }
  .nav.is-open a:nth-of-type(4) { transition-delay: 120ms; } .nav.is-open a:nth-of-type(5) { transition-delay: 160ms; }
}

/* hero */
.hero-shell {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}
/* filet doré en bas */
.hero-shell::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; z-index: 1;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 55%, transparent) 50%, transparent);
}
.hero-shell .hero { position: relative; z-index: 1; min-height: min(78vh, 720px); display: flex; flex-direction: column; justify-content: center; }

.hero-title .char { display: inline-block; opacity: 0; transform: translateY(0.5em) rotate(6deg); animation: charIn 700ms var(--ease-out) forwards; animation-delay: calc(860ms + var(--i) * 35ms); }
.hero-title .char:hover { color: var(--accent); transform: translateY(-4px); transition: transform 200ms var(--ease-out), color 200ms; }
.hero-title .space { display: inline-block; width: 0.28em; }
@keyframes charIn { to { opacity: 1; transform: none; } }
.hero-role { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.role-prompt { opacity: 0.6; }
.hero-role .caret { display: inline-block; width: 8px; height: 1.1em; background: var(--accent); animation: caret 1s steps(1) infinite; }

.scroll-hint {
  position: absolute; left: 24px; bottom: 28px; width: 22px; height: 36px; border: 1.5px solid var(--muted); border-radius: 12px;
  opacity: 0; animation: fadeUp 800ms var(--ease-out) 1500ms forwards;
}
.scroll-hint span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); animation: wheel 1.8s var(--ease-soft) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* boutons */
.btn { position: relative; overflow: hidden; transition: transform 250ms var(--ease-out), background 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 250ms ease; }
.btn-primary:hover { box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn svg { transition: transform 300ms var(--ease-out); }
.btn-primary:hover svg { transform: translateY(2px); }
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: 0.25; pointer-events: none; animation: ripple 600ms var(--ease-out); }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* sections numérotées */
main { counter-reset: section; }
.section-title { counter-increment: section; display: flex; align-items: baseline; gap: 14px; }
.section-title::before { content: counter(section, decimal-leading-zero) "."; font-family: var(--font-mono); font-size: 0.85rem; font-weight: 400; color: var(--accent); letter-spacing: 0.05em; }
.section-title::after { content: ""; flex: 1; height: 1px; align-self: center; background: linear-gradient(90deg, var(--rule), transparent); transform: scaleX(0); transform-origin: left; transition: transform 1100ms var(--ease-out) 200ms; }
.section-title.is-visible::after { transform: scaleX(1); }
.section { border-top: 0; }

/* projecteur sur les cartes */
[data-spot] { position: relative; isolation: isolate; }
[data-spot]::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(360px circle at var(--sx, 50%) var(--sy, 50%), var(--glow), transparent 60%);
  transition: opacity 300ms ease;
}
[data-spot]:hover::before { opacity: 1; }

.skill-card, .card, .contact-card { transition: transform 350ms var(--ease-out), box-shadow 350ms var(--ease-out), border-color 250ms ease, background-color 400ms ease, opacity 700ms var(--ease-out); }
.skill-card:hover, a.contact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.skill-list li { transition: padding-left 250ms var(--ease-out); }
.skill-list li:hover { padding-left: 6px; }
.skill-list li:hover .skill-name { color: var(--accent); }
.skill-fill { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.skill-card li:nth-child(2) .skill-fill { transition-delay: 80ms; } .skill-card li:nth-child(3) .skill-fill { transition-delay: 160ms; }
.skill-card li:nth-child(4) .skill-fill { transition-delay: 240ms; } .skill-card li:nth-child(n+5) .skill-fill { transition-delay: 320ms; }

.card { transform-style: preserve-3d; will-change: transform; }
.card:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px); box-shadow: var(--shadow-lift); }
.card-featured { border-left-width: 1px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface) 55%); }
.card-links a { position: relative; display: inline-flex; gap: 4px; }
.card-links a::after { content: "→"; transition: transform 250ms var(--ease-out); }
.card-links a:hover::after { transform: translateX(4px); }
.tags li { transition: border-color 200ms, color 200ms; }
.card:hover .tags li { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

a.contact-card .contact-value::after { content: " ↗"; display: inline-block; color: var(--accent); opacity: 0; transform: translate(-4px, 4px); transition: opacity 250ms, transform 300ms var(--ease-out); }
a.contact-card:hover .contact-value::after { opacity: 1; transform: none; }

/* timeline qui se trace au défilement */
.timeline::after { content: ""; position: absolute; left: 6px; top: 6px; width: 1px; height: calc((100% - 12px) * var(--line, 0)); background: var(--accent); }
.timeline-item { transition: transform 700ms var(--ease-out), opacity 700ms var(--ease-out); }
.timeline-item::before { transition: background-color 300ms ease, box-shadow 300ms var(--ease-out), transform 300ms var(--ease-out); }
.timeline-item.is-reached::before { background: var(--accent); }
.timeline-item.is-visible::before { animation: pop 500ms var(--ease-out) 150ms both; }
@keyframes pop { from { transform: scale(0); } 60% { transform: scale(1.35); } to { transform: scale(1); } }
.timeline-role { padding: 10px 14px; margin-left: -14px; border-radius: var(--radius); transition: background-color 250ms ease; }
.timeline-role:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }

/* retour en haut */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: var(--shadow-lift);
  opacity: 0; transform: translateY(14px) scale(0.9); pointer-events: none;
  transition: opacity 300ms ease, transform 400ms var(--ease-out), border-color 200ms, color 200ms;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  .scroll-hint span { animation: none !important; }
  .hero-title .char, .scroll-hint { opacity: 1 !important; transform: none !important; animation: none !important; }
  .cursor-glow { display: none; }
  .timeline::after { height: calc(100% - 12px); }
  .card:hover { transform: none; }
}

/* ---------------------------------------------------------- carte de visite */
.vcard-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 68px 16px; overflow-x: hidden; }
.vcard-page .vcard { margin: auto 0; }
.vcard-back { position: fixed; top: 16px; right: 16px; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
.vcard-back:hover svg { transform: translateX(-3px); }
.vcard {
  width: 100%; max-width: 360px; aspect-ratio: 55 / 85;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 36px 28px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeUp 600ms var(--ease-out) both;
}
.vcard-mark { margin: 0; font-family: var(--font-mono); color: var(--accent); font-size: 1.3rem; }
.vcard-name { margin: 6px 0 0; font-family: var(--font-name); font-weight: 700; font-size: 1.6rem; line-height: 1.2; }
.vcard-title { margin: 8px 0 0; font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
.vcard-scope { margin: 10px 0 0; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }
.vcard-rule { width: 48px; border: 0; border-top: 1px solid var(--rule); margin: 22px auto; }
.vcard-info { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 8px; font-family: var(--font-body); font-size: 0.88rem; text-align: left; }
.vcard-info li { display: grid; grid-template-columns: 44px 1fr; align-items: baseline; overflow-wrap: anywhere; }
.vcard-info span { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.vcard-info a { color: var(--ink); }
.vcard-info a:hover { color: var(--accent); }
.vcard-dl { margin-top: auto; }
.vcard-share { position: fixed; right: 16px; bottom: 16px; z-index: 10; box-shadow: var(--shadow); }
.share-dialog {
  width: min(360px, calc(100vw - 32px)); padding: 32px 28px 28px; text-align: center;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.share-dialog[open] { animation: fadeUp 300ms var(--ease-out) both; }
.share-dialog::backdrop { background: rgba(20, 17, 12, 0.55); backdrop-filter: blur(4px); }
.share-close { position: absolute; top: 10px; right: 10px; display: inline-flex; padding: 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 50%; }
.share-close:hover { color: var(--accent); }
.share-label { margin: 0 0 18px; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.vcard-qr { color: var(--ink); }
.vcard-qr svg { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto; }
.vcard-qr svg path { stroke: currentColor; }
