/* ============================================
   RESET & BASE
   ============================================ */

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

:root {
  --black: #0a0a0a;
  --white: #fff;
  --gray: #666;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --nav-h: 52px;
  --pad: 32px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
em { font-style: italic; }

/* ============================================
   HEADER / NAV
   ============================================ */

header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  background: var(--white);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  flex-wrap: nowrap;
}

header nav {
  flex-wrap: nowrap;
  white-space: nowrap;
}

header nav a,
header .nav-icon,
header #langBtn {
  flex-shrink: 0;
}

.site-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

nav a {
  font-size: 14px;
  font-weight: 400;
  color: var(--black);
  transition: opacity 0.15s;
}

nav a:hover {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 1;
}

nav a.active {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav-icon {
  display: flex;
  align-items: center;
}

/* Language toggle */
.lang-toggle {
  background: none;
  border: 1px solid rgba(0,0,0,0.25);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--black);
  cursor: pointer;
  padding: 3px 8px;
  letter-spacing: 0.08em;
  transition: border-color 0.15s;
  flex-shrink: 0;
}

.lang-toggle:hover { border-color: var(--black); }

/* Bilingual content visibility */
html[data-lang="en"] .lang-fr { display: none; }
html[data-lang="fr"] .lang-en { display: none; }

/* ============================================
   MAIN WRAPPER
   ============================================ */

main {
  padding-top: var(--nav-h);
}

/* ============================================
   HOME — BIO
   ============================================ */

.home-bio {
  padding: 28px var(--pad) 16px;
  max-width: 960px;
}

.home-bio p {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--black);
}

/* ============================================
   HOME — PROJECTS GRID
   ============================================ */

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 0;
}

.grid-item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #ccc;
}

.grid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.grid-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.grid-item:hover .grid-img img {
  transform: scale(1.03);
}

.project-img img,
.text-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.text-cover img {
  transition: opacity 0.3s ease;
}

.grid-label {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--black);
  padding: 4px 10px;
}

/* ============================================
   PLACEHOLDER COLORS (remplacer par images réelles)
   ============================================ */

.placeholder-dark    { background: #1a1a1a; }
.placeholder-textile { background: #2a4a7f; }
.placeholder-book    { background: #d4c4a0; }
.placeholder-blue    { background: #1a3a8a; }
.placeholder-orange  { background: #e8a020; }
.placeholder-bucket  { background: #3a7abf; }
.placeholder-pinault { background: #8aaa6a; }
.placeholder-viceral { background: #6a8acc; }
.placeholder-albers  { background: #8a9acc; }
.placeholder-critique { background: #cc3030; }
.placeholder-reflection { background: #556677; }
.placeholder-manual  { background: #e08030; }

/* ============================================
   ABOUT PAGE
   ============================================ */

.about-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 48px;
  padding: 56px var(--pad) 48px;
  min-height: calc(100vh - var(--nav-h));
  align-items: start;
}

.about-left h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
}

.contact-btn {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 28px;
  transition: opacity 0.2s;
}

.contact-btn:hover { opacity: 0.7; }

.about-right {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 640px;
}

.about-right p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--black);
  margin-bottom: 14px;
}

.about-right p:last-child {
  margin-bottom: 0;
}

/* ============================================
   TEXTS PAGE
   ============================================ */

.texts-grid {
  columns: 5;
  column-gap: 4px;
  padding: calc(var(--nav-h) + 24px) 4px 4px;
}

.text-item {
  position: relative;
  display: block;
  break-inside: avoid;
  margin-bottom: 4px;
  overflow: hidden;
}

.text-cover {
  width: 100%;
  overflow: hidden;
  display: block;
  background: #d8d0c8;
  min-height: 160px;
}

.text-cover img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.text-item:hover .text-cover img {
  transform: scale(1.03);
}

.text-info {
  position: absolute;
  inset: 0;
  padding: 16px;
  background: rgba(232, 93, 4, 0.72);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.text-info strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: #fff;
  margin-bottom: 6px;
}

.text-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  opacity: 1;
  line-height: 1.4;
}

.text-pdf {
  font-size: 10px;
  opacity: 0.7;
  margin-left: 3px;
}

.text-item:hover .text-info {
  opacity: 1;
}

.text-item--featured .text-cover {
  min-height: 300px;
}

.text-item--featured .text-cover img {
  height: 300px;
  object-fit: cover;
}

.text-item--featured .text-info strong {
  font-size: 15px;
}

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

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 var(--pad) 48px;
}

.project-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-img {
  aspect-ratio: 4/3;
  width: 100%;
  overflow: hidden;
  position: relative;
  transition: opacity 0.2s;
}

.project-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(232, 93, 4, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}

.project-item:hover .project-img::after {
  background: rgba(232, 93, 4, 0.08);
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project-info strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--black);
  transition: text-decoration 0.15s;
}

.project-info span {
  font-size: 13px;
  line-height: 1.2;
  color: #e85d04;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.project-item:hover .project-info strong {
  opacity: 0.6;
}

.project-item:hover .project-info span {
  opacity: 1;
}

/* ============================================
   PROJECT — GALLERY GRID
   ============================================ */

.project-gallery {
  padding: 0 var(--pad) 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.project-gallery img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 4/3;
  background: #eee;
}

/* ============================================
   PROJECT — GALLERY FIGURES & HOVER CAPTIONS
   ============================================ */

.project-gallery figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #eee;
}

.project-gallery figure img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 4/3;
  transition: transform 0.4s ease;
}

.project-gallery figure:hover img {
  transform: scale(1.03);
}

.project-gallery figure figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: rgba(0,0,0,0.52);
  color: rgba(255,255,255,0.92);
  font-size: 11px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.project-gallery figure:hover figcaption {
  opacity: 1;
}

/* ============================================
   PROJECT — PREV / NEXT NAV
   ============================================ */

.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px var(--pad) 48px;
  border-top: 0.5px solid rgba(0,0,0,0.1);
}

.project-nav-prev,
.project-nav-next {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  color: var(--black);
  max-width: 45%;
  transition: opacity 0.2s;
}

.project-nav-next { text-align: right; }

.project-nav-prev:hover,
.project-nav-next:hover { opacity: 0.45; }

.project-nav-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
}

.project-nav-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

/* ============================================
   TALKS PAGE
   ============================================ */

.talks-list {
  padding: 20px var(--pad) 48px;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
}

.talk-item {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  padding: 18px 0;
}

.talk-item + .talk-item {
  border-top: 0.5px solid rgba(0,0,0,0.06);
}

.talk-left h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  font-style: normal;
  line-height: 1.35;
  margin-bottom: 14px;
  color: var(--black);
}

.talk-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.talk-meta span {
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
}

.talk-right p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--black);
}

.talk-left h2 a {
  color: inherit;
  text-decoration: none;
}

.talk-left h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================
   HAMBURGER MENU
   ============================================ */

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

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--black);
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

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

@media (max-width: 768px) {
  :root { --pad: 20px; }

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

  .about-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 48px var(--pad);
  }

  .texts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    columns: initial;
    gap: 16px;
    padding: 40px var(--pad);
  }

  .text-cover {
    aspect-ratio: 3 / 4;
    min-height: 0;
  }

  .text-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .text-item--featured .text-cover {
    aspect-ratio: 3 / 4;
  }

  .text-item--featured .text-cover img {
    height: 100%;
  }

  /* Titles never show on touch devices since .text-info only
     appears on :hover — make it always visible on mobile, as a
     bottom gradient instead of a full-cover overlay. */
  .text-info {
    opacity: 1;
    inset: auto 0 0 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.72) 65%);
    padding: 24px 10px 10px;
  }

  .text-info strong {
    font-size: 12px;
  }

  .text-meta {
    font-size: 10px;
  }

  .projects-grid {
    grid-template-columns: 1fr 1fr;
    padding: 16px var(--pad) 40px;
  }

  .home-bio {
    padding-bottom: 8px;
  }

  /* Category label is hover-only, which never fires on touch —
     keep it visible at all times on mobile, sitting statically
     under each image. */
  .project-info span {
    opacity: 1;
  }

  .talk-item {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  nav { gap: 18px; }
  .project-gallery { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  /* Hamburger visible */
  .hamburger { display: flex; }

  /* Nav links hidden by default, shown as dropdown */
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-direction: column;
    padding: 24px var(--pad) 28px;
    gap: 20px;
    z-index: 99;
  }

  nav.open .nav-links { display: flex; }

  .nav-links a { font-size: 16px; }

  /* Bio text */
  .home-bio {
    padding: 40px var(--pad) 24px;
  }
  .home-bio p {
    font-size: 1rem;
    line-height: 1.5;
  }

  /* Hero height on detail pages */
  .project-hero {
    height: 45vh !important;
    min-height: 220px !important;
  }
}

@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .project-gallery { grid-template-columns: 1fr; }
}
