/* Kokomo Display Lab — galerie light. */
:root {
  --bg: oklch(0.985 0.002 140);
  --surface: #FFFFFF;
  --ink: oklch(0.24 0.015 160);
  --ink-muted: oklch(0.46 0.015 160);
  --line: oklch(0.9 0.006 140);
  --accent: #0E5A45;            /* vert Kokomo */
  --accent-soft: oklch(0.95 0.025 165);

  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --z-nav: 10;
  --z-dialog: 20;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { text-wrap: balance; }
a { color: var(--accent); }
main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter) 5rem;
}

/* ---------- nav ---------- */
/* Sentinelle : quand elle sort du viewport, la nav passe en mode compact. */
.scroll-sentinel {
  position: absolute;
  top: 0;
  width: 1px;
  height: 40px;
  pointer-events: none;
}
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--gutter);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  min-height: 140px;
  transition: padding 0.25s var(--ease-out), border-color 0.25s, min-height 0.25s var(--ease-out);
}
/* logo centré dans la barre, CTA à droite */
.wordmark {
  display: flex;
  align-items: center;
}
.wordmark:hover img { opacity: 0.82; }
.wordmark:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 8px;
}
/* retour Kokomo à gauche, contact à droite */
.nav-back {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s var(--ease-out);
}
.nav-back:hover { transform: translateX(-3px); }
.nav-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.nav-back-arrow { font-size: 1.15rem; line-height: 1; font-weight: 600; }
.nav-back img { display: block; width: 22px; height: auto; }

.nav-contact {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out);
}
.nav-contact:hover { transform: scale(1.1) rotate(-4deg); }
.nav-contact:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.nav-contact img { display: block; width: 56px; height: auto; }
.wordmark img {
  display: block;
  width: 240px;
  height: auto;
  transition: width 0.25s var(--ease-out), opacity 0.2s ease-out;
}
.nav.is-scrolled { padding-top: 0.45rem; padding-bottom: 0.45rem; border-bottom-color: var(--line); min-height: 90px; }
.nav.is-scrolled .wordmark img { width: 150px; }
.nav-cta {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), background 0.2s;
}
.nav-cta:hover { transform: translateY(-1px); background: oklch(0.42 0.09 165); }
.nav-cta:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- onglets : deux de chaque côté du logo ---------- */
.sections {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 3.5rem;
  flex: 1;
}
.sections-group { display: flex; gap: 2.2rem; }
.sections-group--left { justify-content: flex-end; }
.sections-group--right { justify-content: flex-start; }
.section-link {
  position: relative;
  padding: 0.3rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.section-link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease-out);
}
.section-link:hover { color: var(--ink); }
.section-link:hover::after, .section-link.is-active::after { transform: scaleX(1); }
.section-link.is-active { color: var(--ink); }
.section-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
/* Petits écrans : le logo au-dessus, les quatre liens sur une ligne en dessous,
 * retour et contact posés dans les coins. */
@media (max-width: 900px) {
  .nav { justify-content: center; }
  .sections { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.4rem; }
  .sections-group { display: contents; }
  .sections .wordmark { flex-basis: 100%; justify-content: center; order: -1; }
  .wordmark img { width: 200px; }
  .section-link { font-size: 0.92rem; }
  .nav-back { position: absolute; top: 1rem; left: var(--gutter); }
  .nav-contact { position: absolute; top: 0.8rem; right: var(--gutter); }
  .nav-contact img { width: 44px; }
}

/* ---------- intro ---------- */
.intro { padding: clamp(3rem, 7vw, 5.5rem) 0 2.5rem; text-align: center; }
.intro h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.6vw, 3.3rem);
  line-height: 1.06;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .intro h1 { white-space: normal; }
}
.intro h1 em { font-style: normal; color: var(--accent); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Rotation des accroches : lignes empilées dans la même cellule de grille,
 * le padding compense les accents des capitales dans la zone de clip. */
.headline-swap {
  display: inline-grid;
  overflow: hidden;
  padding: 0.18em 0;
  margin: -0.18em 0;
}
.headline {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(1.3em);
  transition: transform 0.65s var(--ease-out), opacity 0.45s ease-out;
}
.headline.is-active { opacity: 1; transform: translateY(0); }
/* Sortie : l'opacité tombe vite pour que les jambages ne laissent pas de
 * résidus dans la zone de clip réservée aux accents. */
.headline.is-leaving {
  opacity: 0;
  transform: translateY(-1.3em);
  transition: transform 0.65s var(--ease-out), opacity 0.25s ease-out;
}
.intro p {
  margin: 1.1rem auto 0;
  max-width: 82ch; /* le sous-titre tient sur 2 lignes équilibrées */
  text-wrap: balance;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ---------- toolbar : mécaniques à gauche, ordre et grille à droite ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 1.8rem;
  border-bottom: 1px solid var(--line);
}

/* pastilles façon sticker : contour encre, ombre portée dure */
.pills { display: flex; flex-wrap: nowrap; gap: 0.4rem; padding: 2px 4px 4px 0; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), background 0.15s, color 0.15s;
}
.pill:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--ink); }
.pill:active:not(:disabled) { transform: none; box-shadow: none; }
.pill.is-active {
  color: #fff;
  background: var(--accent);
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink);
}
.pill:disabled { opacity: 0.35; cursor: not-allowed; }
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }


/* outils : ordre + densité */
.tools { display: flex; align-items: center; gap: 0.35rem; }
.tools-sep { width: 1.5px; height: 22px; margin: 0 0.15rem; background: var(--line); }
.cols { display: flex; gap: 0.35rem; }
.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 38px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 0 0.7rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.18s var(--ease-out);
}
.tool svg { display: block; fill: currentColor; }
.tool:hover { color: var(--ink); border-color: var(--ink); }
.tool:active { transform: scale(0.94); }
.tool.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }
.tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-icon { width: 38px; padding: 0; }
#shuffle-btn svg { fill: none; }
#shuffle-btn svg circle { fill: currentColor; }
#shuffle-btn.is-rolling svg { animation: roll 0.45s var(--ease-out); }
@keyframes roll { from { transform: rotate(-180deg) scale(0.7); } to { transform: none; } }

/* ---------- galerie ---------- */
.gallery {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  padding-top: 1.8rem;
}
.gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.gallery.cols-4 { grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
@media (max-width: 920px) {
  .gallery, .gallery.cols-2, .gallery.cols-3, .gallery.cols-4 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 920px) { .cols, .tools-sep { display: none; } }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.2s;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(20, 40, 32, 0.13);
  border-color: oklch(0.82 0.02 160);
}
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--accent-soft);
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-thumb .play {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 1.1rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s var(--ease-out), background 0.2s, color 0.2s;
}
.card:hover .play { transform: scale(1.08); background: var(--accent); color: #fff; }
.card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.95rem 1.1rem 1.05rem;
}
.card-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.card-meta {
  margin-top: 0.15rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.empty {
  padding: 3rem 0;
  text-align: center;
  color: var(--ink-muted);
  font-weight: 500;
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--gutter) 3rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.92rem;
}
.footer-legal { max-width: 72ch; margin: 0.6rem auto 0; font-size: 0.84rem; }

/* ---------- boutons dialogues ---------- */
.btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.btn:hover, .btn:focus-visible { border-color: var(--accent); color: var(--accent); }
.btn-close { width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%; flex: none; }

/* ---------- modale lecteur ---------- */
.player, .contact {
  border: none;
  padding: 0;
  background: transparent;
  max-width: none;
  max-height: none;
}
.player::backdrop, .contact::backdrop {
  background: rgba(15, 25, 20, 0.55);
  backdrop-filter: blur(3px);
}
/* --player-w est posé en JS d'après le format de la création : la modale
 * s'élargit pour afficher un grand format à sa taille annoncée quand l'écran
 * le permet, et retombe à 720px pour les petits. */
.player {
  width: min(92vw, var(--player-w, 720px));
  margin: auto;
}
.player-inner {
  background: #EEF0F2;   /* fond de scène : détache la création du bandeau blanc */
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}
.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.player-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.player-head p { font-size: 0.9rem; color: var(--ink-muted); font-weight: 500; }
/* Le lien ouvre un nouvel onglet : l'icône l'annonce, sinon le clic semble
 * sans effet puisque rien ne bouge dans l'onglet courant. */
#player-insitu {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
#player-insitu svg { flex: none; opacity: 0.75; }

.player-actions { display: flex; align-items: center; gap: 0.6rem; }
/* boutons icône : Rejouer / Copier le lien */
.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.btn-icon svg { display: block; }
.btn-icon.is-ok { color: var(--accent); border-color: var(--accent); font-weight: 700; }
/* Emplacement de lecture, aux dimensions EXACTES de la création rendue (posées
 * en JS). La délimitation ne vient plus de bandes latérales — qui faussaient les
 * dimensions affichées — mais du fond gris de la modale et de l'ombre portée :
 * une création blanche se détache sans que le cadre mente sur son format. */
.player-frame {
  position: relative;
  margin: 20px auto;
  overflow: hidden;
  background: #101210;
  box-shadow: 0 14px 40px rgba(16, 18, 16, 0.28);
}
.player-frame iframe {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1080px;
  height: 1080px;
  border: 0;
  transform-origin: top center;
}

/* ---------- modale contact ---------- */
.contact {
  width: min(92vw, 560px);
  margin: auto;
}
.contact-inner {
  background: var(--surface);
  border-radius: 18px;
  padding: 1.6rem 1.8rem 1.8rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}
.contact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.contact-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.contact-sub { margin-top: 0.5rem; color: var(--ink-muted); font-size: 0.98rem; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.field { display: block; margin-top: 1.1rem; }
.field span {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.field input, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  resize: vertical;
}
.field input:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.field ::placeholder { color: oklch(0.55 0.01 160); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-submit {
  margin-top: 1.4rem;
  width: 100%;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s var(--ease-out);
}
.contact-submit:hover { background: oklch(0.42 0.09 165); transform: translateY(-1px); }
.contact-submit:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.contact-note.is-error { color: #B4231F; }
.contact-note {
  margin-top: 0.8rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .pills {
    width: calc(100% + var(--gutter));
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-right: calc(var(--gutter) * -1);
    padding-right: var(--gutter);
    mask-image: linear-gradient(to right, #000 85%, transparent);
  }
  .field-row { grid-template-columns: 1fr; }
  .player-head { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .player-actions .btn:not(.btn-close) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
