/* ============================================================
   VOICES OF MAYHT — "The Mix"
   Six people, six channels. Every voice gets a voiceprint
   (a waveform drawn from their own words), and the text is
   "spoken" — words surface one after another as you read.
   Loads after css/style.css.
   ============================================================ */

/* ------------------------------------------------------------
   The desk — a mixing console that doubles as navigation.
   One channel strip per voice: LED meter, fader, tape label.
   ------------------------------------------------------------ */

.desk {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: clamp(2.4rem, 5vw, 4rem);
  padding: 1.2rem;
  border: 1px solid var(--line);
  background: var(--black-soft);
  position: relative;
}

.desk-label {
  position: absolute;
  top: -0.55rem;
  left: 1.2rem;
  padding: 0 0.6rem;
  background: var(--black);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--grey);
}

.ch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.2rem 0.4rem 1rem;
  border: 1px solid transparent;
  background: transparent;
  transition: border-color 0.35s, background 0.35s;
  -webkit-tap-highlight-color: transparent;
}

.ch.on-air { border-color: rgba(145, 199, 61, 0.45); background: var(--black-card); }

@media (hover: hover) {
  .ch:hover { border-color: var(--line); background: var(--black-card); }
}

/* LED meter — 12 segments, lit from the bottom up */
.ch-meter {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  height: 72px;
  justify-content: flex-start;
}

.ch-meter i {
  display: block;
  width: 16px;
  height: 3px;
  background: var(--grey-dark);
  transition: background 0.12s linear, box-shadow 0.12s linear;
}

.ch-meter i.lit { background: var(--green); }
.ch-meter i.lit.peak { background: var(--white); box-shadow: 0 0 6px rgba(244, 243, 239, 0.6); }

/* fader — the cap rides up when the channel is on air */
.ch-fader {
  width: 4px;
  height: 84px;
  background: var(--grey-dark);
  position: relative;
}

.ch-fader b {
  position: absolute;
  left: 50%;
  width: 22px;
  height: 11px;
  margin-left: -11px;
  bottom: calc(var(--lvl, 0) * (100% - 11px));
  background: radial-gradient(circle at 35% 30%, #34332f, #141312 72%);
  border: 1px solid #2c2b29;
  transition: bottom 0.5s var(--ease);
}

.ch-fader b::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  height: 1px;
  background: var(--grey);
}

.ch.on-air .ch-fader b::after { background: var(--green); }

.ch-num {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  color: var(--grey);
}

.ch-name {
  font-family: var(--font-head);
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: var(--white);
  margin-top: -0.5rem;
  text-align: center;
  line-height: 1.1;
}

.ch.on-air .ch-name { color: var(--green); }

/* the empty seventh strip: "you?" */
.ch-you { border: 1px dashed var(--grey-dark); }
.ch-you .ch-name { color: var(--grey); }
@media (hover: hover) { .ch-you:hover { border-style: solid; } }

@media (max-width: 720px) {
  .desk { padding: 0.8rem; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .desk { grid-template-columns: repeat(7, minmax(46px, 1fr)); }
  .ch { padding: 0.9rem 0.2rem 0.8rem; gap: 0.7rem; }
  .ch-meter { height: 50px; gap: 2px; }
  .ch-meter i { width: 12px; }
  .ch-fader { height: 56px; }
  .ch-fader b { width: 18px; margin-left: -9px; }
  .ch-name { font-size: 0.66rem; letter-spacing: 0.1em; }
  .ch-num { font-size: 0.52rem; }
}

/* ------------------------------------------------------------
   A voice — sticky "channel" column + the spoken text
   ------------------------------------------------------------ */

.voices { padding-top: 0; }

.voice {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.4rem, 6vw, 6.5rem);
  align-items: start;
  padding: clamp(4rem, 8vw, 7rem) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 5rem;
}

.voice:first-of-type { border-top: 0; }

.voice-side { position: sticky; top: 6rem; }

.voice-ch {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

/* on-air light: a green dot that emits rings while this voice speaks */
.on-air-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grey-dark);
  flex: none;
  transition: background 0.3s;
}

.voice.on-air .on-air-dot { background: var(--green); box-shadow: 0 0 10px rgba(145, 199, 61, 0.8); }

.on-air-dot::before,
.on-air-dot::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--green);
  opacity: 0;
}

.voice.on-air .on-air-dot::before { animation: ring 1.8s var(--ease) infinite; }
.voice.on-air .on-air-dot::after { animation: ring 1.8s var(--ease) 0.9s infinite; }

@keyframes ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(3.2); opacity: 0; }
}

.voice-ch .status { color: var(--grey); transition: color 0.3s; }
.voice.on-air .voice-ch .status { color: var(--green); }

.voice-name {
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  margin-top: 1.1rem;
  line-height: 0.98;
}

.voice-role {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--grey);
  margin-top: 0.8rem;
  line-height: 1.8;
}

/* the voiceprint card */
.voiceprint {
  margin-top: 1.8rem;
  border: 1px solid var(--line);
  background: var(--black-soft);
  padding: 1rem 1.2rem 1.1rem;
}

.vp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.vp-title {
  font-family: var(--font-head);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--white);
}

.vp-play {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: none;
  border: 1px solid var(--grey-dark);
  color: var(--grey);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  padding: 0.45rem 0.7rem 0.45rem 0.6rem;
  cursor: pointer;
  flex: none;
  transition: color 0.3s, border-color 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.vp-play::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 7px solid currentColor;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
}

.vp-play.playing { color: var(--green); border-color: var(--green); }
.vp-play.playing::before { border: 0; width: 6px; height: 8px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }

@media (hover: hover) { .vp-play:hover { color: var(--white); border-color: var(--green); } }

.vp-canvas {
  display: block;
  width: 100%;
  height: 76px;
  margin-top: 0.9rem;
}

.vp-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--grey);
}

.vp-foot .vp-count { font-variant-numeric: tabular-nums; }

/* the line worth pulling out */
.voice-pull {
  margin-top: 1.8rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--green);
  font-family: var(--font-head);
  text-transform: uppercase;
  font-weight: 600;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  line-height: 1.2;
  color: var(--white);
  --say-end: var(--white);
}

/* ---- the spoken text ---- */

.voice-body { padding-top: 0.3rem; }

.voice-body p {
  color: var(--grey);
  font-size: 1.02rem;
  line-height: 1.8;
  max-width: 62ch;
}

.voice-body p + p { margin-top: 1.3rem; }

.voice-body .q {
  margin: 1.4rem 0 1.4rem 1.6rem;
  font-family: var(--font-head);
  text-transform: uppercase;
  font-size: 1.25rem;
  color: var(--white);
  --say-end: var(--white);
}

.voice-sign {
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--green);
}

/* each word surfaces like it's being said */
.w { display: inline-block; }

.say .w {
  opacity: 0.14;
  transform: translateY(0.18em);
}

.say.spoken .w {
  animation: say 0.85s var(--ease) both;
  animation-delay: var(--d, 0ms);
}

@keyframes say {
  0%   { opacity: 0.14; transform: translateY(0.18em); color: var(--white); }
  35%  { opacity: 1; transform: translateY(0); color: var(--white); }
  100% { opacity: 1; transform: translateY(0); color: var(--say-end, var(--grey)); }
}

/* ---- Lars's extras: fun facts + the quotes he wrote down ---- */

.extras { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 2.2rem; }

.extras h3 {
  font-size: 1.25rem;
  margin-bottom: 1.2rem;
}

.extras h3 small {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  color: var(--grey);
  text-transform: uppercase;
}

.facts-list { list-style: none; }

.facts-list li {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.8rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  max-width: 62ch;
}

.voice-body .facts-list li p { font-size: 0.96rem; line-height: 1.75; }

.facts-list li::before {
  content: counter(fact, decimal-leading-zero);
  counter-increment: fact;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--green);
  padding-top: 0.35rem;
}

.facts-list { counter-reset: fact; }

.bites { list-style: none; margin-top: 0.4rem; display: grid; gap: 0.8rem; }

.bite {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 1.1rem;
  align-items: start;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--line);
  background: var(--black-soft);
  transition: border-color 0.3s;
}

.bite .v-eq.live { height: 22px; margin-top: 0.35rem; }
.bite .v-eq.live i { animation-play-state: paused; }
.bite.spoken .v-eq.live i, .bite:hover .v-eq.live i { animation-play-state: running; }
@media (hover: hover) { .bite:hover { border-color: var(--green); } }

.bite blockquote {
  font-family: var(--font-head);
  text-transform: uppercase;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--white);
  --say-end: var(--white);
}

.bite cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--grey);
}

/* ------------------------------------------------------------
   Add your voice
   ------------------------------------------------------------ */

.add-voice {
  border: 1px solid var(--line);
  background: var(--black-soft);
  padding: clamp(2rem, 5vw, 3.5rem);
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  scroll-margin-top: 5rem;
}

.add-voice .v-eq.live { margin-bottom: 1.2rem; }

/* ------------------------------------------------------------
   Small screens
   ------------------------------------------------------------ */

@media (max-width: 860px) {
  .voice { grid-template-columns: 1fr; gap: 2rem; }
  .voice-side { position: static; }
  .voice-pull { display: none; }              /* the quote returns inline below */
  .voice-pull.voice-pull--inline { display: block; margin: 0 0 1.8rem; }
}

@media (min-width: 861px) {
  .voice-pull--inline { display: none; }
}

/* ------------------------------------------------------------
   Reduced motion: everything readable, nothing moving
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .say .w, .say.spoken .w { opacity: 1; transform: none; animation: none; }
  .voice.on-air .on-air-dot::before, .voice.on-air .on-air-dot::after { animation: none; }
  .ch-fader b { transition: none; }
  .bite .v-eq.live i { animation: none; }
}
