:root {
  color-scheme: dark;
  --telescope-void: #020611;
  --telescope-deep: #07142d;
  --telescope-surface: rgba(8, 20, 43, 0.82);
  --telescope-surface-strong: rgba(10, 25, 52, 0.95);
  --telescope-line: rgba(128, 206, 255, 0.18);
  --telescope-line-strong: rgba(128, 206, 255, 0.48);
  --telescope-star: #f5f8ff;
  --telescope-muted: #a6b5cb;
  --telescope-orbit: #4ea1ff;
  --telescope-cyan: #80ceff;
  --telescope-gold: #d7b879;
  --telescope-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  background: var(--telescope-void);
}

body {
  isolation: isolate;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 34%, rgba(31, 112, 224, 0.18), transparent 30rem),
    radial-gradient(circle at 18% 78%, rgba(21, 96, 194, 0.09), transparent 28rem),
    var(--telescope-void);
  color: var(--telescope-star);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  inset: -18px;
  opacity: 1;
  background: url("./telescope-stars.svg") center / cover no-repeat;
  filter: drop-shadow(0 0 1.8px rgba(255, 203, 70, 0.72));
}

body::after {
  background:
    radial-gradient(circle at 50% 31%, transparent 0 12rem, rgba(78, 161, 255, 0.055) 12.1rem 12.18rem, transparent 12.3rem),
    radial-gradient(circle at 50% 31%, transparent 0 18rem, rgba(215, 184, 121, 0.032) 18.1rem 18.16rem, transparent 18.3rem);
}

body > .step,
body > .footer {
  position: relative;
  z-index: 1;
}

.back-link {
  color: var(--telescope-muted);
  transition: color 180ms ease, transform 180ms var(--telescope-ease);
}

.back-link:hover {
  color: var(--telescope-star);
  transform: translateX(-2px);
}

.back-link:focus-visible,
a:focus-visible,
button:focus-visible,
.instructions__title:focus-visible {
  outline: 2px solid var(--telescope-cyan);
  outline-offset: 4px;
}

.step {
  max-width: 590px;
}

.step__screen {
  margin-top: 72px;
}

.step__screen-container {
  top: -72px;
  z-index: 3;
}

.step__screen-wrapper {
  position: relative;
  overflow: visible;
  gap: 24px;
  padding: 42px 30px 34px;
  border: 1px solid var(--telescope-line);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(18, 40, 77, 0.55), rgba(5, 15, 33, 0.9)),
    var(--telescope-surface);
  box-shadow:
    0 34px 90px rgba(0, 3, 12, 0.54),
    0 0 72px rgba(44, 139, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  backdrop-filter: blur(20px) saturate(125%);
}

.step__screen-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.075), transparent 22%, transparent 74%, rgba(78, 161, 255, 0.055));
}

.step__screen-wrapper > * {
  position: relative;
  z-index: 1;
}

.step__screen-logo {
  width: 84px;
  height: 84px;
  border: 1px solid rgba(128, 206, 255, 0.62);
  background: var(--telescope-void);
  box-shadow:
    0 0 0 7px rgba(78, 161, 255, 0.045),
    0 0 38px rgba(78, 161, 255, 0.27);
}

.step__screen-logo:not(:first-child) {
  box-shadow:
    0 0 0 6px rgba(78, 161, 255, 0.035),
    0 0 28px rgba(78, 161, 255, 0.18);
}

.telescope-brand-logo {
  position: relative;
  overflow: visible;
  padding: 3px;
}

.telescope-brand-logo::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(215, 184, 121, 0.16);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  pointer-events: none;
}

.telescope-brand-logo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.step__screen-title {
  max-width: 430px;
  color: var(--telescope-star);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.step__screen-txt {
  max-width: 360px;
  color: var(--telescope-muted);
  font-size: 16px;
  line-height: 1.38;
  opacity: 1;
  text-wrap: pretty;
}

.screen-buttons {
  gap: 10px;
}

.screen-buttons a {
  position: relative;
  min-height: 56px;
  justify-content: space-between;
  overflow: hidden;
  padding: 0 18px;
  border: 1px solid var(--telescope-line);
  border-radius: 14px;
  background: rgba(12, 32, 65, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: #eaf4ff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  transition:
    transform 180ms var(--telescope-ease),
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.screen-buttons a::after {
  content: "↗";
  flex: 0 0 auto;
  display: grid;
  width: 30px;
  height: 30px;
  margin-left: 16px;
  place-items: center;
  color: var(--telescope-cyan);
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

.screen-buttons a:hover {
  border-color: rgba(128, 206, 255, 0.4);
  background: rgba(15, 42, 84, 0.86);
  box-shadow:
    0 10px 30px rgba(1, 12, 35, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.screen-buttons a:active {
  transform: translateY(1px) scale(0.992);
}

.screen-buttons .screen-buttons__import {
  border-color: rgba(151, 218, 255, 0.72);
  background: #247fdc;
  box-shadow:
    0 12px 34px rgba(31, 118, 215, 0.24),
    inset 0 1px 0 rgba(235, 248, 255, 0.24);
  color: #f7fbff;
}

.screen-buttons .screen-buttons__import::before {
  content: none;
}

.screen-buttons .screen-buttons__import::after {
  content: "→";
  border: 1px solid rgba(235, 248, 255, 0.22);
  border-radius: 9px;
  background: rgba(2, 31, 70, 0.28);
  color: #f7fbff;
  font-size: 19px;
}

.screen-buttons .screen-buttons__import:hover {
  border-color: rgba(196, 234, 255, 0.86);
  background: #318ce8;
  box-shadow:
    0 15px 40px rgba(31, 118, 215, 0.3),
    inset 0 1px 0 rgba(235, 248, 255, 0.3);
}

.step__screen-link {
  border-radius: 14px;
}

.step__screen-link-field {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--telescope-line);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  background: rgba(4, 15, 34, 0.76);
  color: var(--telescope-cyan);
  font-size: 14px;
  text-decoration-color: rgba(128, 206, 255, 0.42);
}

.step__screen-link-btn {
  width: 56px;
  height: 56px;
  border: 1px solid var(--telescope-line-strong);
  border-radius: 14px;
  background: linear-gradient(135deg, #1d6fd7, #49afff);
  box-shadow: 0 10px 30px rgba(46, 145, 255, 0.2);
  transition: transform 180ms var(--telescope-ease), box-shadow 180ms ease;
}

.step__screen-link:hover .step__screen-link-btn {
  box-shadow: 0 14px 38px rgba(46, 145, 255, 0.3);
  transform: translateY(-1px);
}

.choose-os,
.app-buttons {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choose-os__item,
.app-buttons__item {
  min-width: 0;
  min-height: 126px;
  justify-content: center;
  padding: 16px 10px 14px;
  border: 1px solid rgba(128, 206, 255, 0.12);
  border-radius: 18px;
  background: rgba(7, 23, 51, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  color: var(--telescope-muted);
  font-size: 15px;
  transition:
    color 180ms ease,
    transform 180ms var(--telescope-ease),
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.choose-os__item:hover,
.app-buttons__item:hover {
  border-color: rgba(128, 206, 255, 0.42);
  background: rgba(13, 40, 80, 0.78);
  box-shadow:
    0 12px 34px rgba(2, 12, 34, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: var(--telescope-star);
  transform: translateY(-2px);
}

.choose-os__item:active,
.app-buttons__item:active {
  transform: translateY(0) scale(0.985);
}

.choose-os__image,
.app-buttons__image {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 0 16px rgba(78, 161, 255, 0.14));
  transition: filter 180ms ease, transform 180ms var(--telescope-ease);
}

.choose-os__image.wide {
  width: 90px;
}

.choose-os__item:hover .choose-os__image,
.app-buttons__item:hover .app-buttons__image {
  filter: drop-shadow(0 0 20px rgba(78, 161, 255, 0.4));
  transform: scale(1.035);
}

.app-buttons__item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.instructions {
  width: 100%;
}

.instructions__title {
  padding: 4px 0;
  color: #dceaff;
  text-decoration-color: rgba(128, 206, 255, 0.46);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

.instructions__title:hover {
  color: #fff;
  text-decoration-color: var(--telescope-cyan);
}

.instructions__feed {
  width: 100%;
  color: #e8f1ff;
  transition: max-height 300ms var(--telescope-ease), margin-top 300ms var(--telescope-ease);
}

.instructions__feed-header {
  max-width: 440px;
  margin-right: auto;
  margin-left: auto;
  color: #dce9f8;
  font-size: 17px;
  line-height: 1.45;
  text-wrap: pretty;
}

.content-block {
  gap: 16px;
  color: #edf5ff;
  font-size: 16px;
  line-height: 1.4;
}

.content-block:not(:last-child) {
  margin-bottom: 40px;
}

.content-block span {
  margin-top: 7px;
  color: var(--telescope-muted);
  line-height: 1.45;
}

.content-block img {
  height: auto;
  max-height: 430px;
  border: 1px solid rgba(128, 206, 255, 0.12);
  border-radius: 14px;
  background: rgba(2, 6, 17, 0.72);
  box-shadow: 0 18px 48px rgba(0, 4, 16, 0.38);
}

.footer__link {
  color: var(--telescope-muted);
  opacity: 0.72;
  text-decoration-color: rgba(166, 181, 203, 0.56);
  text-underline-offset: 4px;
}

.footer__link:hover {
  color: #dceaff;
  opacity: 1;
}

@media (max-width: 640px) {
  body {
    justify-content: flex-start;
    row-gap: 26px;
    padding: 15vh 0 8vh;
  }

  body::before {
    opacity: 1;
  }

  body::after {
    background:
      radial-gradient(circle at 50% 20rem, transparent 0 10rem, rgba(78, 161, 255, 0.05) 10.1rem 10.16rem, transparent 10.3rem),
      radial-gradient(circle at 50% 20rem, transparent 0 15rem, rgba(215, 184, 121, 0.028) 15.1rem 15.16rem, transparent 15.3rem);
  }

  .back-link {
    top: 24px;
    left: 22px;
  }

  .step {
    padding: 0 20px;
  }

  .step__screen-wrapper {
    gap: 22px;
    padding: 40px 29px 30px;
    border-radius: 25px;
    -webkit-backdrop-filter: blur(14px) saturate(118%);
    backdrop-filter: blur(14px) saturate(118%);
  }

  .step__screen-title {
    font-size: 21px;
  }

  .step__screen-txt {
    font-size: 16px;
    line-height: 1.4;
  }

  .screen-buttons a {
    min-height: 54px;
    padding: 0 15px;
    font-size: 15px;
  }

  .screen-buttons a::after {
    margin-left: 12px;
  }

  .choose-os__item,
  .app-buttons__item {
    min-height: 120px;
  }

  .content-block {
    font-size: 15px;
    line-height: 1.42;
  }

  .content-block img {
    border-radius: 11px;
  }
}

@media (max-width: 370px) {
  .step {
    padding: 0 14px;
  }

  .step__screen-wrapper {
    padding-right: 14px;
    padding-left: 14px;
  }

  .screen-buttons a {
    padding-right: 12px;
    padding-left: 12px;
    font-size: 14px;
  }

  .screen-buttons a::after {
    margin-left: 8px;
  }

  .choose-os,
  .app-buttons {
    gap: 9px;
  }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 641px) {
  body::before {
    animation: telescope-star-drift 28s linear infinite alternate;
  }

  .telescope-brand-logo::after {
    animation: telescope-orbit 18s linear infinite;
  }

  @keyframes telescope-star-drift {
    to {
      transform: translate3d(-10px, 8px, 0);
    }
  }

  @keyframes telescope-orbit {
    to {
      transform: rotate(360deg);
    }
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .step__screen-wrapper {
    background: var(--telescope-surface-strong);
  }
}
