/* Site de Cyrille de Gourcy — piste B « Éditorial » : colonne d'identité collante à gauche,
   contenu qui défile à droite ; une seule colonne sur mobile. */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/inter-tight-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/inter-tight-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --fg: #1a2230;
  --muted: #5a6577;
  --line: #d3d9e1;
  --accent: #b4432a;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-4: clamp(2.6rem, 2rem + 3vw, 3.6rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a23;
    --surface: #1b2330;
    --fg: #e3e8ef;
    --muted: #98a3b5;
    --line: #273041;
    --accent: #f08a6e;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--step-0) / 1.65 var(--sans);
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
a[rel~="noopener"]::after { content: "\2197" / ""; font-size: 0.8em; margin-left: 0.15em; }

.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;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--fg); color: var(--bg); padding: 0.6rem 1rem; border-radius: 4px; text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- Accueil ---------- */
.home {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem max(1.25rem, env(safe-area-inset-right)) 2rem max(1.25rem, env(safe-area-inset-left));
  display: grid;
  gap: 3rem;
}
.identity { display: grid; align-content: start; gap: 1rem; }
.portrait {
  width: 6rem; height: 6rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--line); /* pendant le chargement */
  margin-bottom: 0.5rem;
}
.name {
  font: 400 var(--step-4) / 1.02 var(--serif);
  letter-spacing: -0.015em;
  margin: 0;
}
.name span { display: block; }
.role { margin: 0; font-weight: 600; }
.pitch { margin: 0; color: var(--muted); max-width: 34ch; }
.sections { display: none; }
.sections ul, .social { list-style: none; margin: 0; padding: 0; }
.social { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.social a { color: var(--accent); display: inline-block; padding-block: 0.25rem; }

.content { display: grid; gap: 3.5rem; min-width: 0; }
.content section { scroll-margin-top: 2rem; }
.label {
  font: 600 0.8rem / 1.2 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; max-width: 65ch; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 0.35em; }
.prose h2 { font: 400 var(--step-2) / 1.2 var(--serif); margin: 2rem 0 0.75rem; }
.prose h3 { font: 600 var(--step-1) / 1.3 var(--sans); margin: 1.5rem 0 0.5rem; }

.company {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem;
  display: grid;
  gap: 0.6rem;
}
.company-name { font: 400 var(--step-2) / 1.15 var(--serif); margin: 0; }
.company-name img { display: block; height: 2.5rem; width: auto; margin-bottom: 0.25rem; }
.company-pitch { margin: 0; font-weight: 600; }
.more { margin: 0.25rem 0 0; }
.more a { color: var(--accent); font-weight: 600; }
.prose + .more { margin-top: 1.5rem; }

.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.project { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 1rem; }
.project .year { margin: 0; padding-top: 0.15rem; color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.project h3 { margin: 0; font: 600 var(--step-0) / 1.4 var(--sans); }
.project h3 a { text-decoration: none; }
.project h3 a:hover { text-decoration: underline; }
.project p { margin: 0.2rem 0 0; color: var(--muted); }
.tags { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li { font-size: 0.75rem; line-height: 1.6; padding: 0 0.55rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }

.contact-line { margin: 0; font: 400 var(--step-1) / 1.5 var(--serif); }
.contact-line a { color: var(--accent); }

@media (min-width: 56.25rem) {
  .home {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 4rem;
    padding-block: 4.5rem 3rem;
  }
  .identity {
    position: sticky;
    top: 4.5rem;
    align-self: start;
  }
  .sections { display: block; margin-top: 1.25rem; }
  .sections ul { display: grid; gap: 0.15rem; }
  .sections a {
    display: inline-flex; align-items: center; gap: 0.75rem;
    min-height: 1.75rem;
    font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--muted); text-decoration: none;
  }
  .sections a::before {
    content: ""; width: 1.4rem; height: 1px; background: currentColor;
    transition: width 0.2s ease;
  }
  .sections a:hover, .sections a[aria-current="true"] { color: var(--fg); }
  .sections a:hover::before, .sections a[aria-current="true"]::before { width: 2.8rem; }
  .content { padding-top: 0.5rem; }
}
/* Écran large mais peu haut : la colonne d'identité ne tiendrait pas, elle défile avec la page. */
@media (min-width: 900px) and (max-height: 760px) {
  .identity { position: static; }
}

/* ---------- Pages simples ---------- */
.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem max(1.25rem, env(safe-area-inset-right)) 2rem max(1.25rem, env(safe-area-inset-left));
}
.page-header { margin-bottom: 2.5rem; }
.back { font: 400 var(--step-1) / 1.2 var(--serif); text-decoration: none; display: inline-block; padding-block: 0.25rem; }
.back::before { content: "\2190\00a0" / ""; color: var(--accent); }
.page-title { font: 400 var(--step-4) / 1.05 var(--serif); letter-spacing: -0.015em; margin: 0 0 0.75rem; }
.page-meta { color: var(--muted); margin: 0 0 2rem; font-variant-numeric: tabular-nums; }
.page-main .prose { margin-top: 1.5rem; }

/* ---------- Pied de page ---------- */
.site-footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem max(1.25rem, env(safe-area-inset-right)) 2.5rem max(1.25rem, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  color: var(--muted); font-size: var(--step--1);
}
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer a, .site-footer button { display: inline-block; padding-block: 0.2rem; }
.site-footer button {
  font: inherit; color: inherit; background: none; border: 0; padding-inline: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
}

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

/* ---------- Tableaux du contenu (page de confidentialité) ---------- */
.prose .table-wrap, .prose table { display: block; overflow-x: auto; }
.prose table { border-collapse: collapse; margin: 0 0 1em; font-size: var(--step--1); max-width: 100%; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; }
.prose code { font-size: 0.9em; }

/* ---------- Bandeau de consentement ---------- */
.consent {
  position: fixed; z-index: 20;
  left: max(1rem, env(safe-area-inset-left)); right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  max-width: 40rem; margin-inline: auto;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.15);
  padding: 1rem 1.25rem;
  display: grid; gap: 0.75rem;
  font-size: var(--step--1);
}
.consent p { margin: 0; }
.consent a { color: var(--accent); }
.consent div { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.consent button {
  font: 600 var(--step--1) / 1 var(--sans);
  min-height: 2.5rem; padding: 0 1.1rem; border-radius: 6px; cursor: pointer;
  background: var(--fg); color: var(--bg); border: 1px solid var(--fg);
}
