.screen-tour .section__head {
  margin-bottom: 2rem;
}

.screen-topics,
.screen-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.screen-topics {
  margin-bottom: 1.4rem;
}

.screen-topics button,
.screen-options button,
.screen-viewer button,
.screen-original {
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 2rem;
  font-size: 0.875rem;
  line-height: 1.3;
}

.screen-topics button:hover,
.screen-options button:hover,
.screen-viewer button:hover,
.screen-original:hover {
  border-color: var(--pearl);
}

.screen-topics button[aria-pressed='true'],
.screen-options button[aria-pressed='true'] {
  color: var(--ink);
  background: var(--pearl);
  border-color: var(--pearl);
}

.screen-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.7fr);
  align-items: center;
  gap: clamp(1.4rem, 4vw, 4rem);
  padding: clamp(1.4rem, 4vw, 3.3rem);
  border: 1px solid var(--line-2);
  border-radius: 1.5rem;
  background:
    radial-gradient(ellipse at 90% 90%, #594956 0, transparent 67%),
    linear-gradient(112deg, #211f26 10%, #34303b 60%, #42363c);
}

.screen-panel + .screen-panel {
  margin-top: 1rem;
}

.screen-tour [hidden] {
  display: none;
}

.screen-copy h3 {
  font-size: clamp(1.9rem, 3.1vw, 3rem);
  line-height: 1.1;
  text-wrap: balance;
}

.screen-copy p {
  margin-top: 1rem;
  color: #dfd9dc;
  line-height: 1.65;
}

.screen-options {
  margin-top: 1.4rem;
}

.screen-stage {
  position: relative;
  min-width: 0;
  padding: 3% 4% 6%;
}

.screen-stage--pair {
  padding: 5% 11% 11% 2%;
}

.screen-device {
  position: relative;
  display: block;
  cursor: zoom-in;
  isolation: isolate;
}

.screen-device img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--paper);
}

.screen-device--laptop {
  padding: 1.15% 1.05% 2%;
  border-radius: 2.6% 2.6% 1% 1% / 4% 4% 1.5% 1.5%;
  background: #131315;
  box-shadow:
    0 0 0 1px #77747a,
    0 14px 28px #100b1959;
}

.screen-device--laptop img {
  border-radius: 1.2% / 2%;
}

.screen-device--laptop::after {
  content: '';
  position: absolute;
  width: 110%;
  height: 2.8%;
  left: -5%;
  bottom: -2%;
  border-radius: 3px 3px 5% 5% / 25% 25% 75% 75%;
  background: linear-gradient(
    90deg,
    #908b90,
    #e2dfe1 4%,
    #bfbac0 40%,
    #948e96 42%,
    #948e96 58%,
    #bfbac0 60%,
    #e2dfe1 96%,
    #908b90
  );
  box-shadow: 0 3px 2px #15121788;
}

.screen-device--phone {
  position: absolute;
  z-index: 1;
  width: 22%;
  right: 0;
  bottom: 1%;
  padding: 0.8%;
  border-radius: 15% / 7%;
  background: #151418;
  box-shadow:
    0 0 0 1px #a39da4,
    -5px 8px 16px #15101966;
}

.screen-device--phone img {
  border-radius: 12% / 6%;
}

.screen-tour :focus-visible {
  outline: 3px solid var(--azure);
  outline-offset: 4px;
}

.screen-viewer {
  width: fit-content;
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: 1rem;
  margin: auto;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  color: var(--text);
  background: var(--bg-2);
}

.screen-viewer::backdrop {
  background: rgb(4 4 7 / 90%);
}

body:has(.screen-viewer[open]) {
  overflow: hidden;
}

.screen-viewer__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.screen-viewer__bar h3 {
  max-width: 38rem;
  font-size: clamp(1rem, 2vw, 1.4rem);
}

.screen-viewer__canvas img {
  width: auto;
  margin: auto;
  max-height: calc(100dvh - 12rem);
  object-fit: contain;
}

.screen-original {
  display: inline-flex;
  align-items: center;
  margin-top: 0.75rem;
}

@media (max-width: 860px) {
  .screen-panel {
    grid-template-columns: 1fr;
  }

  .screen-stage {
    width: 100%;
    max-width: 42rem;
    margin-inline: auto;
  }
}

@media (max-width: 540px) {
  .screen-topics button,
  .screen-options button {
    padding-inline: 0.8rem;
  }

  .screen-panel {
    padding: 1.25rem;
    gap: 1.1rem;
  }

  .screen-viewer {
    max-width: calc(100vw - 1rem);
    padding: 0.75rem;
  }
}

.screen-tour {
  padding-top: clamp(32px, 5vh, 64px);
}

.screen-tour .section__head h2 {
  margin-top: 0;
}

.screen-hint {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 540px) {
  .screen-stage {
    grid-row: 1;
  }
}
