/* ------------------------------------------------------------------
   Axel Vignal — feuille de style unique
   Polices auto-hébergées (licence SIL OFL, voir /fonts)
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f4ef;
  --paper-2: #eeebe3;
  --ink: #1b1a17;
  --ink-2: #5f5b54;
  --rule: #dad5cb;
  --accent: #a63d1e;
  --accent-bg: #f3e3dc;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 40rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1c1b19;
    --paper-2: #252421;
    --ink: #ebe7df;
    --ink-2: #a9a399;
    --rule: #3a3833;
    --accent: #e0805f;
    --accent-bg: #3a2620;
  }
}
:root[data-theme="dark"] {
  --paper: #1c1b19;
  --paper-2: #252421;
  --ink: #ebe7df;
  --ink-2: #a9a399;
  --rule: #3a3833;
  --accent: #e0805f;
  --accent-bg: #3a2620;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}
.skip:focus {
  top: 0.75rem;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- En-tête ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}
.site-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.005em;
}
.site-header a[href^="mailto"] {
  font-family: var(--mono);
  font-size: 0.875rem;
}

/* ---------- Typographie ---------- */

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.9rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.022em;
  max-width: 24ch;
}
h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem);
  max-width: 26ch;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}
p {
  margin: 0 0 1em;
  max-width: var(--measure);
  text-wrap: pretty;
}
p:last-child {
  margin-bottom: 0;
}
.lead {
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 36rem;
}
.label {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  margin: 0;
}
.muted {
  color: var(--ink-2);
}
.small {
  font-size: 0.9375rem;
}

/* ---------- Accroche ---------- */

.hero {
  padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(3rem, 7vw, 5.5rem);
}
.hero .label {
  margin-bottom: 1.75rem;
}
.hero h1 {
  margin-bottom: 1.75rem;
}
.hero .lead {
  margin-bottom: 2.25rem;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  margin: 0;
}
.cta a {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
}

/* ---------- Sections ---------- */

.section {
  border-top: 1px solid var(--rule);
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}
.section > .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}
@media (min-width: 60rem) {
  .section > .wrap {
    grid-template-columns: 11rem minmax(0, 1fr);
    column-gap: 3rem;
  }
  .section .label {
    padding-top: 0.55rem;
  }
}
.section-body > h2 {
  margin-bottom: 1.5rem;
}
.section-body > h2 + p,
.section-body > p {
  font-size: 1.0625rem;
}
.section-body > * + h3 {
  margin-top: 2.5rem;
}

/* ---------- Vidéo ---------- */

.video-section {
  padding: 0 0 clamp(3rem, 7vw, 5.5rem);
}
.video-figure {
  margin: 0;
}
.video {
  aspect-ratio: 16 / 9;
  background: #1b2330;
  border: 1px solid var(--rule);
  overflow: hidden;
}
.video video {
  display: block;
  width: 100%;
  height: 100%;
  background: #1b2330;
}
.video-caption {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.9rem;
  max-width: 44rem;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

/* ---------- Listes de définitions ---------- */

.defs {
  margin: 0;
  border-top: 1px solid var(--rule);
}
.defs > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 44rem) {
  .defs > div {
    grid-template-columns: 15rem minmax(0, 1fr);
    column-gap: 2rem;
  }
}
.defs dt {
  font-weight: 600;
  line-height: 1.4;
}
.defs dd {
  margin: 0;
  color: var(--ink-2);
  max-width: 34rem;
}

/* ---------- Trace d'exécution (exemple) ---------- */

.trace-block {
  margin: 2rem 0 2.25rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.trace-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.trace {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.5;
}
.trace li {
  display: grid;
  grid-template-columns: 7.25rem 6.5rem minmax(0, 1fr);
  gap: 0.15rem 1rem;
  padding: 0.45rem 1.25rem;
}
.trace li.gap {
  margin-top: 0.6rem;
  padding-top: 0.95rem;
  border-top: 1px dashed var(--rule);
}
.trace time {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.trace .src {
  color: var(--ink-2);
}
.trace .flag {
  display: inline-block;
  padding: 0 0.4rem;
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 500;
}
@media (max-width: 36rem) {
  .trace li {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .trace .msg {
    grid-column: 1 / -1;
  }
}

/* ---------- Étapes ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--ink-2);
  padding-top: 0.15rem;
}
.steps h3 {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.4;
  margin-bottom: 0.3rem;
}
.steps p {
  color: var(--ink-2);
  max-width: 34rem;
}

/* ---------- Réalisations ---------- */

.work {
  margin-top: 2.5rem;
  display: grid;
  gap: clamp(3rem, 6vw, 4.5rem);
}
.work article {
  display: grid;
  gap: 1.25rem;
}
.work-head {
  display: grid;
  gap: 0.4rem;
}
.work-head p {
  color: var(--ink-2);
}
.points {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 36rem;
}
.points li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
}
.points li:last-child {
  border-bottom: 1px solid var(--rule);
}
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.2rem;
  width: 0.45rem;
  height: 1px;
  background: var(--ink-2);
}
.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1rem;
  margin-top: 0.75rem;
  align-items: start;
}
@media (min-width: 44rem) {
  .shots {
    grid-template-columns: repeat(3, minmax(0, 16rem));
    gap: 2rem 1.5rem;
  }
}
.shots figure {
  margin: 0;
}
.shots .shot-wide {
  grid-column: 1 / -1;
}
.shots img {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #111;
}
.shots figcaption {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-2);
}

/* ---------- Contact ---------- */

.contact-mail {
  display: inline-block;
  margin: 1.75rem 0 1rem;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1rem + 2.6vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

/* ---------- Pied de page ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 2.5rem;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}
.site-footer p {
  margin: 0;
}
.site-footer a {
  color: var(--ink-2);
}

/* ---------- Page mentions légales ---------- */

.legal {
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}
.legal h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  margin-bottom: 2.5rem;
}
.legal h2 {
  font-size: 1.35rem;
  margin: 2.75rem 0 0.9rem;
}
.legal address {
  font-style: normal;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
.legal .back {
  margin-top: 3rem;
}
