/* 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 {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  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: 232px;
  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: 140px; }
.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; }

/* ---------- 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 : filtres + tri + affichage sur UNE ligne ---------- */
.toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1rem 0 1.6rem;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 1120px) {
  .toolbar { flex-wrap: wrap; }
}
.pills { display: flex; flex-wrap: nowrap; gap: 0.4rem; }
.pill {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.pill:hover { color: var(--ink); border-color: var(--ink-muted); }
.pill.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.pill:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.selects { display: flex; flex-wrap: nowrap; gap: 0.8rem; }
.select-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}
.select-wrap select {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}
.select-wrap select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- 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));
  }
}

/* sélecteur de densité 2 / 3 / 4 */
.cols-wrap { gap: 0.3rem; }
.col-btn {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.col-btn:hover { color: var(--ink); border-color: var(--ink-muted); }
.col-btn.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.col-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 920px) { .cols-wrap { 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 {
  width: min(92vw, 720px);
  margin: auto;
}
.player-inner {
  background: var(--surface);
  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;
  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; }
.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; }
.player-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #101210;
}
.player-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1080px;
  height: 1080px;
  border: 0;
  transform-origin: top left;
}

/* ---------- 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) {
  .toolbar { flex-direction: column; align-items: flex-start; }
  .pills, .selects { width: 100%; max-width: 100%; }
  .selects { flex-wrap: wrap; gap: 0.6rem 1rem; }
  .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; }
}
