/* ===================================================
   STUDIO PAGE
   =================================================== */

.studio-section {
  padding: 0 24px 42px;
  max-width: 960px;
  margin: 0 auto;
  /* display: flow-root plutôt que overflow:hidden : empêche la marge du
     titre de fusionner avec la section précédente sans rogner un futur
     fond plein-largeur. Même logique que .wall-section sur Projets. */
  display: flow-root;
  scroll-margin-top: 90px;
}

/* Même principe que sur Projets : tout l'espacement passe par le padding
   (jamais margin), 42px en haut du titre + 42px en bas de la section
   (voir .studio-section) pour un contenu centré dans sa zone. Uniforme
   pour les 3 sections, plus besoin d'exception sur la première. */
.studio-section .section-title {
  border-top: none;
  padding-top: 42px;
  margin-top: 0;
}

.studio-section-desc {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.7;
  margin: -16px 0 28px;
}

.studio-section-desc a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.studio-section-desc a:hover {
  color: var(--accent);
}

/* --- Hero description --- */

.hero-desc {
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.7;
  margin: 72px auto 0;
  max-width: 820px;
  text-align: center;
}

.hero-desc a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-desc a:hover {
  color: var(--accent);
}

.studio-section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  font-weight: 500;
  margin: 0 0 32px;
}

/* --- Video wall --- */

.studio-vid-viewer {
  margin-bottom: 28px;
  position: relative;
}

.studio-vid-viewer[hidden] {
  display: none;
}

.studio-vid-fiche[hidden] {
  display: none;
}

.studio-vid-fiche {
  position: relative;
}

.studio-vid-embed {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.studio-vid-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.studio-vid-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.studio-vid-item {
  position: relative;
}

.studio-vid-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  padding: 0;
  background: var(--bg-alt);
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.studio-vid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.studio-vid-thumb:hover img {
  transform: scale(1.06);
}

.studio-vid-thumb--twitch {
  background: #6441a5;
  display: flex;
  align-items: flex-end;
}

.studio-vid-caption {
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px 7px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  color: var(--text);
}

.studio-vid-item.active .studio-vid-thumb {
  opacity: 0.35;
}

.studio-vid-item.active .studio-vid-thumb img {
  transform: none;
  filter: grayscale(1);
}

/* --- Albums --- */

.studio-album {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.studio-album-cover {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  flex-shrink: 0;
}

.studio-album-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 8px;
}

.studio-album-title {
  font-size: 17px;
  font-weight: 500;
  margin: 0;
  color: var(--text);
}

.studio-album-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

@media (max-width: 600px) {
  .studio-album {
    grid-template-columns: 1fr;
  }
  .studio-album-cover {
    max-width: 200px;
  }
}

.studio-streaming-link {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.studio-streaming-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Placeholder style for todo items --- */

.todo-block {
  opacity: 0.5;
}

/* --- Demo wall --- */

.demo-viewer {
  margin-bottom: 28px;
  position: relative;
}
.demo-viewer[hidden] { display: none; }

.demo-fiche[hidden] { display: none; }
.demo-fiche { position: relative; }

.demo-fiche-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: color 0.15s, border-color 0.15s;
}
.demo-fiche-close:hover {
  color: var(--text);
  border-color: var(--text);
}

.demo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.demo-item { position: relative; }

.demo-item-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  border: 0;
  padding: 0;
  background: var(--bg-alt);
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.demo-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.demo-item-thumb:hover img { transform: scale(1.06); }

.demo-item-caption {
  display: block;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px 7px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  color: var(--text);
}

.demo-item.active .demo-item-thumb {
  opacity: 0.35;
}
.demo-item.active .demo-item-thumb img {
  transform: none;
  filter: grayscale(1);
}

/* --- Interactive demo — style DAW --- */

.studio-demo-intro {
  font-size: 15px;
  color: var(--text-dim);
  margin: 0 0 28px;
  line-height: 1.6;
}

/* Conteneur DAW */
.demo-daw {
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  max-width: 100%;
  margin: 0 0 24px;
  user-select: none;
}

/* Transport */
.demo-transport {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #0e0e0e;
  border-bottom: 1px solid #252525;
  padding: 11px 18px;
}

.demo-transport-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex: 1;
}

.demo-transport-controls {
  display: flex;
  gap: 8px;
}

.demo-btn-play,
.demo-btn-stop {
  padding: 6px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.demo-btn-play {
  background: #142614;
  border: 1px solid #2d5a2d;
  color: #4ade80;
}
.demo-btn-play:not(:disabled):hover {
  background: #22c55e;
  border-color: #22c55e;
  color: #000;
}
.demo-btn-play:disabled { opacity: 0.4; cursor: default; }

.demo-btn-stop {
  background: #261414;
  border: 1px solid #5a2d2d;
  color: #f87171;
}
.demo-btn-stop:not(:disabled):hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
.demo-btn-stop:disabled { opacity: 0.3; cursor: default; }

.demo-status {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Mixer */
.demo-mixer {
  display: flex;
  border-bottom: 1px solid #1e1e1e;
}

.demo-channel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 6px 12px;
  border-right: 1px solid #1e1e1e;
  min-width: 0;
}
.demo-channel:last-child { border-right: 0; }

.demo-ch-top-bar {
  height: 3px;
  width: 80%;
  border-radius: 1px;
  margin-bottom: 10px;
  opacity: 0.65;
}

.demo-ch-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 10px;
  text-align: center;
  line-height: 1.3;
}

/* Zone fader + VU */
.demo-fader-area {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 130px;
  margin-bottom: 8px;
}

/* VU meter */
.demo-vu-meter {
  width: 5px;
  height: 130px;
  background: #080808;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.demo-vu-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  border-radius: 2px;
  transition: height 0.06s linear;
}

/* Fader vertical */
.demo-fader-track {
  width: 22px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demo-fader {
  writing-mode: vertical-lr;
  direction: rtl;
  height: 120px;
  width: 20px;
  cursor: pointer;
  accent-color: var(--fader-color, #555);
  background: transparent;
}
.demo-fader:disabled {
  cursor: default;
  opacity: 0.55;
}

/* Readout volume */
.demo-ch-vol {
  font-size: 12px;
  font-family: 'SF Mono', 'Courier New', monospace;
  color: var(--text);
  min-width: 24px;
  text-align: center;
  margin-bottom: 2px;
}

.demo-ch-label-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* Direction toggle (dans la 3e colonne) */
.demo-dir-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
  width: 100%;
  align-items: center;
}

.demo-dir-pick {
  width: 100%;
  padding: 5px 0;
  border-radius: 3px;
  border: 1px solid #2a2a2a;
  background: #161616;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.demo-dir-pick:not(:disabled):hover {
  background: #222;
  border-color: #555;
  color: #aaa;
}
.demo-dir-pick.active {
  border-color: var(--dir-color, #555);
  color: var(--dir-color, #aaa);
  background: #1a1a1a;
}
.demo-dir-pick:disabled { opacity: 0.25; cursor: default; }

/* One Shots */
.demo-oneshots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 18px 14px;
  border-top: 1px solid #1e1e1e;
}

.demo-oneshots-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.demo-oneshot-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.demo-oneshot-dir-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  min-width: 36px;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: color 0.2s;
}

.demo-oneshot-btn {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid #252525;
  background: #1a1a1a;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.demo-oneshot-btn:not(:disabled):hover {
  background: #242424;
  border-color: #555;
  color: #bbb;
}
.demo-oneshot-btn.firing {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(0.88);
}
.demo-oneshot-btn:disabled {
  opacity: 0.18;
  cursor: default;
}

/* Boutons de transition (démo Spy Game) : même famille visuelle que les
   oneshots, mais largeur libre pour accueillir un libellé texte. */
.demo-transition-btn {
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: rgba(37, 99, 235, 0.14);
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.demo-transition-btn:not(:disabled):hover {
  background: rgba(37, 99, 235, 0.28);
  border-color: var(--accent);
  color: #fff;
}
.demo-transition-btn.firing {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(0.96);
}
.demo-transition-btn:disabled {
  opacity: 0.18;
  cursor: default;
}

/* Timeline défilante */
.demo-timeline {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-alt);
  overflow: hidden;
  height: 120px;
  max-width: 100%;
  margin: 0;
}

.demo-timeline-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Responsive */
@media (max-width: 600px) {
  .studio-videos {
    grid-template-columns: 1fr;
  }

  .demo-daw {
    max-width: 100%;
  }

  .demo-fader-area {
    height: 100px;
  }

  .demo-vu-meter {
    height: 100px;
  }

  .demo-fader {
    height: 90px;
  }

  .demo-fader-track {
    height: 100px;
  }
}
