/* Polices */

@font-face {
  font-family: 'CabinetGrotesk-Thin';
  src: url('fonts/CabinetGrotesk-Thin.woff2') format('woff2'),
       url('fonts/CabinetGrotesk-Thin.woff') format('woff');
  font-display: swap;
}

@font-face {
  font-family: 'CabinetGrotesk-Regular';
  src: url('fonts/CabinetGrotesk-Regular.woff2') format('woff2'),
       url('fonts/CabinetGrotesk-Regular.woff') format('woff');
  font-display: swap;
}

@font-face {
  font-family: 'CabinetGrotesk-Extrabold';
  src: url('fonts/CabinetGrotesk-Extrabold.woff2') format('woff2'),
       url('fonts/CabinetGrotesk-Extrabold.woff') format('woff');
  font-display: swap;
}

/* Variables */

:root {
  --bg: #0a0a0a;
  --fg: #f2f2f2;
  --muted: #9a9a9a;
  --accent: #25c897;
  --border: rgba(255, 255, 255, 0.15);
  --font-display: 'CabinetGrotesk-Extrabold';
  --font-regular: 'CabinetGrotesk-Regular';
  --font-thin: 'CabinetGrotesk-Thin';
}

/* Base */

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  margin: 0;
  padding: 0 6%;
  font-family: var(--font-thin);
}

a {
  color: var(--fg);
  text-decoration: none;
}

h1, h2 {
  font-family: var(--font-display);
  margin: 0 0 0.3em;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

p {
  line-height: 1.5;
}

/* Navigation */

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background-color: var(--bg);
  z-index: 10;
}

.logo {
  font-family: var(--font-regular);
  font-size: 1.3rem;
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-regular);
}

nav a:hover {
  color: var(--accent);
}

/* Hero */

.hero {
  padding: 5rem 0 3rem;
  max-width: 700px;
}

.hero p {
  color: var(--fg);
  font-family: var(--font-regular);
  font-size: 1.3rem;
}

/* Filtres */

.filtres {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 2.5rem;
}

.filtre {
  background: none;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.5rem 1.2rem;
  font-family: var(--font-regular);
  font-size: 0.95rem;
  cursor: pointer;
}

.filtre:hover {
  border-color: var(--accent);
}

.filtre.actif {
  background-color: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Grille de projets */

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 480px));
  gap: 2.5rem;
  padding-bottom: 4rem;
}

.projet {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.projet > p,
.projet details p {
  font-family: var(--font-regular);
  font-size: 1.05rem;
  line-height: 1.6;
}

.carrousel {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-bottom: 1rem;
  border-radius: 10px;
  height: min(45vh, 320px);
}

.carrousel img,
.carrousel video {
  flex: 0 0 100%;
  height: 100%;
  width: 100%;
  object-fit: cover;
  scroll-snap-align: start;
  border-radius: 10px;
}

.carrousel img {
  cursor: zoom-in;
}

.carrousel img {
  cursor: zoom-in;
}

.carrousel-wrapper {
  position: relative;
}

.fleche {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: var(--fg);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
}

.fleche:hover {
  background: var(--accent);
  color: var(--bg);
}

.fleche.gauche { left: 10px; }
.fleche.droite { right: 10px; }

dialog#lightbox {
  border: none;
  background: transparent;
  max-width: 90vw;
  max-height: 90vh;
  padding: 0;
}

dialog#lightbox::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

dialog#lightbox img,
dialog#lightbox video {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}

dialog#lightbox video {
  display: none;
}

dialog#lightbox button {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: 0.2s;
}

dialog#lightbox button:hover {
  background: var(--accent);
  color: var(--bg);
}

#lightbox-precedent { left: 5vw; }
#lightbox-suivant { right: 5vw; }

.projet .tags {
  color: var(--accent);
  font-family: var(--font-regular);
  font-size: 0.9rem;
  margin-top: -0.5em;
}

.projet details {
  margin-top: 0.8rem;
}

.projet summary {
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-regular);
}

.projet[hidden] {
  display: none;
}

/* Footer */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--muted);
  font-family: var(--font-regular);
}


/* Lien Repo GitHub */

.lien-repo {
  display: block;
  width: fit-content;
  margin-top: 1rem;
  margin-left: auto;
  font-family: var(--font-regular);
  font-size: 0.95rem;
  color: var(--fg);
}

.lien-repo:hover {
  color: var(--accent);
}

.contact {
  border-top: 1px solid var(--border);
  padding: 4rem 0;
  text-align: center;
}

.contact p {
  color: var(--fg);
  font-family: var(--font-regular);
  margin-bottom: 2rem;
}

.contact-liens {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-family: var(--font-regular);
  font-size: 1.2rem;
}

.contact-liens a:hover {
  color: var(--accent);
}

#retour-haut {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--fg);
  font-size: 1.4rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}

#retour-haut.visible {
  opacity: 1;
  pointer-events: auto;
}

#retour-haut:hover {
  background-color: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}