/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:          #0a0a0a;
  --bg-alt:      #100505;
  --surface:     #160808;
  --surface-2:   #1e0a0a;
  --border:      #2a0f0f;
  --red:         #cc0000;
  --red-bright:  #e60000;
  --red-dim:     #7a0000;
  --red-glow:    rgba(204, 0, 0, 0.15);
  --red-glow-sm: rgba(204, 0, 0, 0.08);
  --text:        #f0e8e8;
  --text-muted:  #a09090;
  --text-dim:    #6a5a5a;
  /* Polices accessibles : min 16px base, Inter lisible, JetBrains Mono pour le code */
  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --radius:      6px;
  --radius-lg:   12px;
  --nav-h:       64px;
  --transition:  0.2s ease;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  font-size: 16px; /* base accessible */
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--red);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--red-bright); }

ul { list-style: none; }

.mono { font-family: var(--font-mono); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; }
.alt-bg { background-color: var(--bg-alt); }

/* ===== SCROLL PROGRESS BAR ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--red-dim), var(--red), var(--red-bright));
  box-shadow: 0 0 10px rgba(204, 0, 0, 0.6);
  z-index: 200;
  pointer-events: none;
}

/* ===== NAV ===== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), box-shadow var(--transition);
}

#navbar.scrolled {
  background: rgba(10, 10, 10, 0.97);
  box-shadow: 0 1px 24px rgba(204, 0, 0, 0.12);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 2px;
  flex-shrink: 0;
  text-shadow: 0 0 16px rgba(204, 0, 0, 0.4);
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.8125rem; /* 13px */
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--red);
  border-radius: 1px;
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 60%;
  left: 20%;
}

.nav-links a.active::after {
  box-shadow: 0 0 8px rgba(204, 0, 0, 0.6);
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); background: var(--red-glow-sm); }
.nav-links a.active { color: var(--red); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  letter-spacing: 1px;
}

.lang-flag { font-size: 1rem; line-height: 1; }
.lang-label { font-size: 0.6875rem; letter-spacing: 1px; }

#lang-toggle:hover {
  color: var(--red);
  border-color: var(--red-dim);
  background: var(--red-glow-sm);
}

.nav-burger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem); /* 24–36px */
  font-weight: 700;
  color: var(--text);
  margin-bottom: 56px;
  position: relative;
  display: inline-block;
  line-height: 1.2;
}

.section-title::after {
  content: '';
  display: block;
  margin-top: 10px;
  width: 0;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(204, 0, 0, 0.5);
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
}

.section-title.visible::after { width: 48px; }

/* ===== HERO — photo pleine hauteur à droite ===== */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(204, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(204, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: grid-drift 20s linear infinite;
}

@keyframes grid-drift {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 60px 60px, 60px 60px; }
}

#hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(204, 0, 0, 0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: orb-float 8s ease-in-out infinite alternate;
  z-index: 0;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: 5%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(204, 0, 0, 0.05) 0%, transparent 70%);
  pointer-events: none;
  animation: orb-float 12s ease-in-out infinite alternate-reverse;
  z-index: 0;
}

@keyframes orb-float {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.15); }
}

.hero-content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 0 80px;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 42%;
  align-items: stretch;
  min-height: 100vh;
}

.hero-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 64px 80px 0;
}

.hero-pre {
  font-size: 0.8125rem;
  color: var(--red);
  letter-spacing: 3px;
  margin-bottom: 12px;
  text-transform: uppercase;
  opacity: 0;
  animation: hero-fade-in 0.6s ease 0.2s forwards;
}

#hero h1 {
  font-size: clamp(3rem, 8vw, 5.5rem); /* 48–88px, lisible partout */
  font-weight: 700;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--text);
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
  opacity: 0;
  animation: hero-fade-in 0.7s ease 0.4s forwards;
}

/* Glitch */
#hero h1::before,
#hero h1::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

#hero h1::before {
  color: var(--red);
  z-index: -1;
  animation: glitch-1 5s infinite linear alternate-reverse;
}

#hero h1::after {
  color: rgba(204, 0, 0, 0.25);
  z-index: -2;
  animation: glitch-2 4s infinite linear alternate;
}

@keyframes glitch-1 {
  0%, 90%   { clip-path: inset(0 0 0 0); transform: translate(0); }
  91%       { clip-path: inset(20% 0 60% 0); transform: translate(-3px, 1px); }
  92%       { clip-path: inset(50% 0 20% 0); transform: translate(3px, -1px); }
  93%       { clip-path: inset(70% 0 5%  0); transform: translate(-2px, 2px); }
  94%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
}

@keyframes glitch-2 {
  0%, 88%   { clip-path: inset(0 0 0 0); transform: translate(0); }
  89%       { clip-path: inset(30% 0 40% 0); transform: translate(2px, -1px); }
  90%       { clip-path: inset(60% 0 10% 0); transform: translate(-2px, 1px); }
  91%       { clip-path: inset(10% 0 70% 0); transform: translate(1px, 2px); }
  92%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
}

#hero h2 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem); /* 18–24px */
  font-weight: 400;
  margin-bottom: 14px;
  background: linear-gradient(90deg, var(--text-muted), var(--text), var(--red), var(--text), var(--text-muted));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 6s ease-in-out infinite, hero-fade-in 0.7s ease 0.6s both;
  line-height: 1.3;
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes hero-fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-sub {
  font-size: 0.8125rem; /* 13px */
  color: var(--red-dim);
  letter-spacing: 1px;
  margin-bottom: 40px;
  display: inline-block;
  border-right: 2px solid var(--red);
  white-space: nowrap;
  overflow: hidden;
  animation: blink-caret 0.8s step-end infinite, hero-fade-in 0.01s ease 0.9s both;
}

@keyframes blink-caret {
  0%, 100% { border-color: var(--red); }
  50%      { border-color: transparent; }
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  opacity: 0;
  animation: hero-fade-in 0.6s ease 1.1s forwards;
}

/* ===== PHOTO HERO PLEINE HAUTEUR ===== */
.hero-right {
  position: relative;
  overflow: hidden;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(15%) contrast(1.05);
  /* Fondu vers la gauche et vers le bas */
  mask-image:
    linear-gradient(to left, black 55%, transparent 100%),
    linear-gradient(to top, transparent 0%, black 18%);
  mask-composite: intersect;
  -webkit-mask-image:
    linear-gradient(to left, black 55%, transparent 100%),
    linear-gradient(to top, transparent 0%, black 18%);
  -webkit-mask-composite: source-in;
}

/* Overlay rouge subtil sur la photo */
.hero-right::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(204, 0, 0, 0.08) 0%,
    transparent 60%
  );
  pointer-events: none;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.875rem; /* 14px */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transition: left 0.5s ease;
}
.btn:hover::before { left: 100%; }

.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-primary:hover {
  background: var(--red-bright);
  border-color: var(--red-bright);
  color: #fff;
  box-shadow: 0 0 24px rgba(204, 0, 0, 0.5), 0 4px 12px rgba(204, 0, 0, 0.3);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-outline:hover {
  color: var(--text);
  border-color: var(--red-dim);
  background: var(--red-glow-sm);
  transform: translateY(-1px);
}

/* ===== HERO SCROLL INDICATOR ===== */
.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 0.6875rem; /* 11px */
  letter-spacing: 2px;
  text-transform: uppercase;
  z-index: 1;
  animation: scroll-pulse 2s ease-in-out infinite;
}

.scroll-arrow { font-size: 1rem; }

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
  50%      { opacity: 0.8; transform: translateX(-50%) translateY(5px); }
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.9375rem; /* 15px */
  line-height: 1.8;
}
.about-text p:last-of-type { margin-bottom: 24px; }

.about-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.meta-item svg { color: var(--red); flex-shrink: 0; }
.meta-item a { color: var(--text-muted); }
.meta-item a:hover { color: var(--red); }

/* RQTH card */
.rqth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.rqth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: line-glow 3s ease-in-out infinite;
}

@keyframes line-glow {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

.rqth-icon {
  font-size: 1.5rem;
  color: var(--red);
  margin-bottom: 10px;
  display: block;
}

.rqth-label {
  font-size: 0.6875rem;
  color: var(--red);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.rqth-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.skill-group:hover {
  border-color: var(--red-dim);
  box-shadow: 0 0 24px var(--red-glow-sm);
}

.skill-group-title {
  font-size: 0.6875rem; /* 11px */
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem; /* 12px */
  color: var(--text-muted);
  font-family: var(--font-mono);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tag::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(204,0,0,0.15), transparent);
  transition: left 0.5s ease;
}
.tag:hover::before { left: 100%; }

.tag:hover {
  color: var(--text);
  border-color: var(--red);
  background: rgba(204, 0, 0, 0.08);
  box-shadow: 0 0 12px rgba(204, 0, 0, 0.2);
  transform: translateY(-2px);
}

.tag-lang { border-color: var(--red-dim); color: var(--text); }

.skill-group.visible .tag {
  animation: tag-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  opacity: 1;
}
.skill-group.visible .tag:nth-child(1)  { animation-delay: 0ms; }
.skill-group.visible .tag:nth-child(2)  { animation-delay: 50ms; }
.skill-group.visible .tag:nth-child(3)  { animation-delay: 100ms; }
.skill-group.visible .tag:nth-child(4)  { animation-delay: 150ms; }
.skill-group.visible .tag:nth-child(5)  { animation-delay: 200ms; }
.skill-group.visible .tag:nth-child(6)  { animation-delay: 250ms; }
.skill-group.visible .tag:nth-child(7)  { animation-delay: 300ms; }
.skill-group.visible .tag:nth-child(8)  { animation-delay: 350ms; }
.skill-group.visible .tag:nth-child(9)  { animation-delay: 400ms; }
.skill-group.visible .tag:nth-child(10) { animation-delay: 450ms; }
.skill-group.visible .tag:nth-child(11) { animation-delay: 500ms; }

@keyframes tag-pop {
  0%   { opacity: 0; transform: scale(0.6) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
  z-index: 0;
}

.tl-progress-line {
  position: absolute;
  left: 7px; top: 8px;
  width: 2px; height: 0;
  background: linear-gradient(to bottom, var(--red), var(--red-bright));
  box-shadow: 0 0 10px rgba(204, 0, 0, 0.5);
  z-index: 1;
  pointer-events: none;
}

.tl-item {
  position: relative;
  margin-bottom: 40px;
}
.tl-item:last-child { margin-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -32px; top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
  z-index: 2;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.tl-item.visible .tl-dot {
  background: var(--red);
  box-shadow: 0 0 14px rgba(204, 0, 0, 0.6);
  animation: dot-pulse 2.5s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 14px rgba(204,0,0,0.6), 0 0 0 0   rgba(204,0,0,0.3); }
  50%      { box-shadow: 0 0 14px rgba(204,0,0,0.6), 0 0 0 6px rgba(204,0,0,0); }
}

.tl-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.tl-content:hover {
  border-color: var(--red-dim);
  box-shadow: 0 4px 24px var(--red-glow-sm);
}

.tl-date {
  font-size: 0.75rem;
  color: var(--red);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 4px;
}

.tl-title {
  font-size: 1.0625rem; /* 17px */
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.tl-company {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 14px;
  font-style: italic;
}

.tl-list li {
  font-size: 0.875rem; /* 14px */
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
  margin-bottom: 6px;
  line-height: 1.6;
}
.tl-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--red-dim);
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 32px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  min-height: 480px;
}

/* Light sweep */
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: -150%;
  width: 80%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(204,0,0,0.06), rgba(204,0,0,0.1), rgba(204,0,0,0.06), transparent);
  transform: skewX(-15deg);
  transition: left 0.7s ease;
  pointer-events: none;
  z-index: 1;
}
.project-card:hover::before { left: 150%; }

/* CRT scanlines */
.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    rgba(204,0,0,0.012) 2px, rgba(204,0,0,0.012) 4px
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.project-card:hover::after { opacity: 1; }

.project-card:hover {
  border-color: var(--red);
  box-shadow: 0 8px 32px rgba(204,0,0,0.15), 0 0 0 1px rgba(204,0,0,0.08);
  transform: translateY(-4px);
}

.project-card.featured {
  border-color: var(--red-dim);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(204,0,0,0.04) 100%);
}

/* ===== MULTIGPT PREVIEW ===== */
.project-card--multigpt {
  background: linear-gradient(160deg, #0f0f0f 0%, #1a0505 60%, #0f0f0f 100%);
  border-color: rgba(204,0,0,0.3);
}

.mgpt-preview {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(204,0,0,0.2);
  flex-shrink: 0;
}

.mgpt-preview-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ===== GALLERY GRID (templates & aka os) ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gallery-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 90px;
  display: flex;
  align-items: flex-end;
  padding: 8px 10px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(204,0,0,0.05) 0%,
    transparent 60%
  );
}

.gallery-item:hover {
  border-color: var(--red-dim);
  background: rgba(204,0,0,0.06);
}

.gallery-label {
  font-size: 0.625rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.gallery-grid--screens .gallery-item--screen {
  background: linear-gradient(160deg, #1a1a2e 0%, #0f0f1a 100%);
  border-color: rgba(99,102,241,0.2);
}

.gallery-grid--screens .gallery-item--screen::before {
  background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, transparent 60%);
}

.gallery-grid--screens .gallery-item--screen:hover {
  border-color: rgba(99,102,241,0.4);
}

/* ===== AKA OS LOGO ===== */
.akaos-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 0 16px;
  background: #000;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.akaos-logo {
  width: 180px;
  height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(204, 0, 0, 0.6)) drop-shadow(0 0 60px rgba(204, 0, 0, 0.25));
  transition: filter 0.4s ease, transform 0.4s ease;
}

.project-card:hover .akaos-logo {
  filter: drop-shadow(0 0 36px rgba(204, 0, 0, 0.9)) drop-shadow(0 0 80px rgba(204, 0, 0, 0.4));
  transform: scale(1.05);
}

/* ===== TEMPLATES GALLERY ===== */
.templates-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

.tpl-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.08);
  background: #111;
  color: #fff;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.tpl-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
}

/* Preview avec vraie image */
.tpl-preview--img {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: #0a0a0a;
}

.tpl-preview--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.5s ease, filter 0.3s ease;
}

.tpl-card:hover .tpl-preview--img img {
  transform: scale(1.05);
  filter: brightness(0.7);
}

/* Overlay nom au hover */
.tpl-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tpl-card:hover .tpl-overlay {
  opacity: 1;
}

.tpl-logo {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
  letter-spacing: 0.5px;
}

.tpl-sub {
  font-size: 0.68rem;
  opacity: 0.8;
  text-align: center;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.75);
}

.tpl-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,0,0,0.4);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.tpl-type {
  font-size: 0.6rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.6;
  color: #aaa;
}

.tpl-open {
  font-size: 1rem;
  opacity: 0.5;
  color: var(--accent);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tpl-card:hover .tpl-open {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* ===== BOUTONS INLINE PROJETS ===== */
.project-links-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.75rem;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.project-badge {
  font-size: 0.6875rem;
  color: var(--red);
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--red-glow-sm);
  border: 1px solid var(--red-dim);
  border-radius: 4px;
  padding: 2px 8px;
}

.project-link {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}
.project-link:hover { color: var(--red); transform: translate(2px, -2px); }

.project-title {
  font-size: 1.25rem; /* 20px */
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
  position: relative;
  z-index: 2;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  position: relative;
  z-index: 2;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  position: relative;
  z-index: 2;
}

/* ===== EDUCATION ===== */
.edu-list { display: flex; flex-direction: column; gap: 24px; }

.edu-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.edu-item:hover {
  border-color: var(--red-dim);
  box-shadow: 0 4px 20px var(--red-glow-sm);
}

.edu-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.edu-date {
  font-size: 0.75rem;
  color: var(--red);
  letter-spacing: 1px;
}

.edu-badge {
  font-size: 0.6875rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: var(--font-mono);
}

.edu-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.edu-school {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
  font-style: italic;
}

.edu-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== CONTACT ===== */
.contact-container { text-align: center; }

.contact-intro {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease,
              box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(204,0,0,0.06), transparent);
  transition: left 0.5s ease;
}
.contact-card:hover::before { left: 100%; }
.contact-card:hover {
  color: var(--text);
  border-color: var(--red-dim);
  background: var(--red-glow-sm);
  box-shadow: 0 4px 20px var(--red-glow-sm);
  transform: translateY(-2px);
}
.contact-card svg { color: var(--red); flex-shrink: 0; }

/* ===== FOOTER ===== */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 24px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* ===== FADE-IN ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fade-in.visible { opacity: 1; transform: none; }

.fade-in-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.fade-in-left.visible { opacity: 1; transform: none; }

/* ===== FOCUS VISIBLE (accessibilité clavier) ===== */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ===== MOBILE ===== */
@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    padding: 0 24px;
    min-height: auto;
  }

  .hero-left {
    padding: calc(var(--nav-h) + 48px) 0 48px;
  }

  .hero-right {
    display: none; /* photo masquée sur mobile, trop étroit */
  }

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 24px; border-radius: 0; }
  .nav-burger { display: block; }

  section { padding: 64px 0; }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: flex-start; }
  .contact-links { flex-direction: column; align-items: stretch; }
  .projects-grid { grid-template-columns: 1fr; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--red-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ===== SELECTION ===== */
::selection { background: rgba(204,0,0,0.25); color: var(--text); }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #hero { background-image: none; }
}
