/* damien — DA « Angine de Poitrine » : noir / or, la lettre comme décor. */

@font-face { font-family: "Bebas Neue"; src: url("../assets/fonts/BebasNeue-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../assets/fonts/DMSans-400.woff2") format("woff2"); font-weight: 300 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../assets/fonts/DMSans-500.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --black: #111111;
  --white: #FAFAF8;
  --gold: #C9971C;
  --gold-text: #8A6510;     /* or assombri pour le texte sur fond clair (AA) */
  --gold-light: #E8B84B;
  --grey: #6B6B63;
  --grey-light: #E8E8E4;

  --bg: var(--white);
  --fg: var(--black);
  --muted: var(--grey);
  --rule: #B9B9B0;
  --accent: var(--gold);
  --accent-text: var(--gold-text);
  --invert-bg: var(--black);
  --invert-fg: var(--white);

  --bebas: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --dm: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 720px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C0C0B;
    --fg: #F1EBDD;            /* crème, comme une affiche sérigraphiée */
    --muted: #A39E90;
    --rule: #4A4740;
    --accent: var(--gold-light);
    --accent-text: var(--gold-light);
    --invert-bg: #1B1A17;
    --invert-fg: #F1EBDD;
  }
}

*, *::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(--fg);
  font: 400 16px/1.6 var(--dm);
  overflow-x: hidden;
}
body.drawer-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--fg); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 16px; top: 16px; }

.label {
  font: 500 11px/1.4 var(--dm);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.gold-line { width: 32px; height: 2px; background: var(--accent); margin: 20px auto; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  max-width: var(--max); margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg);
  border-bottom: 1px dotted var(--rule);
}
.logo {
  justify-self: center;
  font: 400 28px/1 var(--bebas); letter-spacing: 4px;
  text-decoration: none;
}
.logo b, .footer b { color: var(--accent); font-weight: 400; }
.header-tag { justify-self: end; font: 400 13px/1 var(--bebas); letter-spacing: 2px; color: var(--muted); }

.burger {
  width: 44px; height: 44px; padding: 12px 11px; margin-left: -11px;
  background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
}
.burger span { display: block; height: 2px; width: 22px; background: var(--fg); transition: transform .3s var(--ease), opacity .2s, width .3s var(--ease); }
.burger span:nth-child(3) { width: 14px; }  /* la 3ᵉ barre, raccourcie : la signature */
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { width: 22px; transform: translateY(-8px) rotate(-45deg); }

.drawer {
  position: fixed; inset: 0; top: calc(65px + env(safe-area-inset-top)); z-index: 15;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  animation: fade .3s ease both;
}
.drawer[hidden] { display: none; }
.drawer a {
  font: 400 44px/1.1 var(--bebas); letter-spacing: 3px; text-decoration: none;
  padding: 4px 16px;
}
.drawer a:hover, .drawer a:focus-visible { color: var(--accent); }

/* ---------- Layout ---------- */
main, .footer { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.section { padding: 64px 0 24px; border-top: 1px dotted var(--rule); scroll-margin-top: 70px; }
.section-title {
  font: 400 18px/1 var(--bebas); letter-spacing: 3px; margin: 0 0 28px;
  display: flex; align-items: center; gap: 12px;
}
.section-title::after { content: ""; flex: 0 0 32px; height: 2px; background: var(--accent); }
.intro { font-size: 17px; margin: 0 0 32px; max-width: 60ch; }
.intro strong { font-weight: 500; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 56px 0 48px; }
.name {
  font: 400 clamp(84px, 24vw, 168px)/.86 var(--bebas);
  letter-spacing: 1px; margin: 18px 0 0;
  animation: rise .9s var(--ease) both;
}
.hero-sub { font-size: 17px; margin: 0 auto; max-width: 30ch; color: var(--muted); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 44px 0 0; border-top: 1px dotted var(--rule); border-bottom: 1px dotted var(--rule);
}
.stats div { padding: 16px 4px 14px; display: flex; flex-direction: column-reverse; }
.stats div + div { border-left: 1px dotted var(--rule); }
.stats dd { margin: 0; font: 400 clamp(32px, 9vw, 48px)/1 var(--bebas); letter-spacing: 1px; }
.stats dd span { color: var(--accent); }
.stats dt { font: 500 9px/1.3 var(--dm); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ---------- Manifeste ---------- */
.manifesto .lead { font: 400 clamp(30px, 7vw, 44px)/1.02 var(--bebas); letter-spacing: .5px; margin: 0 0 20px; }
.manifesto em { font-style: normal; color: var(--accent-text); }
.manifesto p { max-width: 60ch; }
.manifesto blockquote, .reco blockquote {
  margin: 32px 0 0; padding: 20px 0 0 20px;
  border-left: 2px solid var(--accent);
  font-size: 18px; font-style: italic;
}
.manifesto blockquote p { margin: 0; }

/* ---------- Cas IA ---------- */
.case {
  border: 1px dotted var(--rule); padding: 24px 20px; margin: 0 0 20px;
}
.case h3 { font: 400 clamp(26px, 6vw, 34px)/1.05 var(--bebas); letter-spacing: 1px; margin: 8px 0 12px; }
.case p { margin: 0 0 16px; }
.case strong { font-weight: 500; }
.case--dark { background: var(--invert-bg); color: var(--invert-fg); border-color: var(--invert-bg); }
.case--dark .label { color: var(--gold-light); }
.case--dark p:last-child { margin: 0; }
code { font: 500 .9em ui-monospace, "SF Mono", Menlo, monospace; color: var(--accent); }
.case--dark code { color: var(--gold-light); }

.figures {
  list-style: none; padding: 0; margin: 0 0 16px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px dotted var(--rule);
}
.figures li { padding: 12px 4px 0; display: flex; flex-direction: column; }
.figures li + li { border-left: 1px dotted var(--rule); padding-left: 10px; }
.figures b { font: 400 clamp(28px, 7vw, 38px)/1 var(--bebas); font-weight: 400; color: var(--accent-text); }
.figures span { font: 500 9px/1.3 var(--dm); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.case > .figures:last-child { margin-bottom: 0; }
.bullets { margin: 0; padding: 0; list-style: none; }
.bullets li { padding: 6px 0 6px 20px; position: relative; border-top: 1px dotted var(--rule); }
.bullets li::before { content: ""; position: absolute; left: 0; top: 17px; width: 10px; height: 2px; background: var(--accent); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 96px 1fr; gap: 16px;
  padding: 18px 0; border-top: 1px dotted var(--rule);
}
.tl-year { font: 400 18px/1.1 var(--bebas); letter-spacing: 1px; color: var(--muted); padding-top: 2px; }
.timeline .now .tl-year { color: var(--accent-text); }
.tl-body h3 { font: 400 24px/1.05 var(--bebas); letter-spacing: 1px; margin: 4px 0 6px; }
.tl-body p:last-child { margin: 0; font-size: 15px; }
.edu { margin: 24px 0 0; padding-top: 18px; border-top: 1px dotted var(--rule); font-size: 15px; }
.edu .label { display: block; margin-bottom: 4px; }

/* ---------- Projets ---------- */
.projects { list-style: none; margin: 0; padding: 0; }
.projects li { border-top: 1px dotted var(--rule); }
.projects a, .pj-static {
  display: grid; grid-template-columns: 44px 1fr 24px; gap: 12px; align-items: start;
  padding: 18px 0; text-decoration: none;
}
.pj-static { grid-template-columns: 44px 1fr; }
.pj-num { font: 400 30px/1 var(--bebas); color: var(--accent); }
.projects h3 { font: 400 26px/1 var(--bebas); letter-spacing: 1px; margin: 4px 0 4px; }
.projects p { margin: 0; font-size: 15px; }
.projects p.label { font-size: 10px; }
.pj-arrow { font: 400 22px/1 var(--bebas); padding-top: 26px; transition: transform .3s var(--ease); }
.projects a:hover .pj-arrow, .projects a:focus-visible .pj-arrow { transform: translateX(4px); color: var(--accent); }
.projects a:hover h3 { color: var(--accent-text); }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; }
.skill-group { border-top: 1px dotted var(--rule); padding: 14px 0 18px; }
.skill-group h3 { font: 400 20px/1 var(--bebas); letter-spacing: 2px; margin: 0 0 10px; }
.skill-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.skill-group li { font: 500 11px/1 var(--dm); letter-spacing: 1px; text-transform: uppercase; padding: 6px 8px; border: 1px dotted var(--rule); }

/* ---------- Reco ---------- */
.reco { margin: 0; }
.reco blockquote { margin: 0 0 14px; }
.reco blockquote p { margin: 0; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact .section-title { justify-content: center; }
.contact .section-title::after { display: none; }
.big-cta { font: 400 clamp(64px, 18vw, 120px)/.9 var(--bebas); margin: 0; }
.links { list-style: none; margin: 8px 0 0; padding: 0; text-align: left; }
.links li { border-top: 1px dotted var(--rule); }
.links li:last-child { border-bottom: 1px dotted var(--rule); }
.links a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 18px 0; text-decoration: none; font: 400 22px/1 var(--bebas); letter-spacing: 1px;
}
.links a:hover { color: var(--accent-text); }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 48px 16px calc(40px + env(safe-area-inset-bottom)); }
.footer p { margin: 0 0 8px; font: 400 18px/1 var(--bebas); letter-spacing: 3px; }
.footer .label { font-size: 9px; }

/* ---------- Motion : lent, discret, jamais de rebond ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.stats.reveal { transition-delay: .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Petits écrans ---------- */
@media (max-width: 480px) {
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .skills { grid-template-columns: 1fr; }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .figures li:nth-child(3) { border-left: 0; padding-left: 4px; }
  .figures li:nth-child(n+3) { border-top: 1px dotted var(--rule); margin-top: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px dotted var(--rule); }
}
