:root {
  color-scheme: light;
  --ink: #312b31;
  --muted: #756b72;
  --paper: rgba(255, 251, 253, 0.94);
  --paper-strong: #fffafd;
  --line: rgba(104, 76, 92, 0.12);
  --rose: #f7a8c8;
  --rose-light: #fbd4e4;
  --plum: #87586d;
  --plum-dark: #694254;
  --blue: #168bd0;
  --blue-dark: #0f6fa9;
  --shadow: 0 18px 60px rgba(99, 53, 75, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 26%, rgba(255, 255, 255, 0.52) 0 3px, transparent 4px),
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.38) 0 5px, transparent 6px),
    radial-gradient(circle at 75% 76%, rgba(255, 255, 255, 0.42) 0 3px, transparent 4px),
    linear-gradient(155deg, #f6b2cf 0%, #f3a0c5 48%, #eda5dc 100%);
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  content: "";
  filter: blur(2px);
  opacity: 0.32;
  pointer-events: none;
}

body::before {
  top: 8rem;
  left: -12rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent 68%);
}

body::after {
  right: -12rem;
  bottom: 1rem;
  background: radial-gradient(circle, rgba(177, 117, 195, 0.5), transparent 68%);
}

a {
  color: inherit;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  min-height: 96px;
  display: grid;
  place-items: center;
  padding: 22px 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--plum-dark), #a46a83);
  border-radius: 0 0 30px 30px;
  box-shadow: 0 14px 40px rgba(92, 52, 71, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #5dd9ff;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: rgba(61, 207, 255, 0.13);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.content {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 30px;
}

.intro {
  margin: 0 0 24px;
  color: var(--plum-dark);
  text-align: center;
}

.eyebrow,
.section-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.intro h1,
.section-heading h2,
.downloads-title-row h2 {
  margin: 0;
  line-height: 1.25;
}

.intro h1 {
  font-size: clamp(2rem, 6vw, 3.1rem);
  letter-spacing: -0.04em;
}

.intro p {
  margin: 10px 0 0;
  color: rgba(80, 55, 68, 0.82);
  font-size: 1rem;
}

.video-guide {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
  margin: 0 auto 24px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  box-shadow: 0 14px 38px rgba(99, 53, 75, 0.12);
  backdrop-filter: blur(10px);
}

.video-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgba(35, 23, 30, 0.78);
  backdrop-filter: blur(5px);
}

body.video-expanded {
  overflow: hidden;
}

.video-guide.is-expanded {
  position: fixed;
  z-index: 100;
  inset: 24px;
  display: flex;
  width: min(920px, calc(100% - 48px));
  max-height: calc(100vh - 48px);
  flex-direction: column;
  margin: auto;
  background: var(--paper-strong);
  box-shadow: 0 28px 90px rgba(25, 13, 20, 0.42);
}

.video-guide.is-expanded video {
  min-height: 0;
  flex: 1 1 auto;
  max-height: none;
}

.video-guide.is-expanded .video-hint {
  flex: 0 0 auto;
}

.video-guide-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 13px;
}

.video-guide-heading h2 {
  margin: 0;
  color: var(--plum-dark);
  font-size: 1.12rem;
  line-height: 1.25;
}

.expand-video {
  display: inline-flex;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  border: 0;
  border-radius: 10px;
  box-shadow: 0 7px 16px rgba(15, 111, 169, 0.2);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.expand-video:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 111, 169, 0.27);
}

.expand-video:focus-visible {
  outline: 3px solid rgba(15, 111, 169, 0.3);
  outline-offset: 3px;
}

.expand-video svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.video-guide video {
  display: block;
  width: 100%;
  max-height: 270px;
  background: #171417;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  object-fit: contain;
}

.video-hint {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.5;
  text-align: center;
}

.troubleshooting,
.downloads {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.troubleshooting {
  padding: clamp(22px, 5vw, 34px);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.section-icon {
  display: grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--blue-dark);
  background: #e8f6ff;
  border-radius: 14px;
}

.section-icon svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.section-heading h2,
.downloads-title-row h2 {
  color: var(--plum-dark);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
}

.check-list {
  display: grid;
  gap: 13px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.check-list li {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: start;
  gap: 11px;
  color: #494046;
  font-size: 0.96rem;
  line-height: 1.65;
  counter-increment: steps;
}

.check-list li::before {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #61b9e7);
  border-radius: 50%;
  content: counter(steps);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.downloads {
  margin-top: 20px;
  padding: clamp(22px, 5vw, 30px);
}

.downloads-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.link-note {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.download-card {
  position: relative;
  display: grid;
  min-height: 78px;
  grid-template-columns: 44px 1fr 24px;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 7px 20px rgba(84, 52, 67, 0.07);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.download-card::after {
  position: absolute;
  right: -45px;
  bottom: -70px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(31, 157, 219, 0.07);
  content: "";
  transition: transform 180ms ease;
}

.download-card:hover {
  z-index: 1;
  transform: translateY(-3px);
  border-color: rgba(22, 139, 208, 0.38);
  box-shadow: 0 13px 28px rgba(78, 48, 62, 0.13);
}

.download-card:hover::after {
  transform: scale(1.22);
}

.download-card:focus-visible {
  outline: 3px solid rgba(15, 111, 169, 0.35);
  outline-offset: 3px;
}

.app-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  border-radius: 13px;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.app-icon.nicegram {
  background: linear-gradient(145deg, #6b8cff, #3a58cb);
}

.app-icon.ime {
  background: linear-gradient(145deg, #f270b7, #9847ba);
}

.app-icon.swiftgram {
  background: linear-gradient(145deg, #44cfae, #168d9e);
}

.app-icon.telegram {
  background: linear-gradient(145deg, #41b7ed, #168bd0);
}

.app-icon.telegram svg {
  width: 23px;
  fill: currentColor;
}

.card-copy {
  min-width: 0;
}

.card-copy strong,
.card-copy small {
  display: block;
}

.card-copy strong {
  overflow: hidden;
  color: #433941;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.73rem;
}

.card-arrow {
  position: relative;
  z-index: 1;
  color: var(--blue-dark);
  font-size: 1.05rem;
  font-weight: 700;
}

.utility {
  background: linear-gradient(145deg, #fff, #f5fbff);
}

.security-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 18px;
  color: rgba(79, 56, 68, 0.9);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.security-tip p {
  margin: 0;
}

.site-footer {
  margin-top: auto;
  padding: 22px 24px 28px;
  color: rgba(75, 45, 59, 0.7);
  text-align: center;
  font-size: 0.75rem;
}

.site-footer p {
  margin: 4px 0;
}

@media (max-width: 620px) {
  .site-header {
    min-height: 86px;
    border-radius: 0 0 24px 24px;
  }

  .content {
    width: min(100% - 24px, 520px);
    padding-top: 34px;
  }

  .intro {
    margin-bottom: 20px;
  }

  .video-guide {
    margin-bottom: 20px;
    padding: 13px;
    border-radius: 16px;
  }

  .video-guide video {
    max-height: 240px;
  }

  .video-guide.is-expanded {
    inset: 8px;
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    margin: auto;
  }

  .video-guide.is-expanded video {
    max-height: none;
  }

  .troubleshooting,
  .downloads {
    border-radius: 18px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .check-list {
    gap: 11px;
  }

  .downloads-title-row {
    align-items: flex-start;
  }

  .link-note {
    display: none;
  }

  .download-card {
    min-height: 72px;
  }
}

@media (max-width: 520px) {
  .download-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .content {
    width: calc(100% - 18px);
  }

  .troubleshooting,
  .downloads {
    padding: 18px 16px;
  }

  .expand-video span {
    display: none;
  }

  .expand-video {
    width: 38px;
    padding: 8px;
  }

  .section-icon {
    width: 40px;
    height: 40px;
  }

  .check-list li {
    grid-template-columns: 27px 1fr;
    gap: 9px;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
