/* ---------------------------------------------------------------
   Palette : gris de viewport 3D + couleurs d'axes d'un gizmo.
   X rouge = jeux et rendu, Y vert = 3D, Z bleu = web et logiciel.
---------------------------------------------------------------- */
:root {
  --bg: #2a2c31;
  --bg-deep: #222428;
  --panel: #33363c;
  --line: #44474e;
  --ink: #ecebe4;
  --muted: #a3a6ad;
  --axis-x: #e5484d;
  --axis-y: #6bbf59;
  --axis-z: #6f8ff0;

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --text: "Instrument Sans", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.333rem;
  --step-2: 2rem;
  --step-3: 3rem;
  --step-4: clamp(3.5rem, 9vw, 7.5rem);

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 68ch;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0) / 1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.005em;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

sup {
  font-size: 0.65em;
  line-height: 0;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--bg);
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

/* ---------- Liens et boutons ---------- */
.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.25em;
  text-decoration-thickness: 2px;
}

.link:hover {
  text-decoration-color: var(--ink);
}

.button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  background: var(--ink);
  color: var(--bg-deep);
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
}

.button:hover {
  background: #fff;
}

/* ---------- En-tête ---------- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem var(--gutter);
}

.brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--step-1);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: clamp(0.9rem, 3vw, 2rem);
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 0 var(--gutter);
  padding: 0 var(--gutter) clamp(3rem, 8vw, 6rem);
  align-items: start;
}

.viewport {
  position: relative;
  margin: 0;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

#hero-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 78vh;
  image-rendering: pixelated;
  cursor: crosshair;
}

.viewport-fallback {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.no-webgl .viewport-fallback {
  display: grid;
}

.hero-text {
  display: grid;
  gap: 1rem;
  padding-bottom: 0;
  max-width: 34rem;
}

.hero h1 {
  font-size: var(--step-4);
  line-height: 0.85;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.4;
}

.hero-text p:not(.lede) {
  color: var(--muted);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
  border-top: 1px solid var(--line);
}

.section > h2,
.section-head h2 {
  font-size: var(--step-3);
  text-transform: uppercase;
}

.section > h2 {
  margin-bottom: 2.5rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 2rem;
  margin-bottom: 2.5rem;
}

.count {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--step--1);
}

/* Les couleurs d'axes, partagées par filtres, compétences et projets */
.f-game,
[data-domain="game"] {
  --axis: var(--axis-x);
}

.f-3d,
[data-domain="3d"] {
  --axis: var(--axis-y);
}

.f-web,
[data-domain="web"] {
  --axis: var(--axis-z);
}

/* ---------- Filtres ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filters button {
  --axis: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font: 500 var(--step--1) var(--text);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.filters button.f-game {
  --axis: var(--axis-x);
}

.filters button.f-3d {
  --axis: var(--axis-y);
}

.filters button.f-web {
  --axis: var(--axis-z);
}

.filters button::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  background: var(--axis);
}

.filters button[data-filter="all"]::before {
  display: none;
}

.filters button:hover {
  color: var(--ink);
}

.filters button[aria-pressed="true"] {
  border-color: var(--axis);
  color: var(--ink);
}

/* ---------- Projets ---------- */
.project-list {
  display: grid;
}

.project {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 0.5rem var(--gutter);
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}

.project:first-child {
  border-top: 0;
  padding-top: 0;
}

.project-meta {
  display: grid;
  align-content: start;
  gap: 0.15rem;
  color: var(--muted);
  font-size: var(--step--1);
}

.project-meta .domain {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.project-meta .domain::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  background: var(--axis);
}

.project-body {
  display: grid;
  gap: 0.8rem;
  max-width: var(--measure);
}

.project h3 {
  font-size: var(--step-2);
  text-transform: uppercase;
}

.project--featured h3 {
  font-size: clamp(2.25rem, 4.5vw, var(--step-3));
}

.project--featured .summary {
  font-size: var(--step-1);
  line-height: 1.4;
}

.project--compact .summary {
  color: var(--muted);
}

.details {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  display: grid;
  gap: 0.35rem;
}

.details li::marker {
  color: var(--axis);
}

.tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.tech li {
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* Si une capture ou une vidéo est fournie */
.project-media {
  grid-column: 1 / -1;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-deep);
}

.project-media img,
.project-media video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ---------- Parcours ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  max-width: 60rem;
}

.timeline li {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 0.5rem var(--gutter);
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

.timeline li:first-child {
  border-top: 0;
  padding-top: 0;
}

.when {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-1);
  color: var(--muted);
}

.timeline h3 {
  font-size: var(--step-1);
  font-family: var(--text);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

.timeline p {
  color: var(--muted);
  max-width: var(--measure);
}

/* ---------- Contact ---------- */
.contact > p {
  max-width: var(--measure);
  font-size: var(--step-1);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.site-footer {
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--step--1);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-text {
    order: -1;
    padding: 1.5rem 0 2rem;
  }

  #hero-canvas {
    aspect-ratio: 16 / 10;
  }

}

@media (max-width: 700px) {
  .project,
  .timeline li {
    grid-template-columns: 1fr;
  }

  .project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
  }

  .project-meta .domain {
    margin-bottom: 0;
  }

  .count {
    margin-left: 0;
    width: 100%;
  }
}
