/* ============================================================
   MAXIME GENOVESE — PORTFOLIO
   Recreation fidele du site original (genovesemaxime.myportfolio.com)
   ============================================================ */

:root {
  --bg: #fbfaf8;
  --bg-home: #eceae5;
  --ink: #171614;
  --muted: #8f8d87;
  --rule: #e3e1da;

  --sidebar-w: 300px;
  --gutter: 56px;
  --gutter-sm: 24px;

  --ff-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ff-body: "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.is-home { background: var(--bg-home); }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* ---------- Layout shell ---------- */

.shell {
  display: flex;
  align-items: flex-start;
}

/* ---------- Sidebar (in normal flow, like the original -- not fixed) ---------- */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 56px var(--gutter-sm) 40px;
}

.brand {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.brand a:hover { opacity: 0.7; }

.nav-list {
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
}
.nav-list li { margin: 0 0 10px; }
.nav-list a {
  display: inline-block;
  font-family: var(--ff-body);
  font-size: 14px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-list a:hover { color: var(--ink); }
.nav-list a.active { color: var(--ink); }

/* Mobile top bar */
.topbar { display: none; }
.mobile-nav { display: none; }
.topbar__title { display: none; }

/* ---------- Main ---------- */

.main {
  flex: 1;
  min-width: 0;
}

/* ---------- Home ---------- */

.home-hero {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  z-index: 1;
  pointer-events: none;
}
.home-hero img {
  pointer-events: none;
  max-width: calc(100vw - (2 * (var(--sidebar-w) + 40px)));
  max-height: calc(100vh - 3cm);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* ---------- Project page ---------- */

.project-hero {
  width: 100%;
}
.project-hero img { width: 100%; }

/* ---------- Carousel ---------- */

.carousel {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: 72px 64px 88px;
}
.carousel__image-wrap {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f1f0ec;
}
.carousel__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  opacity: 0.45;
  transition: opacity 200ms ease;
}
.carousel__arrow:hover { opacity: 1; }
.carousel__arrow svg { width: 16px; height: 16px; display: block; }
.carousel__arrow--prev { left: 12px; }
.carousel__arrow--next { right: 12px; }

.carousel__caption {
  text-align: center;
  margin: 18px 0 0;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  min-height: 1.4em;
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}
.carousel__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rule);
  border: none;
  padding: 0;
  cursor: pointer;
}
.carousel__dot.active { background: var(--ink); }

.project-header {
  padding: 110px var(--gutter) 36px;
  text-align: center;
}
.project-header__title {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(40px, 6vw, 68px);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
}

.project-copy {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter) 72px;
  text-align: center;
}
.project-copy p {
  font-size: 15px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 26px;
}
.project-copy p:last-child { margin-bottom: 0; }

.project-gallery {
  display: grid;
  gap: 0;
}
.project-gallery img {
  width: 100%;
}
.project-gallery.cols-2 {
  grid-template-columns: 1fr 1fr;
}

/* ---------- Joaillerie (grille boutique) ---------- */

.shop-intro {
  padding: 56px var(--gutter) 8px 0;
}
.shop-intro__label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  max-width: 520px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  margin-top: 32px;
}

.shop-tile {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  overflow: hidden;
}

.shop-tile__img-wrap {
  display: block;
  width: 100%;
  height: 100%;
}
.shop-tile__img-wrap [data-role="media"] {
  display: block;
  width: 100%;
  height: 100%;
}
.shop-tile__img-wrap img,
.shop-tile__img-wrap video {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  object-fit: cover;
  display: block;
}

.shop-tile__label {
  position: absolute;
  left: 0; right: 0; bottom: 14px;
  padding: 0 14px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}
.shop-tile__label--black { color: #3a3a37; }
.shop-tile__label--white { color: #fff; }

.shop-tile__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.75);
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  opacity: 0;
  transition: opacity 200ms ease;
}
.shop-tile:hover .shop-tile__arrow { opacity: 1; }
.shop-tile__arrow svg { width: 14px; height: 14px; }
.shop-tile__arrow--prev { left: 8px; }
.shop-tile__arrow--next { right: 8px; }

.shop-tile__dots {
  position: absolute;
  top: 10px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
}
.shop-tile__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(58,58,55,0.4);
  border: none;
  padding: 0;
}
.shop-tile__dot.active { background: #3a3a37; }

/* ---------- Page de detail (ouverte depuis une case boutique) ---------- */

.detail-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.detail-topline {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px var(--gutter) 0;
  flex: 0 0 auto;
}

.detail-back {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
}
.detail-back svg { width: 16px; height: 16px; }
.detail-back:hover { opacity: 0.6; }

.detail-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.detail-thumb {
  width: 3cm;
  height: 3cm;
  flex: 0 0 auto;
  padding: 0;
  border: 3px solid transparent;
  background: none;
  cursor: pointer;
  overflow: hidden;
}
.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-thumb.active { border-color: var(--ink); }

.detail-stage-wrap {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px var(--gutter);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.detail-arrow {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
  z-index: 2;
  padding: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.detail-arrow--prev { left: 8px; }
.detail-arrow--next { right: 8px; }
.detail-arrow svg { width: 22px; height: 22px; }
.detail-arrow:hover { opacity: 0.6; }

.detail-stage-track {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.detail-stage-center { order: 1; }
[data-role="side-next"] { order: 2; }
[data-role="side-next2"] { order: 3; }


.detail-stage-center {
  flex: 0 0 auto;
  width: calc((100vh - 200px) * 0.8);
  height: calc(100vh - 200px);
  max-width: 55vw;
  overflow: hidden;
}
.detail-stage-center--landscape {
  width: min(72vw, calc((100vh - 260px) * 1.7778));
  height: auto;
  aspect-ratio: 16 / 9;
  max-width: 72vw;
}
.detail-stage-center img,
.detail-stage-center video {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  object-fit: cover;
  display: block;
}

.detail-stage-side {
  flex: 0 0 auto;
  width: calc((100vh - 260px) * 0.8);
  height: calc(100vh - 260px);
  max-width: 32vw;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 200ms ease;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-stage-side:hover { opacity: 0.9; }
.detail-stage-side img,
.detail-stage-side video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.detail-stage-side--empty { visibility: hidden; }

.detail-text {
  flex: 0 0 auto;
  padding: 24px var(--gutter) 96px;
  margin: 0;
  text-align: left;
}
.detail-text p {
  max-width: 720px;
}
.detail-text-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.detail-text-title {
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.detail-text-year {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.detail-text p {
  font-size: 15px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  margin: 0;
}





@media (max-width: 860px) {
  .shell { flex-direction: column; align-items: stretch; }

  .sidebar { display: none; }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 20;
    border-bottom: 1px solid var(--rule);
  }
  body.is-home .topbar { background: var(--bg-home); }
  .topbar .brand { font-size: 18px; }
  .topbar__title {
    display: block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    white-space: nowrap;
    pointer-events: none;
  }
  .topbar__toggle {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    background: none;
    border: 1px solid var(--rule);
    padding: 8px 12px;
    cursor: pointer;
  }

  .mobile-nav {
    display: none;
    flex-direction: column;
    padding: 8px 20px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
  }
  body.is-home .mobile-nav { background: var(--bg-home); }
  .mobile-nav.open { display: flex; }
  .mobile-nav a {
    padding: 10px 0;
    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--rule);
  }
  .mobile-nav a.active { color: var(--ink); }

  .home-hero {
    position: fixed;
    inset: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    pointer-events: none;
  }
  .home-hero img {
    width: min(78vh, 82vw);
    height: min(78vh, 82vw);
    max-width: none;
    max-height: none;
    object-fit: contain;
    transform: rotate(-90deg);
  }
  .project-gallery.cols-2 { grid-template-columns: 1fr; }
  .project-header { padding: 56px 20px 24px; }
  .project-copy { padding: 0 20px 48px; }
  .carousel { max-width: 100%; padding: 24px 44px 56px; }
  .carousel__arrow { width: 32px; height: 32px; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 1px; }
  .shop-intro { display: none; }
  .shop-tile__arrow { width: 24px; height: 24px; opacity: 1; }
  .shop-tile__arrow svg { width: 11px; height: 11px; }
  .detail-thumb { width: 64px; height: 64px; }
  .detail-topline { padding: 18px 20px 0; gap: 12px; }
  .detail-shell { min-height: auto; }
  .detail-stage-wrap { flex: 0 0 auto; padding: 12px 12px; justify-content: center; }
  .detail-stage-track { gap: 8px; justify-content: center; }
  .detail-stage-center { width: 78vw; height: 56vh; max-width: 90vw; }
  .detail-stage-center--landscape { width: 88vw; height: auto; aspect-ratio: 16 / 9; max-width: 90vw; }
  .detail-stage-side { display: none; }
  .detail-arrow { width: 44px; height: 44px; }
  .detail-arrow svg { width: 20px; height: 20px; }
  .detail-text { padding: 20px 20px 64px; }
  :root { --gutter: 20px; }
}

/* ---------- Focus states ---------- */

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
