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

:root {
  --bg: #1c1c1e;
  --bg2: #242426;
  --bg3: #2c2c2e;
  --accent: #c96a2a;
  --text: #e4e0da;
  --muted: #8a8480;
  --border: #333130;
}

:root.light {
  --bg: #f5f4f2;
  --bg2: #eceae7;
  --bg3: #e0deda;
  --accent: #c96a2a;
  --text: #1c1c1e;
  --muted: #5a5652;
  --border: #cac6c2;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: rgba(28, 28, 30, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

:root.light nav { background: rgba(245, 244, 242, 0.9); }

.nav-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.nav-back:hover { color: var(--text); }

.nav-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
}

.theme-toggle {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-toggle:hover { color: var(--text); border-color: var(--muted); }

/* ── LAYOUT ── */
main {
  max-width: 820px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
}

/* ── CAROUSEL ── */
.carousel {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg2);
  margin-bottom: 2.5rem;
  aspect-ratio: 16 / 9;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-slide .slide-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--bg2);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 1rem;
}

.carousel-btn:hover { background: rgba(0,0,0,0.7); }
.carousel-btn.prev { left: 0.875rem; }
.carousel-btn.next { right: 0.875rem; }

.carousel-dots { display: none; }

/* ── CAROUSEL THUMBS ── */
.carousel-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.carousel-thumb {
  height: 60px;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s;
}

.carousel-thumb:hover { opacity: 0.8; }
.carousel-thumb.active { opacity: 1; border-color: var(--accent); }

/* ── CONTENU ── */
.project-header { margin-bottom: 2rem; }

.project-category {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  background: var(--bg3);
  color: var(--muted);
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.project-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: all 0.2s;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg2);
}

.btn:hover { color: var(--text); border-color: var(--muted); }

.btn-accent {
  background: var(--accent);
  color: #1c1c1e;
  border-color: var(--accent);
}

.btn-accent:hover { opacity: 0.85; color: #1c1c1e; border-color: transparent; }

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

/* ── ARTICLE ── */
article h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.875rem;
  position: relative;
  padding-bottom: 0.5rem;
}

article h2::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 28px; height: 2px;
  background: var(--accent);
}

article h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

article p {
  color: var(--muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

article ul {
  list-style: none;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

article ul li {
  color: var(--muted);
  font-size: 0.95rem;
  padding-left: 1rem;
  position: relative;
}

article ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 820px;
  margin: 0 auto;
}

.footer-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.footer-links { display: flex; gap: 0.75rem; }

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.footer-link:hover { color: var(--text); border-color: var(--muted); }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  main { padding: 4.5rem 1.25rem 3rem; }
}
