/* ==========================================================================
   KHON Moni-Paul — Portfolio Créateur visuel / Réalisateur
   Mix éditorial minimaliste (jonathanbertin.com) + titres sharp (gakuyen.com)
   Typographie : Inter (texte courant, About, métadonnées) + Cormorant Garamond (titres projets, menu)
   ========================================================================== */

:root {
  --bg: #FFFFFF;
  --bg-elevated: #F7F7F7;
  --text: #111111;
  --text-muted: #666666;
  --text-soft: #949494;
  --border: rgba(17, 17, 17, 0.12);
  --border-strong: rgba(17, 17, 17, 0.28);

  --font-serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --ease-editorial: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

img,
video {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.empty-note {
  margin: 24px 0 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-soft);
}

/* ==========================================================================
   Header minimaliste en haut à gauche + Cascade de projets
   ========================================================================== */

.site-header {
  position: fixed;
  top: 18px;
  left: 22px;
  z-index: 40;
  max-width: calc(38vw - 24px);
}

.brand-name {
  display: block;
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
}

.comma-nav {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.28;
  color: var(--text);
}

.comma-nav .nav-link {
  transition: opacity 0.2s ease;
}

.comma-nav .nav-link:hover,
.comma-nav .nav-link.is-active {
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* Liste en cascade avec fondu (Personal / Commissioned) */
.cascade-project-list {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cascade-item {
  opacity: 0;
  transform: translateY(6px);
  animation: cascadeFadeIn 0.55s var(--ease-editorial) forwards;
  animation-delay: calc(var(--cascade-i, 0) * 75ms);
}

@keyframes cascadeFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cascade-link {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.3;
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.25s var(--ease-editorial);
}

.cascade-link:hover,
.cascade-link.is-current {
  color: var(--text);
  font-style: italic;
}

.cascade-link.is-current .cascade-title {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.sharp-tag {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* Aperçu à droite au survol de la liste cascade (sans recadrage) */
.cascade-hover-preview {
  position: fixed;
  top: 50%;
  left: 44vw;
  transform: translateY(-50%);
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.24s ease;
}

.cascade-hover-preview.is-visible {
  opacity: 1;
}

.cascade-hover-preview .index-hover-frame img,
.cascade-hover-preview .index-hover-frame video {
  width: auto;
  height: auto;
  max-width: 48vw;
  max-height: 82vh;
  object-fit: contain;
}

/* ==========================================================================
   Colonne principale décentrée à droite (Accueil, Index, About)
   ========================================================================== */

.site-main {
  margin-left: 44vw;
  margin-right: 7vw;
  padding-top: 11.5vh;
  padding-bottom: 14vh;
  max-width: 680px;
}

/* Page Projet entièrement centrée (plein écran sur desktop) */
.site-main.project-page {
  margin: 0 auto;
  padding: 76px 0 0;
  width: 100%;
  max-width: none;
}

@media (min-width: 900px) {
  body[data-page="all"],
  body[data-page="project"] {
    height: 100dvh;
    overflow: hidden;
  }

  .site-main.home-page {
    height: 100dvh;
    padding: 92px 0 32px;
    margin: 0;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
  }

  .home-page .gallery-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .home-page .editorial-grid {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 22px 48px;
    cursor: default;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .home-page .editorial-grid::-webkit-scrollbar {
    display: none;
  }

  .home-page .project-card {
    flex: 0 0 auto;
    width: max-content;
    max-width: none;
  }

  .home-page .card-trigger {
    display: block;
    width: max-content;
  }

  .home-page .card-media {
    width: max-content;
    background: transparent;
  }

  .home-page .card-media img,
  .home-page .card-media video {
    height: clamp(300px, 54vh, 500px);
    width: auto;
    max-width: none;
    max-height: none;
    object-fit: contain;
  }

  .home-page .card-caption-line {
    margin-top: 10px;
  }

  .site-main.project-page {
    height: 100dvh;
    padding: 76px 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  .project-detail-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .detail-media-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* ==========================================================================
   Flux éditorial des œuvres (Accueil)
   ========================================================================== */

.editorial-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14vh;
}

.project-card {
  width: 100%;
  opacity: 0;
  transform: translateY(12px);
  animation: cardReveal 0.7s var(--ease-editorial) forwards;
}

@keyframes cardReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card.is-portrait {
  max-width: 500px;
}

.project-card.is-landscape {
  max-width: 660px;
}

.card-trigger {
  display: block;
  width: 100%;
}

.card-media {
  width: 100%;
  background-color: var(--bg-elevated);
  overflow: hidden;
}

.card-media img,
.card-media video {
  width: 100%;
  height: auto;
  max-height: 84vh;
  object-fit: cover;
  transition: transform 0.85s var(--ease-editorial);
}

.card-trigger:hover .card-media img,
.card-trigger:hover .card-media video {
  transform: scale(1.012);
}

.card-caption-line {
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
  line-height: 1.35;
  color: var(--text);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 19px;
}

.card-caption-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
}

.card-caption-line .card-year {
  color: var(--text-muted);
}

/* ==========================================================================
   Vue Index (archive/ — Différenciation Photo / Film + Aperçu à gauche)
   ========================================================================== */

.index-section {
  padding-bottom: 48px;
}

.index-filter-bar {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.index-filter-btn {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.index-filter-btn:hover,
.index-filter-btn.is-active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.index-table-head,
.index-row-btn {
  display: grid;
  grid-template-columns: 38px minmax(150px, 1.8fr) 74px minmax(96px, 1fr) 52px;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.index-table-head {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.index-table-head span:last-child,
.index-row-btn span:last-child {
  text-align: right;
}

.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.index-item {
  border-bottom: 1px solid var(--border);
}

.index-row-btn {
  padding: 18px 0;
  transition: opacity 0.2s ease, transform 0.3s var(--ease-editorial);
}

.index-row-btn:hover,
.index-row-btn:focus-visible {
  transform: translateX(6px);
}

.index-list:hover .index-item:not(:hover) .index-row-btn {
  opacity: 0.4;
}

.index-num {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.index-title {
  font-family: var(--font-serif);
  font-size: clamp(21px, 1.9vw, 27px);
  line-height: 1.15;
}

.index-cat,
.index-year {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}

.index-year {
  font-variant-numeric: tabular-nums;
}

/* Aperçu fixe à gauche sur /archive/ (sans recadrage) */
.index-hover-preview {
  position: fixed;
  left: 5vw;
  top: 24vh;
  width: auto;
  max-width: 34vw;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.3s var(--ease-editorial);
}

.index-hover-preview.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.index-hover-frame {
  width: auto;
  background: transparent;
  overflow: visible;
}

.index-hover-frame img,
.index-hover-frame video {
  width: auto;
  height: auto;
  max-width: 34vw;
  max-height: 58vh;
  object-fit: contain;
}

/* ==========================================================================
   Pages Projets Centrées (Mix Gakuyen + Jonathan Bertin Impressionism)
   ========================================================================== */

.project-header-compact {
  flex: 0 0 auto;
  max-width: 720px;
  margin: 0 0 18px;
  padding: 0 22px;
  text-align: left;
}

.project-title {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(32px, 3.8vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.project-client-year {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.project-note {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 60ch;
}

/* Lecteur vidéo centré en haut */
.compact-video-stage {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 0 22px;
  margin-bottom: 14px;
}

.compact-video-shell {
  width: 100%;
  background-color: #080808;
  overflow: hidden;
}

.compact-video-shell.is-landscape {
  max-width: min(560px, 60vh);
  aspect-ratio: 16 / 9;
}

.compact-video-shell.is-vertical {
  max-width: min(240px, 24vh);
  aspect-ratio: 9 / 16;
}

.compact-video-shell iframe,
.compact-video-shell video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.compact-video-shell video {
  object-fit: contain;
}

.frames-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.frames-label {
  flex: 0 0 auto;
  margin: 0 0 8px;
  padding: 0 22px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* Rail horizontal aligné sur le header (22px), sans barre de défilement */
.horizontal-strip {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 22px;
  cursor: default;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.horizontal-strip::-webkit-scrollbar {
  display: none;
}

.strip-plate {
  margin: 0;
  flex: 0 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
}

.strip-plate img {
  height: 100%;
  max-height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.project-bottom-nav {
  flex: 0 0 auto;
  width: 100%;
  min-height: 54px;
  max-width: none;
  margin: 0;
  padding: 14px 22px 18px;
  border-top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

/* ==========================================================================
   Page About en 3 colonnes (Bio -> Autres -> Photo, alignée à gauche sous header)
   ========================================================================== */

.site-main.about-page {
  margin-left: 22px;
  margin-right: 4vw;
  padding-top: 110px;
  padding-bottom: 10vh;
  max-width: none;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) minmax(220px, 0.85fr) minmax(240px, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.about-kicker {
  margin: 0 0 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.about-name {
  margin: 0 0 22px;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(26px, 2.8vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.about-paragraph {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.68;
  color: var(--text);
}

.about-paragraph + .about-paragraph {
  margin-top: 16px;
}

.about-col-info {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-col-photo {
  display: flex;
  justify-content: flex-end;
}

.about-portrait {
  width: 100%;
  max-width: 420px;
  height: auto;
  object-fit: contain;
}

.about-portrait-placeholder {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4 / 5;
  border: 1px dashed var(--border-strong);
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-soft);
}

.about-block {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.about-block:first-child {
  padding-top: 0;
  border-top: 0;
}

.about-block-title {
  margin: 0 0 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.about-list,
.about-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-list li {
  font-family: var(--font-sans);
  font-size: 15px;
}

.about-links a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 0;
  font-family: var(--font-sans);
  font-size: 15px;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.about-links a:hover {
  opacity: 0.6;
  transform: translateX(4px);
}

/* ==========================================================================
   Footer discret
   ========================================================================== */

.site-footer {
  margin-left: 44vw;
  margin-right: 7vw;
  max-width: 680px;
}

body[data-page="about"] .site-footer {
  margin-left: 22px;
  margin-right: 4vw;
  max-width: none;
}

body[data-page="project"] .site-footer {
  margin: 0 auto;
  max-width: 760px;
  padding: 0 24px;
}

.footer-inner {
  padding: 22px 0 40px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}

.footer-copy {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--text);
}

/* ==========================================================================
   Responsive (Tablette & Mobile)
   ========================================================================== */

@media (max-width: 899px) {
  .site-header {
    position: sticky;
    top: 0;
    left: 0;
    max-width: none;
    padding: 16px 20px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
  }

  .brand-name,
  .comma-nav {
    font-size: 18px;
  }

  .cascade-project-list {
    margin-top: 14px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 14px;
  }

  .cascade-link {
    font-size: 16px;
  }

  .cascade-hover-preview,
  .index-hover-preview {
    display: none;
  }

  body[data-page="personal"] .site-header,
  body[data-page="commissioned"] .site-header {
    position: static;
    border-bottom: 0;
  }

  body[data-page="personal"] .cascade-project-list,
  body[data-page="commissioned"] .cascade-project-list {
    margin-top: 28px;
    flex-direction: column;
    gap: 10px;
  }

  body[data-page="personal"] .cascade-link,
  body[data-page="commissioned"] .cascade-link {
    font-size: 18px;
  }

  .site-main,
  .site-main.about-page,
  .site-footer,
  body[data-page="about"] .site-footer {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    padding-left: 20px;
    padding-right: 20px;
  }

  .site-main,
  .site-main.about-page {
    padding-top: 28px;
    padding-bottom: 64px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-col-photo {
    justify-content: flex-start;
  }

  .site-main.home-page,
  .site-main.project-page {
    padding-top: 32px;
    padding-bottom: 48px;
    padding-left: 0;
    padding-right: 0;
  }

  .home-page .editorial-grid {
    flex-direction: column;
    gap: 48px;
    overflow: visible;
    padding: 0 20px;
  }

  .home-page .card-media img,
  .home-page .card-media video {
    width: 100%;
    height: auto;
  }

  .editorial-grid {
    gap: 48px;
  }

  .project-card.is-portrait,
  .project-card.is-landscape {
    max-width: 100%;
  }

  .index-table-head {
    display: none;
  }

  .index-row-btn {
    grid-template-columns: 34px 1fr auto;
    gap: 8px 12px;
  }

  .index-cat {
    display: none;
  }

  .horizontal-strip {
    padding: 0 20px;
    gap: 10px;
  }

  .strip-plate {
    height: auto;
  }

  .strip-plate img {
    height: 52vh;
    max-height: none;
  }

  .frames-section .strip-plate img {
    height: 34vh;
  }

  .project-bottom-nav {
    padding: 20px 20px 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
