/* ==========================================================================
   erceau.com — "Feutre & Console" design system
   Dark slate ground, chalk text, Azure-blue accent (cloud), felt-green
   secondary (blackball). Inter Variable for body, JetBrains Mono for
   display/labels. Mobile-first. No dependencies.
   ========================================================================== */

/* ---- Self-hosted fonts (SIL OFL, see assets/fonts/OFL-LICENSE.txt) ------ */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens -------------------------------------------------------------- */
:root {
  /* color */
  --bg: #0e1116;            /* slate night */
  --bg-raised: #151b23;     /* cards, header */
  --bg-inset: #0a0d11;      /* code, wells */
  --line: #29313c;          /* borders, rules */
  --text: #e8e6e1;          /* chalk */
  --text-muted: #9aa4b2;    /* AA on --bg (5.9:1) */
  --accent: #4d94ff;        /* azure — AA on --bg (6.2:1) */
  --accent-strong: #2f81f7; /* azure deep — large text & fills */
  --felt: #35b673;          /* felt green — AA on --bg for text */
  --felt-deep: #1f6e43;     /* felt green — fills, decorations */

  /* type */
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --fs-0: 0.8125rem;   /* 13 — captions, eyebrows */
  --fs-1: 1rem;        /* 16 — body */
  --fs-2: 1.1875rem;   /* 19 — lead */
  --fs-3: 1.5rem;      /* 24 — h3 */
  --fs-4: 2rem;        /* 32 — h2 */
  --fs-5: clamp(2.375rem, 5.5vw, 3.5rem); /* h1 / hero */

  /* rhythm */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;
  --radius: 6px;
  --measure: 68ch;
  --container: 72rem;
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-1);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, picture, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
p, li { max-width: var(--measure); }

/* ---- Typography ----------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-5); }
h2 { font-size: var(--fs-4); margin-block: var(--space-5) var(--space-3); }
h3 { font-size: var(--fs-3); margin-block: var(--space-4) var(--space-2); }
p + p { margin-top: var(--space-2); }
.lead { font-size: var(--fs-2); color: var(--text-muted); }
strong { color: var(--text); }
::selection { background: var(--accent-strong); color: #fff; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }

/* Eyebrow: mono micro-label above titles. Blue = cloud, green = billiards. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: var(--space-1);
}
.eyebrow--felt { color: var(--felt); }

/* Signature: the "trajectory" rule — a cue-ball path / network route.
   A thin line ending in a node, used under hero titles and as section marks. */
.trajectory {
  --traj-color: var(--accent-strong);
  position: relative;
  display: block;
  width: min(180px, 40%);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--traj-color));
  margin-block: var(--space-3);
  border: 0;
}
.trajectory::after {
  content: "";
  position: absolute;
  right: -5px; top: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--traj-color);
}
.trajectory--felt { --traj-color: var(--felt-deep); }

/* ---- Layout --------------------------------------------------------------- */
.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}
.section { padding-block: var(--space-5); }
.grid-2 { display: grid; gap: var(--space-3); }
.grid-3 { display: grid; gap: var(--space-3); }
@media (min-width: 44rem) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Header / nav ---------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 3.75rem;
}
.brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-1);
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}
.brand:hover { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.site-nav a {
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.4rem 0.2rem;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent-strong);
}
.lang-switch {
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  text-decoration: none;
  color: var(--text-muted);
}
.lang-switch:hover { border-color: var(--accent); color: var(--text); }

/* ---- Hero ------------------------------------------------------------------ */
.hero { padding-block: var(--space-6) var(--space-5); }
.hero .lead { margin-top: var(--space-2); }

/* ---- Components ------------------------------------------------------------- */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.card > h3:first-child { margin-top: 0; }

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  color: var(--text-muted);
  margin: 0 0.35rem 0.5rem 0;
}

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--fs-1);
  color: #fff;
  background: var(--accent-strong);
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius);
  padding: 0.65rem 1.4rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--bg-raised); color: var(--text); }

/* Career / palmarès timeline */
.timeline { list-style: none; padding: 0; }
.timeline > li {
  position: relative;
  padding: 0 0 var(--space-4) var(--space-4);
  border-left: 2px solid var(--line);
}
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: -6px; top: 0.35rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent-strong);
}
.timeline--felt > li::before { background: var(--felt-deep); }
.timeline time {
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}

/* Photo gallery (lot 4) */
.gallery {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  padding: 0; list-style: none;
}
.gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  filter: grayscale(18%) contrast(1.04); /* light archival grain treatment */
}
.gallery a:hover img, .gallery a:focus-visible img { filter: none; border-color: var(--felt); }
.gallery figcaption {
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Forms (lot 5) */
.form-field { margin-bottom: var(--space-3); }
.form-field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.form-field input, .form-field textarea {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
  color: var(--text);
}
.form-field input:focus, .form-field textarea:focus {
  outline: 2px solid var(--accent-strong);
  outline-offset: 1px;
  border-color: transparent;
}
.form-consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: var(--fs-0); color: var(--text-muted); }
.form-consent input { width: auto; margin-top: 0.2rem; }
.form-status { font-family: var(--font-mono); font-size: var(--fs-0); margin-top: var(--space-2); }
.form-status[data-state="ok"] { color: var(--felt); }
.form-status[data-state="error"] { color: #f77; }
/* Honeypot: visually removed, still in the accessibility tree trap for bots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Footer ------------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--space-6);
  padding-block: var(--space-4);
  color: var(--text-muted);
  font-size: var(--fs-0);
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ---- Accessibility & quality floor -------------------------------------------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent-strong); color: #fff;
  padding: 0.5rem 1rem; z-index: 20; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; color: #111; }
  .site-header, .site-footer, .btn { display: none; }
}

/* ---- Lightbox (gallery.js) ------------------------------------------------ */
.lightbox {
  background: transparent;
  border: 0;
  padding: 0;
  max-width: min(96vw, 1200px);
  max-height: 94vh;
}
.lightbox::backdrop { background: rgba(6, 8, 11, 0.92); }
.lightbox figure { margin: 0; }
.lightbox img {
  max-width: min(96vw, 1200px);
  max-height: 84vh;
  width: auto; height: auto;
  margin-inline: auto;
  border-radius: var(--radius);
}
.lightbox figcaption {
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  color: var(--text-muted);
  text-align: center;
  padding-top: var(--space-1);
}
.lightbox button {
  position: fixed;
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 2.6rem; height: 2.6rem;
  font-size: 1.4rem; line-height: 1;
  cursor: pointer;
}
.lightbox button:hover { border-color: var(--accent); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ---- Photo insets (hero portrait + in-page photos) ------------------------- */
.hero-grid { display: grid; gap: var(--space-4); align-items: center; }
@media (min-width: 44rem) {
  .hero-grid { grid-template-columns: 1.5fr 1fr; }
}
.hero-photo {
  width: min(20rem, 70vw);
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
@media (min-width: 44rem) {
  .hero-photo { width: 100%; max-width: 22rem; justify-self: end; }
}
.photo-inset { margin-block: var(--space-4); }
.photo-inset img {
  width: 100%;
  max-width: 40rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.photo-inset figcaption {
  font-family: var(--font-mono);
  font-size: var(--fs-0);
  color: var(--text-muted);
  margin-top: 0.4rem;
}
