@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,600;0,700;1,400;1,600&family=JetBrains+Mono:wght@400;500;600&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&display=swap');

/* ── Variables — thème sombre (défaut) ── */
:root {
  --bg: #080808;
  --surface: #0E0E0E;
  --border: #1C1C1C;
  --text: #E8E3D8;
  --muted: #4D4844;
  --accent: #E8420A;
  --accent-dim: rgba(232, 66, 10, 0.07);
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'DM Sans', system-ui, sans-serif;
}

/* ── Thème clair (suit le système) ── */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #FFFFFF;
    --surface: #F5F5F3;
    --border: #E3E3DF;
    --text: #111110;
    --muted: #767672;
    --accent: #E8420A;
    --accent-dim: rgba(232, 66, 10, 0.07);
  }
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; }

/* ── Grain overlay ── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  mix-blend-mode: multiply; /* s'adapte aux deux thèmes */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}

/* ── Container ── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim {
  opacity: 0;
  animation: fadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--text);
  line-height: 1;
  transition: color 0.2s;
  letter-spacing: -0.02em;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.nav-links a {
  color: var(--muted);
  padding: 4px 2px;
  position: relative;
  transition: color 0.2s;
  letter-spacing: 0.02em;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.sep {
  color: var(--border);
  user-select: none;
  font-size: 10px;
}

/* ── Eyebrow ── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mono-num {
  color: var(--accent);
  font-weight: 600;
}

/* ── Section Headings ── */
section h2 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 40px;
}

/* ── Sections ── */
section {
  padding: 72px 0;
  border-top: 1px solid var(--border);
}

/* ── Hero ── */
.hero {
  padding: 80px 0 88px;
  border-top: none;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(5rem, 16vw, 7.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--text);
  margin-bottom: 28px;
  margin-top: 8px;
}

.hero-bio {
  font-size: 0.975rem;
  color: var(--muted);
  max-width: 400px;
  margin-bottom: 36px;
  line-height: 1.75;
  font-weight: 400;
}

/* ── Social Links ── */
.social-links {
  display: flex;
  gap: 28px;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s;
}

.social-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.social-links a:hover { color: var(--text); }
.social-links a:hover::after { width: 100%; }

.social-links svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Projects ── */
.project-list {
  display: flex;
  flex-direction: column;
}

.project-item {
  display: flex;
  gap: 20px;
  padding: 24px 0 24px 14px;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  transition: border-left-color 0.3s ease, background 0.2s ease;
  margin-left: -16px;
  padding-left: 16px;
}

.project-item:hover {
  border-left-color: var(--accent);
  background: var(--accent-dim);
}

.project-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  min-width: 18px;
  padding-top: 5px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.project-body { flex: 1; }

.project-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.project-body h3 {
  font-size: 0.975rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}

.project-stack {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.project-stack span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-stack span + span::before {
  content: ' · ';
  color: var(--border);
}

.project-body > p {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.6;
  font-weight: 400;
}

.project-links {
  display: flex;
  gap: 18px;
}

.project-links a {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  transition: opacity 0.2s;
}

.project-links a:hover { opacity: 0.65; }

/* ── Skills ── */
.marquee-wrap {
  overflow: hidden;
  margin: 0 -32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 13px 0;
  margin-bottom: 40px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee-track span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 22px;
  position: relative;
  white-space: nowrap;
}

.marquee-track span::after {
  content: '·';
  position: absolute;
  right: -1px;
  color: var(--border);
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.skill-group-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 14px;
}

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

.skill-tags span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text);
  opacity: 0.6;
  padding: 3px 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: opacity 0.2s, border-color 0.2s;
  cursor: default;
  white-space: nowrap;
}

.skill-tags span:hover {
  opacity: 1;
  border-color: var(--muted);
}

/* ── Timeline ── */
.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 40px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: 0;
  top: 7px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--accent);
  background: var(--bg);
  border-radius: 50%;
}

.timeline-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.timeline-content h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.timeline-school {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 7px;
}

.timeline-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
  font-weight: 400;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

footer p {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-align: center;
}

/* ── Accessibilité : réduit les animations ── */
@media (prefers-reduced-motion: reduce) {
  .anim {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .marquee-track {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ── Responsive ── */

/* Mobile — 640px */
@media (max-width: 640px) {
  .container {
    padding: 0 18px;
  }

  /* Nav: passe en pill fixe en bas, style Spotlight */
  nav {
    position: fixed;
    top: auto;
    bottom: 20px;
    left: 0;
    right: 0;
    background: transparent;
    border-bottom: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
  }

  .nav-inner {
    padding: 0;
    height: auto;
    justify-content: center;
  }

  .nav-logo { display: none; }

  .nav-links {
    pointer-events: all;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 8px 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-size: 10.5px;
    gap: 2px;
  }

  .nav-links a {
    padding: 4px 8px;
    white-space: nowrap;
  }

  /* Hero */
  .hero {
    padding: 48px 0 60px;
  }

  .hero-name {
    font-size: clamp(3.4rem, 18vw, 5rem);
    line-height: 0.93;
  }

  .hero-bio {
    font-size: 0.9rem;
    max-width: 100%;
  }

  .social-links {
    gap: 20px;
    flex-wrap: wrap;
  }

  /* Sections */
  section {
    padding: 52px 0;
  }

  section h2 {
    font-size: clamp(1.9rem, 7vw, 2.4rem);
    margin-bottom: 28px;
  }

  /* Projects */
  .project-item {
    margin-left: -10px;
    padding-left: 10px;
    gap: 12px;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Marquee */
  .marquee-wrap {
    margin: 0 -18px;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Timeline */
  .timeline-item {
    padding-left: 22px;
    padding-bottom: 32px;
  }

  .timeline-dot {
    width: 6px;
    height: 6px;
    top: 6px;
  }

  /* Footer: espace pour la pill nav fixe */
  footer {
    padding-bottom: 80px;
  }
}

/* Small mobile — 420px */
@media (max-width: 420px) {
  .container { padding: 0 14px; }

  .hero-name {
    font-size: clamp(2.9rem, 21vw, 3.8rem);
  }

  .eyebrow {
    font-size: 9px;
    flex-wrap: wrap;
    gap: 5px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .project-num { display: none; }

  .sep { opacity: 0.4; font-size: 9px; }

  .nav-links {
    font-size: 10px;
    padding: 7px 12px;
    gap: 1px;
  }

  .nav-links a { padding: 4px 6px; }
}
