/* =========================================================
   Portfolio Alexis Ravel — feuille de style principale
   ---------------------------------------------------------
   Parti pris : design éditorial, angles droits, filets fins,
   ombres dures. Pas de cartes arrondies ni d'effets flottants.
   Sommaire :
   1. Variables (couleurs, typo, espacements)
   2. Reset & base
   3. Composants génériques (boutons, tags)
   4. Header / navigation
   5. Page d'accueil
   6. Pages case study
   7. Footer
   8. Animations
   9. Responsive
   ========================================================= */

/* ---------- 1. Variables ---------- */
:root {
  /* Couleurs — papier & encre */
  --bg: #f7f4ee;
  --bg-alt: #efeada;
  --ink: #191713;
  --ink-soft: #45403a;
  --muted: #7a7263;
  --line: #191713;          /* les filets sont à l'encre, pas gris pâle */
  --line-soft: #d8d1c0;
  --accent: #b4471f;        /* terracotta profond */
  --accent-ink: #8e3717;
  --green: #2f5d54;

  /* Typographie */
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;

  /* Rythme */
  --maxw: 1080px;
  --maxw-text: 46rem;
  --section-gap: clamp(4rem, 8vw, 7rem);
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 540;
  line-height: 1.12;
  margin: 0 0 1rem;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.45rem); }

p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

ul { padding-left: 1.2rem; margin: 0 0 1.1rem; }
li { margin-bottom: 0.45rem; }

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

strong { font-weight: 640; color: var(--ink); }

::selection { background: var(--ink); color: var(--bg); }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

section { padding-top: var(--section-gap); }
section:last-of-type { padding-bottom: var(--section-gap); }

/* Surtitre de section */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.3rem;
}
.eyebrow::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background: var(--line);
  margin-top: 0.8rem;
}

.lead {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  color: var(--ink-soft);
  max-width: var(--maxw-text);
}

/* ---------- 3. Composants génériques ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.5rem;
  border: 1.5px solid var(--ink);
  font-weight: 620;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn-ghost {
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover {
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--accent);
}

/* Tags : étiquettes carrées, petites capitales */
.tag {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--line-soft);
  background: transparent;
}
.tag-accent { color: var(--accent-ink); border-color: var(--accent-ink); }
.tag-green  { color: var(--green); border-color: var(--green); }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* ---------- 4. Header / navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.05rem clamp(1.25rem, 4vw, 2.5rem);
  max-width: var(--maxw);
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.nav-logo .dot { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 560;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 5px; }
.nav-links .nav-cta {
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--ink);
  color: var(--ink);
}
.nav-links .nav-cta:hover {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--ink);
  background: transparent;
  cursor: pointer;
  padding: 0 10px;
}
.nav-toggle span {
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 5. Page d'accueil ---------- */

/* Hero */
.hero {
  padding-top: clamp(3.5rem, 8vw, 6rem);
}
.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.8rem;
}
.hero h1 {
  max-width: 18ch;
  margin-bottom: 1.6rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero .lead { margin-bottom: 2.4rem; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 3rem;
}
.hero-footnote {
  font-size: 0.92rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
}
.hero-bg { display: none; }

/* Hero sombre interactif (accueil) : le curseur laisse une trace
   de regard — heatmap + scanpath — comme en eye-tracking. */
.hero-dark {
  position: relative;
  /* La carte de Cold War 2 — le terrain réel de mes heatmaps de stage —
     fortement assombrie pour garder le texte lisible. */
  background:
    linear-gradient(rgba(20, 18, 15, 0.82), rgba(20, 18, 15, 0.9)),
    #14120f url("../images/coldwar-carte.jpg") center / cover no-repeat;
  color: #f4efe7;
  padding-top: clamp(4rem, 9vw, 7rem);
  padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
  overflow: hidden;
  cursor: crosshair;
  border-bottom: 1.5px solid var(--line);
}
.hero-dark .container { position: relative; z-index: 2; pointer-events: none; }
.hero-dark .container a, .hero-dark .container .tag { pointer-events: auto; }
.hero-dark h1 { color: #faf6ee; }
.hero-dark h1 em { color: #e8815a; }
.hero-dark .lead { color: #c9c1b2; }
.hero-dark .tag { color: #c9c1b2; border-color: #4a453d; }
.hero-dark .tag-accent { color: #e8a184; border-color: #a2542f; }
.hero-dark .tag-green { color: #9dc4bb; border-color: #47776d; }
.hero-dark .hero-footnote { color: #8d8574; border-top-color: #3a352d; }
.hero-dark .btn-primary { background: #f4efe7; color: #14120f; border-color: #f4efe7; }
.hero-dark .btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 4px 4px 0 #f4efe7; }
.hero-dark .btn-ghost { color: #f4efe7; border-color: #f4efe7; }
.hero-dark .btn-ghost:hover { box-shadow: 4px 4px 0 var(--accent); }

#gaze-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* HUD façon oculomètre, en haut à droite du hero */
.gaze-hud {
  position: absolute;
  top: 1.1rem;
  right: clamp(1.25rem, 4vw, 2.5rem);
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8d8574;
  text-align: right;
  pointer-events: none;
}
.gaze-hud-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}
.gaze-hud .rec {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d64545;
  animation: rec-blink 1.6s steps(1) infinite;
}
@keyframes rec-blink { 50% { opacity: 0.15; } }

.gaze-hint {
  margin: 0.5rem 0 0;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: none;
  color: #6b6455;
  line-height: 1.6;
}
.gaze-credit {
  margin: 0.4rem 0 0;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: none;
  color: #55503f;
}

/* Figures dans les case studies */
.case-figure {
  margin: 1.8rem 0;
}
.case-figure img {
  width: 100%;
  border: 1px solid var(--line);
}
.case-figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.65rem;
  line-height: 1.5;
}
.figure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin: 1.8rem 0;
}
.figure-grid .case-figure { margin: 0; }

/* À propos */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.about-aside {
  border: 1.5px solid var(--ink);
  padding: 1.6rem 1.6rem 0.6rem;
}
.about-aside h3 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 680;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.about-aside ul { list-style: none; padding: 0; margin: 0 0 1.4rem; }
.about-aside li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.about-aside li:last-child { border-bottom: none; }
.about-aside li strong { display: block; font-size: 0.98rem; }

/* Projets — rangées éditoriales, pas de cartes */
.projects-list {
  margin-top: 2.5rem;
  border-top: 1.5px solid var(--line);
}
.project-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: clamp(1.2rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 3vw, 2.1rem) 0.4rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease, padding-left 0.2s ease;
}
.project-card:hover {
  background: var(--bg-alt);
  padding-left: 1rem;
}
.project-num {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 640;
  color: var(--accent);
  min-width: 2.4ch;
}
.project-info .project-type {
  font-size: 0.75rem;
  font-weight: 660;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.4rem;
}
.project-info h3 { margin-bottom: 0.4rem; }
.project-info p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  margin-bottom: 0.9rem;
  max-width: 56ch;
}
.project-card.has-thumb {
  grid-template-columns: auto 1fr 200px auto;
}
.project-thumb {
  align-self: center;
  width: 200px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.project-thumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  filter: saturate(0.85);
  transition: transform 0.3s ease, filter 0.3s ease;
}
.project-card:hover .project-thumb img {
  transform: scale(1.05);
  filter: saturate(1);
}
.project-arrow {
  font-size: 1.4rem;
  color: var(--ink);
  transition: transform 0.2s ease, color 0.2s ease;
  align-self: center;
}
.project-card:hover .project-arrow {
  transform: translateX(6px);
  color: var(--accent);
}

/* Ce qui me différencie */
.diff-section {
  background: var(--ink);
  color: #efeae2;
  margin-top: var(--section-gap);
  padding: clamp(3rem, 7vw, 5rem) 0;
}
.diff-section .container { max-width: 60rem; }
.diff-section .eyebrow { color: #e8a184; }
.diff-section .eyebrow::after { background: #e8a184; }
.diff-section h2 { color: #fdfbf7; }
.diff-quote {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.65rem);
  line-height: 1.5;
  font-weight: 460;
  color: #f4efe7;
  border-left: 3px solid var(--accent);
  padding-left: 1.6rem;
  margin: 2.2rem 0;
}
.diff-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem 2rem;
  list-style: none;
  padding: 0;
  margin: 2.4rem 0 0;
}
.diff-list li {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  font-size: 0.98rem;
  color: #d8d1c5;
  margin: 0;
}
.diff-list li::before {
  content: "→";
  color: #e8a184;
  font-weight: 700;
  flex-shrink: 0;
}

/* Contact */
.contact-box {
  max-width: 44rem;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}

/* ---------- 6. Pages case study ---------- */
.case-hero {
  padding-top: clamp(3rem, 6vw, 4.5rem);
  border-bottom: 1.5px solid var(--line);
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
}
.case-hero .breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 2rem;
  color: var(--muted);
}
.case-hero .breadcrumb a { color: var(--muted); text-decoration: none; }
.case-hero .breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.case-hero h1 { max-width: 24ch; }
.case-hero .case-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--ink-soft);
  max-width: var(--maxw-text);
  margin-top: 1.2rem;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 2.8rem;
  border-top: 1px solid var(--line);
}
.case-meta > div {
  padding: 1.3rem 1.4rem 0 0;
}
.case-meta > div + div { border-left: 1px solid var(--line-soft); padding-left: 1.4rem; }
.case-meta div h4 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 680;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.case-meta div p { font-size: 0.93rem; margin: 0; color: var(--ink-soft); }

/* Corps de la case study */
.case-body {
  max-width: var(--maxw-text);
  margin: 0 auto;
  padding-top: clamp(3rem, 6vw, 4rem);
  padding-bottom: var(--section-gap);
}
.case-section { margin-bottom: clamp(2.6rem, 5vw, 3.6rem); }
.case-section:last-child { margin-bottom: 0; }
.case-section h2 {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  margin-bottom: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.case-section h2 .num {
  font-size: 0.82rem;
  font-family: var(--font-body);
  font-weight: 680;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.case-section h3 { font-size: 1.08rem; margin: 1.6rem 0 0.6rem; }

/* Encadrés */
.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  padding: 1.3rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}
.callout-green { border-left-color: var(--green); }

.case-quote {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding: 0.4rem 0 0.4rem 1.6rem;
  margin: 2rem 0;
}

/* Section limites — fond distinct, angles droits */
.limits {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 0.4rem 1.7rem 1.5rem;
}
.limits h2 { border-top: none; }
.limits ul { margin-bottom: 0; }

/* Liste de méthodes en 2 colonnes */
.method-cols {
  columns: 2;
  column-gap: 2.5rem;
}
.method-cols li { break-inside: avoid; }

/* Navigation projet précédent / suivant */
.case-nav {
  border-top: 1.5px solid var(--line);
  padding: 0 0 var(--section-gap);
}
.case-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.case-nav-card {
  padding: 1.8rem 1.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease;
}
.case-nav-card + .case-nav-card { border-left: 1px solid var(--line); }
.case-nav-card:hover { background: var(--bg-alt); }
.case-nav-card span {
  display: block;
  font-size: 0.78rem;
  font-weight: 660;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.case-nav-card strong { font-family: var(--font-display); font-size: 1.08rem; font-weight: 560; }
.case-nav-card.next { text-align: right; }

/* ---------- 7. Footer ---------- */
.site-footer {
  border-top: 1.5px solid var(--line);
  padding: 2rem 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-links { display: flex; gap: 1.6rem; }

/* ---------- 8. Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal[data-delay="1"] { transition-delay: 0.06s; }
.reveal[data-delay="2"] { transition-delay: 0.12s; }
.reveal[data-delay="3"] { transition-delay: 0.18s; }
.reveal[data-delay="4"] { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- 9. Responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .diff-list { grid-template-columns: 1fr; }
  .case-meta { grid-template-columns: 1fr 1fr; }
  .case-meta > div { padding-left: 0 !important; border-left: none !important; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1.5px solid var(--line);
    padding: 0.6rem 1.4rem 1.2rem;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 0.8rem 0;
    font-size: 1.05rem;
  }
  .nav-links .nav-cta {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.55rem 1.2rem;
  }

  .figure-grid { grid-template-columns: 1fr; }
  .project-card, .project-card.has-thumb { grid-template-columns: 1fr; gap: 0.6rem; }
  .project-thumb { width: 100%; order: -1; }
  .project-card:hover { padding-left: 0.4rem; }
  .project-num { display: none; }
  .project-arrow { display: none; }
  .method-cols { columns: 1; }
  .case-nav-grid { grid-template-columns: 1fr; }
  .case-nav-card + .case-nav-card { border-left: none; border-top: 1px solid var(--line); }
  .case-nav-card.next { text-align: left; }
}
