/* ═══════════════════════════════════════════════════════════════
   Template AP — Swiss Grid Pur
   WebStudio Caraïbes — Template Library
   Typographie : Inter (corps) + Inter Display (titres)
   Charte : NOIR sur BLANC · grille 12 colonnes · espace généreux
   ═══════════════════════════════════════════════════════════════ */

/* ── 0. PREFERS-REDUCED-MOTION (toujours en tête) ──────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── 1. CUSTOM PROPERTIES ───────────────────────────────────── */
:root {
  /* Palette stricte NOIR / BLANC */
  --c-bg:      #ffffff;
  --c-text:    #000000;
  --c-muted:   #4a4a4a;
  --c-rule:    #000000;
  --c-subtle:  #e8e8e8;

  /* Typographie — Inter uniquement */
  --ff: 'Inter', 'Inter Display', system-ui, -apple-system, sans-serif;

  /* Tailles fluides */
  --fs-hero:   clamp(3rem,   10vw, 7.5rem);
  --fs-display:clamp(2rem,   5vw,  3.5rem);
  --fs-h2:     clamp(1.5rem, 3vw,  2.25rem);
  --fs-h3:     clamp(1.125rem, 1.8vw, 1.375rem);
  --fs-body:   1rem;
  --fs-small:  0.875rem;
  --fs-label:  0.6875rem;

  --lh-hero:    1.0;
  --lh-heading: 1.1;
  --lh-body:    1.7;

  /* Poids */
  --fw-light:  300;
  --fw-regular:400;
  --fw-medium: 500;
  --fw-bold:   700;
  --fw-black:  900;

  /* Espacement */
  --space-xs:  0.5rem;
  --space-s:   1rem;
  --space-m:   2rem;
  --space-l:   4rem;
  --space-xl:  7rem;
  --space-2xl: 12rem;

  /* Grille */
  --cols:     12;
  --gap:      clamp(1rem, 2vw, 1.5rem);
  --margin-h: clamp(1.25rem, 6vw, 5rem);

  /* Transition (hover uniquement, pas décorative) */
  --t: 150ms ease;
}

/* ── 2. RESET ───────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: var(--ff);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; }
a:hover { text-decoration: none; }
ul, ol { list-style: none; }
address { font-style: normal; }
h1, h2, h3, h4 { line-height: var(--lh-heading); font-weight: var(--fw-bold); }

/* ── 3. GRILLE VISIBLE (debug rules Swiss) ──────────────────── */
.grid-debug {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 var(--gap);
  padding-inline: var(--margin-h);
  pointer-events: none;
  z-index: 9000;
}

.grid-debug > span {
  display: block;
  height: 100%;
  background: rgba(0, 0, 0, 0.025);
}

/* Cacher la grille sur mobile (non pertinent sur colonne unique) */
@media (max-width: 767px) {
  .grid-debug { display: none; }
}

/* ── 4. CONTENEUR & GRILLE CSS ──────────────────────────────── */
.wrap {
  width: 100%;
  padding-inline: var(--margin-h);
}

/* Desktop : grille 12 colonnes réelle */
@media (min-width: 1024px) {
  .wrap {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--gap);
    align-items: start;
  }
}

/* ── 5. TYPOGRAPHIE UTILITAIRES ─────────────────────────────── */
.section-label {
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: var(--space-l);
}

.overline {
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── 6. EN-TÊTE (inline dans la grille, pas de topbar) ─────── */
.site-header {
  padding-block: var(--space-l) var(--space-m);
  border-bottom: 1px solid var(--c-rule);
  margin-bottom: var(--space-xl);
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-m);
}

@media (min-width: 1024px) {
  .header-inner {
    grid-column: 1 / -1;
  }
}

/* Logo monogramme */
.logo {
  text-decoration: none;
  flex-shrink: 0;
}

.logo-monogram {
  font-size: 1.375rem;
  font-weight: var(--fw-black);
  letter-spacing: -0.03em;
  line-height: 1;
}

.logo-name {
  display: block;
  font-size: var(--fs-label);
  font-weight: var(--fw-regular);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  color: var(--c-muted);
}

/* Navigation */
.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-m);
}

.nav-list a {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--c-muted);
  transition: color var(--t);
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--c-text);
}

/* ── 7. HERO — H1 sur 8 cols, 4 cols vides ──────────────────── */
.hero {
  margin-bottom: var(--space-2xl);
}

.hero-inner {
  width: 100%;
}

@media (min-width: 1024px) {
  .hero-inner {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--gap);
  }
}

.hero-title {
  font-size: var(--fs-hero);
  font-weight: var(--fw-black);
  letter-spacing: -0.04em;
  line-height: var(--lh-hero);
  margin-bottom: var(--space-l);
}

@media (min-width: 1024px) {
  .hero-title {
    grid-column: 1 / 9; /* 8 colonnes — 4 vides à droite */
  }
}

.hero-sub {
  font-size: var(--fs-h3);
  font-weight: var(--fw-light);
  color: var(--c-muted);
  max-width: 55ch;
  line-height: 1.5;
}

@media (min-width: 1024px) {
  .hero-sub {
    grid-column: 1 / 7;
  }
}

/* Séparateur horizontal pleine largeur */
.hero-rule {
  border: none;
  border-top: 1px solid var(--c-rule);
  margin-top: var(--space-xl);
}

@media (min-width: 1024px) {
  .hero-rule {
    grid-column: 1 / -1;
  }
}

/* ── 8. SECTIONS — espacement et mise en page grille ────────── */
.section {
  padding-block: var(--space-xl);
  border-top: 1px solid var(--c-subtle);
}

/* Label + contenu sur desktop */
@media (min-width: 1024px) {
  .section > .wrap > .section-label {
    grid-column: 1 / 4;
    margin-bottom: 0;
    padding-top: 0.25rem;
  }

  .section-body {
    grid-column: 4 / -1;
  }
}

/* Mobile : label au-dessus */
@media (max-width: 1023px) {
  .section-body { margin-top: var(--space-m); }
}

/* ── 9. PROJETS ─────────────────────────────────────────────── */
.projets-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.projet-item {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: baseline;
  gap: var(--space-s);
  padding-block: var(--space-m);
  border-top: 1px solid var(--c-subtle);
  text-decoration: none;
  transition: background var(--t);
}

.projet-item:last-child {
  border-bottom: 1px solid var(--c-subtle);
}

.projet-item:hover .projet-title,
.projet-item:focus-visible .projet-title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.projet-num {
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  letter-spacing: 0.1em;
  color: var(--c-muted);
  align-self: start;
  padding-top: 0.15em;
}

.projet-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.projet-title {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}

.projet-desc {
  font-size: var(--fs-small);
  color: var(--c-muted);
  max-width: 60ch;
}

.projet-year {
  font-size: var(--fs-label);
  font-weight: var(--fw-regular);
  color: var(--c-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
  align-self: start;
  padding-top: 0.15em;
}

@media (max-width: 599px) {
  .projet-item {
    grid-template-columns: 2.5rem 1fr;
  }
  .projet-year { display: none; }
}

/* ── 10. MÉTHODE ────────────────────────────────────────────── */
.methode-intro {
  font-size: var(--fs-h3);
  font-weight: var(--fw-light);
  line-height: 1.55;
  max-width: 55ch;
  margin-bottom: var(--space-l);
}

.methode-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.methode-item {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: var(--space-s);
  padding-block: var(--space-m);
  border-top: 1px solid var(--c-subtle);
}

.methode-item:last-child {
  border-bottom: 1px solid var(--c-subtle);
}

.methode-dash {
  font-size: var(--fs-h3);
  font-weight: var(--fw-light);
  color: var(--c-muted);
  padding-top: 0.1em;
}

.methode-item strong {
  display: block;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  letter-spacing: 0.01em;
  margin-bottom: var(--space-xs);
}

.methode-item p {
  font-size: var(--fs-small);
  color: var(--c-muted);
  max-width: 55ch;
}

/* ── 11. ATELIER ────────────────────────────────────────────── */
.atelier-content {
  display: grid;
  gap: var(--space-l);
}

@media (min-width: 768px) {
  .atelier-content {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
}

.atelier-text p + p {
  margin-top: var(--space-m);
}

.atelier-text p {
  font-size: var(--fs-body);
  color: var(--c-muted);
  max-width: 45ch;
}

.atelier-placeholder svg {
  width: 100%;
  border: 1px solid var(--c-subtle);
}

/* ── 12. CONTACT ────────────────────────────────────────────── */
.contact-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

@media (min-width: 768px) {
  .contact-content {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-2xl);
  }
}

.contact-address p + p {
  margin-top: var(--space-s);
}

.contact-address a {
  font-weight: var(--fw-medium);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  transition: opacity var(--t);
}

.contact-address a:hover {
  opacity: 0.6;
}

.contact-note {
  font-size: var(--fs-small);
  color: var(--c-muted);
  max-width: 35ch;
  font-style: italic;
}

/* ── 13. FOOTER — index des sections ────────────────────────── */
.site-footer {
  padding-block: var(--space-l);
  margin-top: var(--space-xl);
  border-top: 1px solid var(--c-rule);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

@media (min-width: 1024px) {
  .footer-inner { grid-column: 1 / -1; }
}

/* Index des sections (façon Swiss editorial) */
.footer-index-title {
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: var(--space-m);
}

.index-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.index-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-s);
}

.index-num {
  font-size: var(--fs-label);
  font-weight: var(--fw-regular);
  color: var(--c-muted);
  min-width: 1.5rem;
  letter-spacing: 0.05em;
}

.index-item a {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--t);
}

.index-item a:hover {
  color: var(--c-muted);
}

.footer-brand {
  font-size: var(--fs-label);
  color: var(--c-muted);
  text-align: right;
}

.footer-brand a {
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: color var(--t);
}

.footer-brand a:hover {
  color: var(--c-text);
}

/* ── 14. FOCUS VISIBLE (accessibilité WCAG AA) ──────────────── */
:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 3px;
}

/* ── 15. UTILITAIRES ────────────────────────────────────────── */
.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;
}

/* Animation-ready : slot vide pour AnimationDesigner */
/* Les transitions hover ci-dessus utilisent déjà var(--t) */
/* Ajouter ici keyframes ou classes .anim-* sans toucher le HTML */
