/* ============================================================================
   Portfolio v1 — feuille de style
   ----------------------------------------------------------------------------
   Organisation du fichier, dans l'ordre :
     1. Variables de couleur   — thème sombre par défaut, clair en surcharge
     2. Base                   — remise à zéro, typographie, sections
     3. Header                 — logo, navigation, bouton de thème
     4. Hero                   — grand titre en pleine hauteur d'écran
     5. Cartes de projets      — la grille et ses cartes
     6. Section à propos
     7. Formulaire de contact
     8. Responsive mobile      — le gros du travail est ici
     9. Transitions entre pages
    10. Archive                — blocs gris et bandeau, propres à cette copie

   Deux thèmes : le sombre est l'état de base, le clair vient le surcharger
   via :root[data-theme="light"]. Toutes les couleurs passent par des
   variables, donc un thème ne redéfinit que les variables, jamais les règles.

   Polices : Playfair Display pour les titres, DM Sans pour le texte.
   ============================================================================ */

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

/* variables de couleur — thème sombre par défaut, le clair est plus bas
   dans le bloc [data-theme="light"] */
:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --card: #161616;
  --card-h: #1d1d1d;
  --border: rgba(255, 255, 255, 0.08);
  --border-h: rgba(255, 255, 255, 0.18);
  --text: #f0ede6;
  --muted: #a8a8a8;
  --accent: #2da9dc;
  --accent2: #25e445;
  --gold: #c8a96e;
  --purple: #a78bfa;
  --font-d: "Playfair Display", Georgia, serif;
  --font-b: "DM Sans", system-ui, sans-serif;
  --radius: 8px;
}

:root[data-theme="light"] {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --card: #ffffff;
  --card-h: #f7f7f9;
  --border: #e3e3e8;
  --border-h: #c9c9d3;
  --text: #14141a;
  --muted: #52525b;
  --accent: #4f46e5;
  --accent2: #16a34a;
  --gold: #b45309;
  --purple: #7c3aed;
}

html {
  scroll-behavior: smooth;
  /* décale les ancres pour qu'elles ne passent pas sous le header fixe */
  scroll-padding-top: 7rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-weight: 300;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

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

a {
  color: inherit;
}

section {
  padding: 6rem 4rem;
}

.s-label {
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.s-title {
  margin-bottom: 3.5rem;
  font-family: var(--font-d);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.2;
}

.s-title em,
.contact-big em {
  color: var(--gold);
  font-style: italic;
}

/* ===== header : logo, nav, bouton thème ===== */
.site-header {
  position: fixed;
  z-index: 100;
  top: 16px;
  left: 50%;
  width: min(1120px, calc(100% - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1.5rem;
  padding: 0.65rem 0.75rem 0.65rem 1rem;
  background: rgba(10, 10, 10, 0.84);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

:root[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--text);
  font-family: var(--font-d);
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  justify-self: start;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-h);
  border-radius: 6px;
  object-fit: cover;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-self: center;
}

.site-nav a {
  min-height: 40px;
  padding: 0.75rem 0.9rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  outline: none;
  transform: translateY(-1px);
}

:root[data-theme="light"] .site-nav a:hover,
:root[data-theme="light"] .site-nav a:focus-visible {
  color: var(--text);
  background: rgba(79, 70, 229, 0.09);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-h);
  border-radius: 6px;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: currentColor;
}

/* ===== hero : grand titre en pleine hauteur d'écran ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 4rem 6rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 65% 35%, rgba(45, 169, 220, 0.07), transparent 65%),
    radial-gradient(ellipse 40% 40% at 15% 80%, rgba(37, 228, 69, 0.04), transparent 60%);
  pointer-events: none;
}

:root[data-theme="light"] .hero::before {
  background:
    radial-gradient(ellipse 70% 55% at 65% 35%, rgba(79, 70, 229, 0.06), transparent 65%),
    radial-gradient(ellipse 40% 40% at 15% 80%, rgba(22, 163, 74, 0.04), transparent 60%);
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 8rem;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent 10%, var(--border) 40%, transparent 90%);
}

.hero-eyebrow,
.hero-title,
.hero-desc,
.hero-cta {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  margin-bottom: 1.5rem;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  animation: fade-up 0.8s ease both;
}

.hero-title {
  margin-bottom: 2rem;
  font-family: var(--font-d);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 400;
  line-height: 1.05;
  animation: fade-up 0.8s 0.1s ease both;
}

.hero-title em {
  color: var(--gold);
  font-style: italic;
}

.hero-desc {
  max-width: 460px;
  margin-bottom: 3rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.85;
  animation: fade-up 0.8s 0.2s ease both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  padding: 0.9rem 2rem;
  color: var(--text);
  border: 1px solid var(--border-h);
  border-radius: 4px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
  animation: fade-up 0.8s 0.3s ease both;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--accent);
  outline: none;
  transform: translateY(-2px);
}

:root[data-theme="light"] .hero-cta:hover,
:root[data-theme="light"] .hero-cta:focus-visible {
  background: rgba(79, 70, 229, 0.07);
  border-color: var(--accent);
}

.arrow-icon,
.arrow-sm {
  display: inline-block;
  transition: transform 0.25s ease;
}

.arrow-icon::after,
.arrow-sm::after {
  content: ">";
  display: inline-block;
  font-weight: 400;
}

.arrow-icon {
  font-size: 1.1em;
}

.arrow-sm {
  font-size: 1em;
}

.hero-cta:hover .arrow-icon,
.proj-link:hover .arrow-sm,
.submit-btn:hover .arrow-sm {
  transform: translateX(3px);
}

.scroll-ind {
  position: absolute;
  right: 4rem;
  bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--muted));
  animation: scroll-pulse 2s ease-in-out infinite;
}

/* ===== cartes de projets ===== */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.proj-card,
.proj-more-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  padding: 0;
  color: var(--text);
  background: linear-gradient(180deg, #1d1d1d, var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.24);
  transition: border-color 0.28s ease, background 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.proj-card::before,
.proj-more-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 2;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), var(--gold));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.32s ease;
}

.proj-card:hover,
.proj-more-card:hover {
  border-color: var(--border-h);
  background: linear-gradient(180deg, #222222, #181818);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  transform: translateY(-4px);
}

:root[data-theme="light"] .proj-card,
:root[data-theme="light"] .proj-more-card {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .proj-card:hover,
:root[data-theme="light"] .proj-more-card:hover {
  background: #fafaf9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.proj-card:hover::before,
.proj-more-card:hover::before {
  transform: scaleY(1);
}

.proj-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: black;
  border-bottom: 0px solid var(--border);
}

:root[data-theme="light"] .proj-thumb {
  background: #d1d5db;
}

:root[data-theme="light"] .proj-thumb.is-icon {
  background: #e5e5e5;
  border: 1px solid #d4d4d4;
}

.proj-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.28s ease, transform 0.36s ease, filter 0.36s ease;
}

.proj-thumb.is-icon img {
  object-fit: contain;
  padding: 24px;
}

.proj-card:hover .proj-thumb img {
  opacity: 1;
  filter: saturate(1.08);
  transform: scale(1.04);
}

.proj-meta,
.proj-card .proj-name,
.proj-card .proj-desc,
.proj-card .proj-link,
.proj-card .proj-source-link,
.proj-more-card>* {
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

.proj-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.proj-year {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

:root[data-theme="light"] .proj-year {
  color: #52525b;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  padding: 0.22rem 0.55rem;
  color: var(--accent);
  background: rgba(45, 169, 220, 0.1);
  border: 1px solid rgba(45, 169, 220, 0.2);
  border-radius: 3px;
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag.green {
  color: var(--accent2);
  background: rgba(37, 228, 69, 0.08);
  border-color: rgba(37, 228, 69, 0.2);
}

.tag.purple {
  color: var(--purple);
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.28);
}

.tag.gold {
  color: var(--gold);
  background: rgba(200, 169, 110, 0.1);
  border-color: rgba(200, 169, 110, 0.2);
}

:root[data-theme="light"] .tag {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.22);
}

:root[data-theme="light"] .tag.green {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.24);
}

:root[data-theme="light"] .tag.purple {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.24);
}

:root[data-theme="light"] .tag.gold {
  background: rgba(180, 83, 9, 0.1);
  border-color: rgba(180, 83, 9, 0.24);
}

.proj-name {
  margin-top: 1rem;
  font-family: var(--font-d);
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.2;
}

.proj-desc {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

:root[data-theme="light"] .proj-desc {
  color: #3f3f46;
}

.proj-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: calc(100% - 3rem);
  width: max-content;
  margin-top: auto;
  margin-bottom: 1.5rem;
  padding-top: 1.4rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-decoration: none;
  text-transform: uppercase;
}

.proj-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.38);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.proj-card:hover .proj-link::after,
.proj-more-card:hover .proj-link::after {
  transform: scaleX(1);
}

.proj-link:has(+ .proj-source-link) {
  margin-bottom: 0.5rem;
}

.proj-source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.proj-source-link:hover,
.proj-source-link:focus-visible {
  color: var(--accent);
}

.proj-more-card {
  justify-content: flex-start;
  padding: 2rem 0 0;
}

.proj-more-label {
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ===== section à propos ===== */
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}

.about-text p {
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.9;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  align-self: start;
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat {
  padding: 2rem 1.5rem;
  background: var(--card);
}

.stat-cat {
  margin-bottom: 0.6rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-list {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

:root[data-theme="light"] .stat-list {
  color: #52525b;
}

/* ===== formulaire de contact ===== */
.contact-sec {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.contact-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 3rem;
}

.contact-big {
  font-family: var(--font-d);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 400;
  line-height: 1.1;
}

.contact-right {
  width: 100%;
  max-width: 520px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.9rem 1.2rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-b);
  font-size: 0.95rem;
  line-height: 1.6;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

:root[data-theme="light"] .form-group input,
:root[data-theme="light"] .form-group textarea {
  background: #ffffff;
  border: 1px solid var(--border);
}

:root[data-theme="light"] .form-group input:focus,
:root[data-theme="light"] .form-group textarea:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-group input:focus,
.form-group textarea:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 169, 220, 0.1);
  outline: none;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 2rem;
  color: var(--text);
  background: rgba(45, 169, 220, 0.08);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-b);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.submit-btn:hover,
.submit-btn:focus-visible {
  background: rgba(45, 169, 220, 0.15);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(45, 169, 220, 0.2);
  outline: none;
  transform: translateY(-2px);
}

:root[data-theme="light"] .submit-btn {
  background: rgba(79, 70, 229, 0.08);
  border-color: var(--accent);
}

:root[data-theme="light"] .submit-btn:hover,
:root[data-theme="light"] .submit-btn:focus-visible {
  background: rgba(79, 70, 229, 0.15);
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.15);
}

.submit-btn:active {
  transform: translateY(0);
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 2rem 4rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
}

:root[data-theme="light"] footer {
  color: #52525b;
}

.projects-page {
  padding-top: 10rem;
}

.projects-container {
  padding: 0 4rem;
}

.project-category {
  margin-bottom: 5rem;
}

.category-title {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-d);
  font-size: 1.8rem;
  font-weight: 400;
}

.category-note {
  max-width: 60ch;
  margin: -0.75rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 4rem;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

@keyframes scroll-pulse {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {

  .proj-card,
  .proj-more-card,
  .about-inner,
  .contact-inner {
    animation: fade-up 0.7s ease both;
  }
}

@media (max-width: 900px) {
  .about-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* ===== responsive mobile — le gros du travail est ici ===== */
@media (max-width: 768px) {
  .site-header {
    top: 10px;
    width: calc(100% - 20px);
    /* la marque prend la colonne elastique et reste a gauche ; le bouton
       theme et le menu se rangent a droite, comme sur le bureau */
    grid-template-columns: 1fr auto auto;
    /* l'ecart de 1.5rem du bureau mangeait la place du nom */
    gap: 0.5rem;
    padding-right: 0.5rem;
    padding-left: 0.75rem;
  }

  /* le nom doit tenir en entier : on reduit la typo et le logo plutot que
     de couper avec des points de suspension */
  .brand {
    font-size: 0.8rem;
    gap: 0.45rem;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
  }

  .brand span {
    white-space: nowrap;
  }

  .menu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    order: 2;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    /* le menu s'aligne sous le bouton burger, a droite. Sans justify-self,
       le « center » de la version bureau s'appliquait encore et le panneau
       flottait au milieu de la barre. */
    right: 0;
    left: auto;
    justify-self: end;
    min-width: 190px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
    background: rgba(10, 10, 10, 0.97);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  }

  :root[data-theme="light"] .site-nav {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
  }

  .hero,
  section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 4rem;
  }

  .scroll-ind {
    display: none;
  }

  .proj-grid {
    grid-template-columns: 1fr;
  }

  .contact-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-right {
    width: 100%;
    max-width: 100%;
  }

  footer {
    flex-direction: column;
    text-align: center;
  }

  .projects-page {
    padding-top: 7rem;
  }

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

  .projects-container {
    padding: 0 1.5rem;
  }

  /* .theme-toggle n'a plus d'ordre force : avec order:-1 il occupait la
     colonne 1fr et repoussait la marque et le menu tout a droite. */
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 3rem;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-h);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
  justify-self: end;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--accent);
  outline: none;
  transform: translateY(-1px);
}

:root[data-theme="light"] .theme-toggle:hover,
:root[data-theme="light"] .theme-toggle:focus-visible {
  background: rgba(79, 70, 229, 0.08);
  border-color: var(--accent);
}

.theme-toggle svg {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun-icon {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg) scale(0.8);
}

:root[data-theme="light"] .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

:root[data-theme="light"] .moon-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.8);
}

/* transitions custom entre les pages (voir script.js pour la partie JS) */
@supports (view-transition-name: none) {
  /* Animation par défaut du root */
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 350ms;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Fade out de l'ancienne page */
  ::view-transition-old(root) {
    animation-name: fade-out-slide;
  }

  /* Fade in + slide de la nouvelle page */
  ::view-transition-new(root) {
    animation-name: fade-in-slide;
  }
}

@keyframes fade-out-slide {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

@keyframes fade-in-slide {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fallback pour navigateurs sans View Transitions API */
@supports not (view-transition-name: none) {
  body {
    transition: opacity 0.3s ease;
  }
}

/* tres petits telephones (iPhone SE et assimiles) : le nom complet ne tient
   plus a 0.8rem, le bouton menu venait mordre dessus */
@media (max-width: 360px) {
  .site-header {
    gap: 0.35rem;
  }

  .brand {
    font-size: 0.7rem;
    gap: 0.35rem;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }
}


/* ============================================================
   Archive : contenus de demonstration
   Les vignettes n'ont plus d'image, ce sont des blocs gris qui
   reprennent exactement la boite de .proj-thumb (16/10).
   ============================================================ */

.proj-thumb.is-placeholder {
  background: #4a4a4a;
}

:root[data-theme="light"] .proj-thumb.is-placeholder {
  background: #d1d5db;
}

.archive-note {
  position: fixed;
  z-index: 200;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0.7rem 1.2rem;
  background: rgba(10, 10, 10, 0.92);
  color: #f0ede6;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
  backdrop-filter: blur(10px);
}

:root[data-theme="light"] .archive-note {
  background: rgba(255, 255, 255, 0.94);
  color: #14141a;
  border-top-color: #e3e3e8;
}

/* la barre d'archive ne doit pas masquer la fin de page */
body {
  padding-bottom: 4.5rem;
}

/* Focus clavier : un contour visible sur tout ce qu'on atteint avec Tab.
   :focus-visible ne s'affiche pas au clic souris, seulement au clavier. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
