/* ============================================
   TALIE CHAPPEY — Portfolio
   Style global
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700&display=block');

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #888888;
  --nav-height: 52px;
  --page-left: 220px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:not(.nav-links a):hover { opacity: 0.55; }
img { display: block; max-width: 100%; height: auto; }

/* ============================================
   VIEW TRANSITIONS
   ============================================ */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

::view-transition-old(site-nav),
::view-transition-new(site-nav) {
  animation: none;
}

/* ============================================
   NAVIGATION
   ============================================ */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  view-transition-name: site-nav;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2rem;
  padding: 0 2rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  z-index: 100;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.nav-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 12px;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; }

/* Hamburger — mobile only */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: #111;
  margin: 5px 0;
  transition: all 0.3s;
}

/* ============================================
   SLIDER CENTRÉ
   ============================================ */

.slider-center-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 400px;
  margin-bottom: 48px;
  visibility: hidden;
}
.slider-center-wrap.ready { visibility: visible; }
.slider-center-track {
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
  gap: 20px;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.slider-center-track img,
.slider-center-track video {
  flex: 0 0 auto;
  height: 400px;
  width: auto;
  object-fit: contain;
  display: block;
  opacity: 0.3;
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.slider-center-track img   { cursor: zoom-in; }
.slider-center-track video { cursor: zoom-in; background: #000; }
.slider-center-track img.active,
.slider-center-track video.active { opacity: 1; }
.slider-center-prev,
.slider-center-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.8);
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 10px 16px;
  color: #111;
  opacity: 0.6;
  transition: opacity 0.2s;
  z-index: 10;
}
.slider-center-prev:hover,
.slider-center-next:hover { opacity: 1; }
.slider-center-prev { left: 0; }
.slider-center-next { right: 0; }

/* ============================================
   PAGE WRAPPER
   ============================================ */

main {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* ============================================
   ACCUEIL — Vidéo hero
   ============================================ */

.hero-video {
  width: 100%;
  height: calc(100vh - var(--nav-height));
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-video video {
  width: 500px;
  height: 500px;
  object-fit: cover;
  display: block;
}

/* ============================================
   PAGES CATÉGORIES
   ============================================ */

.category-page {
  padding: 60px 2rem 80px;
  max-width: 900px;
  margin: 0 auto;
}

.category-intro {
  margin-bottom: 36px;
}

.category-intro h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 24px;
  color: #111;
}

.category-intro p {
  font-size: 13px;
  max-width: 100%;
  line-height: 1.9;
  color: #333;
  text-align: justify;
}

.category-intro p + p { margin-top: 12px; }

/* Grille de projets */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px 28px;
  width: 100%;
}

.project-card {
  display: block;
  transition: opacity 0.4s;
}

.project-card:hover { opacity: 0.62; }

.project-card .thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f5f5f5;
}

.project-card .card-title {
  display: block;
  margin-top: 10px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #111;
}

/* ============================================
   PAGE PROJET INDIVIDUELLE
   ============================================ */

.project-page {
  padding: 50px 2rem 90px;
  max-width: 900px;
  margin: 0 auto;
}

.back-link,
.next-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.back-link:hover,
.next-link:hover { color: var(--text); opacity: 1; }
.back-link::before { content: '←'; font-size: 13px; }
.next-link::after  { content: '→'; font-size: 13px; }
.next-link { float: right; }

.project-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 52px;
}

.project-images.cols-1 { grid-template-columns: 1fr; max-width: 600px; }
.project-images.cols-3 { grid-template-columns: repeat(3, 1fr); }

.project-images img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.project-info {
  max-width: 900px;
}

.project-info h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.18em;
  margin-bottom: 0;
  line-height: 1.3;
  text-transform: uppercase;
}

.project-info .meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.project-info p {
  font-size: 13.5px;
  line-height: 1.95;
  text-align: justify;
  color: #222;
  margin-bottom: 14px;
}

.project-info a { border-bottom: 1px solid #ccc; }
.project-info a:hover { border-color: #111; opacity: 1; }

.project-title { margin-bottom: 28px; clear: both; padding-top: 24px; }
.project-title h1 { color: #111; }
.project-title .meta { color: #111; }

/* ============================================
   PAGE ACADEMIC PROJECTS
   ============================================ */

.academic-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.academic-item {
  display: grid;
  grid-template-columns: 135px 1fr;
  gap: 24px;
  align-items: flex-start;
  padding: 28px 0;
  border-bottom: 1px solid #ebebeb;
}

.academic-item:first-child { border-top: 1px solid #ebebeb; }

.academic-logo {
  width: 135px;
  height: auto;
  margin-top: 2px;
}

.academic-content h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
  margin-bottom: 4px;
}

.academic-content .academic-type {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.academic-content p {
  font-size: 13px;
  line-height: 1.85;
  color: #333;
  max-width: 900px;
  text-align: justify;
}

.academic-thumb {
  width: 100%;
  max-width: 200px;
  height: auto;
  margin-top: 14px;
  opacity: 0.85;
}

/* ============================================
   CV PAGE
   ============================================ */

.cv-page {
  display: flex;
  justify-content: center;
  padding: 60px 2rem 80px;
}

.cv-page img {
  max-width: 600px;
  width: 100%;
  height: auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* ============================================
   CONTACT PAGE
   ============================================ */

.contact-page {
  padding: 80px 2rem;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 70px;
  align-items: flex-start;
}

.contact-photo {
  width: 300px;
  height: 300px;
  object-fit: cover;
  flex-shrink: 0;
}

.contact-info {
  padding-top: 10px;
}

.contact-info h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.06em;
  margin-bottom: 36px;
}

.contact-info .contact-line {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 14px;
}

.contact-info .contact-line a {
  border-bottom: 1px solid #ddd;
  padding-bottom: 1px;
}
.contact-info .contact-line a:hover { border-color: #111; opacity: 1; }

/* ============================================
   MEDIA UNIQUE (1 seul élément — pas de slider)
   ============================================ */

.single-media {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 48px;
}

.single-media video,
.single-media img {
  max-height: 80vh;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* ============================================
   LIGHTBOX
   ============================================ */

#lb-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

#lb-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
}

#lb-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  user-select: none;
  transition: opacity 0.25s ease;
}

#lb-close {
  position: fixed;
  top: 20px;
  right: 26px;
  background: none;
  border: none;
  color: #111;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.5;
  line-height: 1;
  padding: 6px;
  transition: opacity 0.2s;
  z-index: 1001;
}
#lb-close:hover { opacity: 1; }

#lb-prev,
#lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #111;
  font-size: 28px;
  cursor: pointer;
  opacity: 0.4;
  padding: 16px 20px;
  transition: opacity 0.2s;
  z-index: 1001;
  display: flex;
  align-items: center;
}
#lb-prev { left: 12px; }
#lb-next { right: 12px; }
#lb-prev:hover, #lb-next:hover { opacity: 1; }

#lb-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(0,0,0,0.35);
  font-size: 12px;
  letter-spacing: 0.1em;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  border-top: 1px solid #ebebeb;
  padding: 24px 2rem;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  nav { padding: 0 1rem; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid #ebebeb;
    padding: 16px 0;
  }

  .nav-links.open { display: flex; }
  .nav-links li a { display: block; padding: 12px 24px; font-size: 12px; }
  .nav-toggle { display: block; }

  .category-page,
  .project-page { padding: 36px 1rem 60px; }

  .contact-page {
    flex-direction: column;
    padding: 48px 1rem;
    gap: 36px;
  }

  .contact-photo { width: 100%; height: 280px; }

  .project-images,
  .project-images.cols-3 { grid-template-columns: 1fr; }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 16px;
  }

  .academic-item {
    grid-template-columns: 50px 1fr;
    gap: 16px;
  }

  .slider-center-wrap { height: 260px; }
  .slider-center-track img,
  .slider-center-track video { height: 260px; }

  .cv-page img { max-width: 100%; }

  footer { padding: 20px 1rem; }
}

@media (max-width: 540px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 12px;
  }
  .hero-video video {
    width: 100vw;
    height: 100vw;
  }
}
