.hero-with-player .hero-copy {
  max-width: 1000px;
}

.hero.hero-with-player h1 {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(40px, 6.7vw, 84px);
}

.hero-with-player .hero-sub {
  font-size: 19px;
}

.hero-with-player .hero-platform {
  color: #767676;
}

.hero-with-player .btn-primary {
  min-width: 330px;
  justify-content: center;
}

.hero-player-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 54px 0 76px;
  border-top: 1px solid rgba(0, 0, 0, 0.13);
  text-align: left;
}

.hero-player-shell audio {
  display: none;
}

.hero-player-primary {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 112px;
  gap: 36px;
  align-items: center;
}

.hero-player-toggle {
  width: 104px;
  height: 104px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 12px 32px rgba(255, 107, 53, 0.22);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero-player-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(255, 107, 53, 0.3);
}

.hero-player-toggle .material-symbols-rounded {
  font-size: 46px;
}

.hero-player-description {
  max-width: 710px;
  margin-bottom: 18px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.65;
}

.hero-player-no-break {
  white-space: nowrap;
}

.hero-player-waveform {
  position: relative;
  height: 46px;
  overflow: hidden;
}

.hero-player-waveform > img,
.hero-player-waveform-progress img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 46px;
  object-fit: fill;
  pointer-events: none;
}

.hero-player-waveform > img {
  filter: brightness(0.82);
}

.hero-player-waveform-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--player-progress);
  overflow: hidden;
  pointer-events: none;
}

.hero-player-waveform-progress img {
  width: var(--player-track-width, 100%);
  max-width: none;
}

.hero-player-waveform input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.hero-player-time {
  color: var(--text);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.hero-player-options {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr);
  gap: 52px;
  margin-top: 38px;
}

.hero-player-option-group {
  min-width: 0;
  padding: 0;
  border: 0;
}

.hero-player-option-group legend {
  margin-bottom: 11px;
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 500;
}

.hero-player-choice-grid,
.hero-player-speed-grid {
  display: grid;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  background: #fff;
}

.hero-player-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border: 0;
  background: transparent;
}

.hero-player-speed-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.hero-player-choice,
.hero-player-speed {
  min-height: 58px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, color 0.18s, background 0.18s;
}

.hero-player-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  white-space: nowrap;
}

.hero-player-choice .material-symbols-rounded {
  font-size: 21px;
}

/* ── Script strip: the sentence being read scrolls into view, highlighted ── */
.hero-player-script {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 2px 0;
  /* Fade the edges so the strip reads as a continuous ribbon of text. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 88%, transparent);
}

.hero-player-script-track {
  display: flex;
  gap: 10px;
  margin: 0;
  white-space: nowrap;
  will-change: transform;
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.hero-player-sentence {
  flex: none;
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--text-light);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.hero-player-sentence:hover {
  color: var(--text);
}

.hero-player-waveform {
  cursor: pointer;
}

.hero-player-sentence.is-active {
  background: #cfe9f5;
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  .hero-player-script-track {
    transition: none;
  }
}

.hero-player-speed {
  min-width: 0;
  border: 0;
  border-radius: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  font-variant-numeric: tabular-nums;
}

.hero-player-speed:last-child {
  border-right: 0;
}

.hero-player-choice:hover,
.hero-player-speed:hover {
  color: var(--accent-hover);
  background: rgba(255, 107, 53, 0.045);
}

.hero-player-choice.is-selected,
.hero-player-speed.is-selected {
  position: relative;
  z-index: 1;
  color: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 1px var(--accent-hover);
  background: #fff0e8;
}

.hero-player-speed.is-selected {
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--accent-hover);
}

.hero-player-toggle:focus-visible,
.hero-player-choice:focus-visible,
.hero-player-speed:focus-visible,
.hero-player-waveform input[type="range"]:focus-visible {
  outline: 3px solid rgba(255, 107, 53, 0.32);
  outline-offset: 3px;
}

.hero-player-error {
  margin-top: 14px;
  color: #b42318;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 900px) {
  .hero-player-primary {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 24px;
  }

  .hero-player-toggle {
    width: 88px;
    height: 88px;
  }

  .hero-player-time {
    grid-column: 2;
    margin-top: -20px;
  }

  .hero-player-options {
    grid-template-columns: 1fr;
    gap: 26px;
  }
}

@media (max-width: 640px) {
  .hero.hero-with-player h1 {
    font-size: clamp(31px, 9.5vw, 38px);
  }

  .hero-with-player .hero-sub {
    font-size: 15px;
  }

  .hero-with-player .btn-primary {
    min-width: 0;
  }

  .hero-player-shell {
    padding: 34px 0 56px;
  }

  .hero-player-primary {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }

  .hero-player-toggle {
    width: 62px;
    height: 62px;
    margin-top: 4px;
  }

  .hero-player-toggle .material-symbols-rounded {
    font-size: 32px;
  }

  .hero-player-description {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.7;
  }

  .hero-player-waveform,
  .hero-player-waveform > img,
  .hero-player-waveform-progress img {
    height: 36px;
  }

  .hero-player-time {
    margin-top: -12px;
    font-size: 13px;
  }

  .hero-player-options {
    margin-top: 28px;
    gap: 22px;
  }

  .hero-player-choice-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-player-choice {
    min-height: 50px;
    justify-content: flex-start;
    padding: 10px 16px;
    font-size: 14px;
  }

  .hero-player-speed {
    min-height: 50px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-player-toggle,
  .hero-player-choice,
  .hero-player-speed {
    transition: none;
  }
}
