.project-page {
  --project-space: clamp(38px, 6vw, 82px);
  --project-padding: clamp(20px, 4.4vw, 60px);
  --project-radius: clamp(18px, 2.5vw, 30px);
}

.project-path {
  padding-block: clamp(18px, 3vw, 34px) 14px;
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: 44px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.project-back::before {
  content: "←" / "";
}

.project-back:hover {
  text-decoration: underline;
}

.project-banner {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--project-radius);
  background: linear-gradient(130deg, white 12%, #e9ecfd);
}

.project-banner-copy {
  padding: var(--project-padding);
}

.project-banner h1 {
  max-width: 18ch;
  font-size: clamp(32px, 5.35vw, 70px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.04;
  hyphens: auto;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.voice-banner h1 {
  hyphens: none;
  overflow-wrap: normal;
}

.project-banner-compact .project-banner-copy {
  padding-block: clamp(18px, 3.1vw, 40px);
}

.project-banner-compact h1 {
  max-width: none;
  font-size: clamp(30px, 4.3vw, 55px);
  text-wrap: initial;
}

.project-banner-illustrated {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
  border: 0;
  background: linear-gradient(130deg, #151f57, #26388d);
  color: white;
}

.project-banner-illustrated .project-banner-copy {
  align-self: center;
}

.project-banner-illustrated img {
  width: 100%;
  height: 100%;
  max-height: 465px;
  object-fit: cover;
}

.project-lead {
  max-width: 58ch;
  margin-top: clamp(16px, 2.3vw, 24px);
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 21px);
  line-height: 1.65;
}

.project-banner-illustrated .project-lead {
  color: #e4e9fc;
}

.project-section {
  padding-block: var(--project-space);
}

.project-section h2 {
  font-size: clamp(27px, 4vw, 44px);
}

.education-course {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 4vw, 36px);
}

.education-lesson-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
}

.education-materials-link,
.education-pagination a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-weight: 700;
}

.education-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin-top: 14px;
}

.education-pagination [rel="next"] {
  margin-inline-start: auto;
}

.education-materials {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.education-materials h2 {
  font-size: clamp(22px, 2.25vw, 28px);
}

.education-materials ol {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.education-materials a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.education-materials a:hover {
  text-decoration: underline;
}

.education-materials a[aria-current="page"] {
  border-color: var(--accent);
  background: var(--tint);
  color: var(--accent);
  font-weight: 700;
}

@media (min-width: 1000px) {
  .education-course {
    grid-template-columns: minmax(0, 1fr) clamp(230px, 23vw, 280px);
  }

  .education-materials-link {
    display: none;
  }
}

.education-player-panel {
  margin-top: 16px;
}

.education-player {
  display: block;
  width: 100%;
  height: auto;
  min-height: 420px;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--project-radius);
  background: var(--tint);
}

.education-player-viewport {
  display: contents;
}

.education-player-panel-fixed-viewport {
  container: education-player / inline-size;
}

@supports (transform: scale(calc(1px / 1px))) {
  @container education-player (min-width: 630px) {
    .education-player-panel-fixed-viewport:not(:fullscreen) > .education-player-viewport {
      /* Keep iSpring presentations at a 960 × 640 inner viewport while scaling them to fit. */
      --player-width: 962px;
      --player-height: 642px;
      display: block;
      position: relative;
      overflow: clip;
      aspect-ratio: calc(var(--player-width) / var(--player-height));
    }

    .education-player-panel-fixed-viewport:not(:fullscreen) .education-player {
      position: absolute;
      inset: 0 auto auto 0;
      width: var(--player-width);
      height: var(--player-height);
      transform: scale(calc(100cqw / var(--player-width)));
      transform-origin: top left;
    }
  }
}

.education-player-actions:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 12px;
}

.education-player-panel:fullscreen {
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.education-player-panel:fullscreen .education-player {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 0;
}

.education-player-panel:fullscreen .education-player-actions {
  margin-top: 0;
  padding: 4px 8px;
}

.legal-document {
  max-width: 880px;
  margin-inline: auto;
  padding-block: var(--project-space);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.legal-document h1 {
  font-size: clamp(26px, 3vw, 30px);
  line-height: 1.5;
}

.legal-document h2 {
  margin-block: 2rem 0.75rem;
  font-size: clamp(18px, 2vw, 20px);
  line-height: 1.5;
  text-wrap: initial;
}

.legal-document p,
.legal-document ul {
  margin-block: 0.75rem;
}

.legal-document ul {
  padding-inline-start: 1.5em;
}

.legal-document a {
  color: var(--accent);
}

.project-intro {
  max-width: 74ch;
  margin-top: 17px;
  color: var(--muted);
  font-size: clamp(16px, 1.65vw, 19px);
  line-height: 1.65;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2.2vw, 26px);
  margin-top: 26px;
}

.voice-analogues-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
}

.project-card a,
.project-card-static {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: clamp(17px, 2.4vw, 29px);
}

.project-card a {
  height: 100%;
  border-radius: inherit;
  text-decoration: none;
}

.project-card a:hover {
  background: #fafaff;
}

.project-card h3 {
  font-size: clamp(20px, 2.25vw, 29px);
  letter-spacing: -0.03em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.project-grid-directions h3 {
  overflow-wrap: normal;
  text-wrap: balance;
}

.project-card p:not(.project-status) {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.project-card .project-action {
  margin-top: auto;
  padding-top: 6px;
}

.project-status {
  width: fit-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 10px;
  background: #ece9fb;
  color: #463680;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.project-status-demo {
  background: #e2ebfb;
  color: #263e74;
}

.project-banner .project-status {
  margin-bottom: 18px;
}

.project-band {
  background: var(--tint);
}

.project-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style-position: inside;
}

.project-steps-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.project-steps li {
  padding: clamp(14px, 1.8vw, 20px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  font-weight: 600;
  line-height: 1.55;
}

.project-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.project-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-width: 100%;
  padding: 12px 21px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
}

.project-section > .project-button {
  margin-top: 23px;
}

.project-button:hover:not(:disabled) {
  background: #40309d;
}

button.project-button {
  cursor: pointer;
}

button.project-button:disabled {
  background: #e6e7f4;
  color: #4e5571;
  cursor: default;
}

.speech-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.85fr);
  align-items: start;
  gap: clamp(20px, 4.5vw, 54px);
  padding-top: clamp(20px, 3vw, 38px);
}

.speech-widget,
.image-widget,
.recognition-widget {
  padding: clamp(16px, 3.6vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--project-radius);
  background: white;
}

.speech-widget h2,
.image-widget h2,
.recognition-widget h2 {
  margin-bottom: 20px;
  font-size: clamp(24px, 3vw, 34px);
}

.speech-widget label {
  display: block;
  margin-bottom: 5px;
  font-weight: 700;
}

.speech-widget label + p,
.speech-context p {
  color: var(--muted);
  line-height: 1.6;
}

.speech-widget textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  margin-block: 12px;
  padding: 12px;
  resize: vertical;
  border: 1px solid #adb6d1;
  border-radius: 10px;
  background: #fafbff;
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
}

.speech-widget textarea[aria-invalid="true"] {
  border-color: #a02f4d;
}

.speech-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.speech-counter {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.speech-counter[data-over-limit],
.speech-feedback[data-state="error"] {
  color: #942543;
}

.speech-feedback {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
}

.speech-feedback:empty {
  margin-top: 0;
}

.speech-widget audio:not([hidden]) {
  display: block;
  width: 100%;
  margin-top: 14px;
}

.speech-context {
  padding: clamp(16px, 2.7vw, 30px);
  border-radius: 18px;
  background: var(--tint);
}

.speech-context h2 {
  margin-bottom: 12px;
  font-size: clamp(23px, 2.8vw, 32px);
}

.image-section,
.recognition-section {
  padding-top: clamp(20px, 3vw, 38px);
}

.image-widget,
.recognition-widget {
  max-width: 860px;
}

.image-picker {
  padding: clamp(15px, 2.5vw, 26px);
  border: 1px dashed #9aa7ce;
  border-radius: 14px;
  background: #f6f7fe;
}

.media-file-control {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.media-file-label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid #adb6d1;
  border-radius: 9px;
  background: white;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.media-file-label:hover {
  border-color: var(--accent);
}

.media-file-control:focus-visible + .media-file-label {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.image-picker p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.image-preview[hidden] {
  display: none;
}

.image-preview:not([hidden]) {
  display: block;
  width: 100%;
  max-height: 320px;
  margin-top: 16px;
  border-radius: 12px;
  background: var(--tint);
  object-fit: contain;
}

.image-toolbar {
  margin-top: 16px;
}

.widget-result:not([hidden]) {
  margin-top: 20px;
  padding: clamp(16px, 2.5vw, 26px);
  border-radius: 14px;
  background: var(--tint);
}

.widget-result h3 {
  margin-bottom: 10px;
}

.widget-result p {
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.recognition-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.recognition-choices button {
  font-family: inherit;
  font-size: inherit;
}

.recognition-choices [hidden] {
  display: none;
}

.recognition-choices button:disabled,
.recognition-choices .media-file-control:disabled + .media-file-label {
  color: var(--muted);
  background: var(--tint);
  cursor: default;
}

.recognition-timer {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.recognition-widget audio:not([hidden]) {
  display: block;
  width: 100%;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .project-grid-directions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-steps,
  .project-steps-five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .project-banner-illustrated,
  .project-grid,
  .speech-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-banner-illustrated img {
    height: auto;
    max-height: 300px;
    aspect-ratio: 3 / 2;
  }

  .project-grid-directions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 550px) {
  .project-grid-directions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .project-steps,
  .project-steps-five {
    grid-template-columns: minmax(0, 1fr);
  }
}
