/* Visible study summary — desktop fixed layer; mobile first panel in horizontal desk */

.studyIntroJump {
  display: none;
}

.studyDeskIntro {
  display: none;
}

#desk {
  z-index: 20;
}

@media (min-width: 641px) {
  .studyDeskIntro {
    display: block;
    position: fixed;
    left: 18px;
    top: 92px;
    z-index: 12;
    max-width: min(36ch, calc(100vw - 480px));
    margin: 0;
    padding: 0;
    color: var(--dim);
    font-size: 12px;
    line-height: 1.65;
    pointer-events: none;
  }

  .studyDeskIntroTitle {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fg);
    line-height: 1.25;
  }

  .studyDeskIntro p {
    margin: 0 0 12px;
  }

  .studyDeskIntroLinks {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .studyDeskIntro a {
    color: var(--green);
    pointer-events: auto;
    text-decoration: none;
  }

  .studyDeskIntro a:hover {
    text-decoration: underline;
  }
}

@media (max-width: 640px) {
  body.studies-open .studyIntroJump,
  body.studies-open .studyDeskIntro {
    opacity: 0;
    pointer-events: none;
  }

  .studyIntroJump {
    display: block;
    position: fixed;
    top: 44px;
    left: 12px;
    z-index: 190;
    max-width: calc(100vw - 88px);
    font-size: 10px;
    line-height: 1.45;
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 2px;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    pointer-events: auto;
    padding: 2px 0;
  }

  .studyIntroJump:active {
    opacity: 0.72;
  }

  body.desk-pending .studyIntroJump {
    opacity: 0;
    pointer-events: none;
  }

  .studyDeskIntro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 0 0 min(86vw, 520px) !important;
    width: min(86vw, 520px) !important;
    max-width: min(86vw, 520px) !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    padding: 20px 18px 22px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    color: var(--dim);
    font-size: 12px;
    line-height: 1.65;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.76);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.62);
    z-index: auto;
    flex-shrink: 0;
  }

  .studyDeskIntroTitle {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fg);
    line-height: 1.25;
  }

  .studyDeskIntro p {
    margin: 0 0 12px;
  }

  .studyDeskIntroLinks {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .studyDeskIntro a {
    color: var(--green);
    text-decoration: none;
  }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  .studyIntroJump {
    top: 12px !important;
  }
}
