:root {
  --accent: #6e57e0;
  --accent-soft: rgba(110, 87, 224, 0.1);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #e8e8ec;
  --surface: #ffffff;
  --surface-2: #f7f7f9;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
  --radius: 18px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family:
    "Poppins",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font: inherit;
}

.container {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}

.section {
  padding: 115px 0;
  scroll-margin-top: 72px;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-wrap {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 72px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.09em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  position: relative;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 180ms ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link.active::after {
  transform: scaleX(1);
}

/* ---------- Accueil / Bio ---------- */
.hero-section {
  min-height: 100vh;
  padding-top: 150px;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: clamp(48px, 8vw, 105px);
  align-items: start;
}

.profile-card {
  position: sticky;
  top: 112px;
  text-align: center;
}

.portrait-wrap {
  width: 220px;
  height: 220px;
  margin: 0 auto 28px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.portrait {
  height: 130%;
  object-fit: cover;
}

.profile-card h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2rem;
  line-height: 1.2;
}

.profile-title {
  margin: 10px 0 2px;
  color: var(--text);
  font-size: 0.97rem;
}

.profile-location {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.91rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
}

.profile-links a {
  color: var(--muted);
  font-size: 1.4rem;
  border-bottom: 1px solid transparent;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.profile-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 5 rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.bio-content > h2,
.section-heading h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.bio-content > h2 span {
  color: var(--accent);
}

.bio-content > p:not(.eyebrow) {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.bio-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 52px;
  margin-top: 56px;
  padding-top: 38px;
  border-top: 1px solid var(--border);
}

.bio-block h3 {
  margin: 0 0 25px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.bio-block .subheading {
  margin-top: 38px;
}

.timeline-item {
  position: relative;
  padding-left: 18px;
  margin-bottom: 28px;
  border-left: 2px solid var(--border);
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-date {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
}

.timeline-item h4 {
  margin: 4px 0 4px;
  font-size: 1rem;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.tag-list span,
.project-meta span {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
}

/* ---------- Portfolio ---------- */
.portfolio-section {
  background: var(--surface-2);
}

.section-heading {
  margin-bottom: 40px;
}

.section-heading h2 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.section-heading > p:last-child {
  max-width: none;
  color: var(--muted);
  margin: 18px 0 0;
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 38px;
}

.filter-btn {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 9px 16px;
  transition: all 180ms ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    opacity 180ms ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.project-card.is-hidden {
  display: none;
}

.project-image-link {
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #ececf1;
}

.project-image {
  height: 270%;
  object-fit: cover;
  transition: transform 350ms ease;
}

.project-card:hover .project-image {
  transform: scale(1.035);
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 22px 24px;
}

.project-category {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-body h3 {
  margin: 7px 0 9px;
  font-size: 1.17rem;
}

.project-body p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: justify;
  flex-grow: 1;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  margin-bottom: 19px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 7px;
  margin-top: 0;
  font-size: 0.87rem;
  font-weight: 600;
}

.project-link:hover {
  color: var(--accent);
}

.project-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: auto;
}

.project-actions .project-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.footer-inner {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.84rem;
}

.footer-inner p {
  margin: 0;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 500ms ease,
    transform 500ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .profile-card {
    position: static;
    max-width: 520px;
    margin-inline: auto;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .section {
    padding: 86px 0;
  }

  .hero-section {
    padding-top: 118px;
  }

  .nav-wrap {
    min-height: 64px;
  }

  .brand {
    font-size: 0.78rem;
  }

  .main-nav {
    gap: 16px;
  }

  .nav-link {
    font-size: 0.86rem;
  }

  .portrait-wrap {
    width: 180px;
    height: 180px;
  }

  .bio-columns,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-filters {
    gap: 7px;
  }

  .filter-btn {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .footer-inner {
    flex-direction: column;
    justify-content: center;
    padding: 24px 0;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Boutons du mode sombre ---------- */

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-control {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.nav-control:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- Mode nuit ---------- */

body.dark-mode {
  --text: #f0f0f5;
  --muted: #b2b2c0;
  --border: #333344;
  --surface: #191923;
  --surface-2: #222230;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.25);

  background: var(--surface);
  color: var(--text);
}

body.dark-mode .site-header {
  background: rgba(25, 25, 35, 0.9);
  border-bottom-color: var(--border);
}

body.dark-mode .portfolio-section,
body.dark-mode .site-footer {
  background: var(--surface-2);
}

body.dark-mode .project-card {
  background: var(--surface);
  border-color: var(--border);
}

body.dark-mode .portrait-wrap {
  background: var(--surface-2);
}

body.dark-mode .filter-btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--muted);
}

body.dark-mode .filter-btn:hover,
body.dark-mode .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

body.dark-mode .tag-list span,
body.dark-mode .project-meta span {
  background: var(--surface-2);
  color: var(--muted);
}

/* Adaptation mobile */
@media (max-width: 680px) {
  .main-nav {
    gap: 12px;
  }

  .nav-control {
    width: 34px;
    height: 34px;
  }
}
