:root {
  --bg: #f6f9fc;
  --surface: #ffffff;
  --surface-soft: #eef7ff;
  --text: #172033;
  --muted: #5c6b80;
  --line: #dce8f3;
  --primary: #229ed9;
  --primary-dark: #0369a1;
  --green: #0f9f6e;
  --violet: #7357d5;
  --amber: #b7791f;
  --danger: #c2410c;
  --shadow: 0 16px 40px rgba(21, 46, 75, 0.12);
  --shadow-soft: 0 8px 24px rgba(21, 46, 75, 0.08);
  --radius: 8px;
  --header-h: 76px;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #edf7ff 0, #fff 520px, var(--bg) 100%);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  transform: translateY(-150%);
  padding: 10px 14px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(14px);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.site-header.is-scrolled {
  border-color: var(--line);
  box-shadow: 0 4px 18px rgba(21, 46, 75, 0.08);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.08rem;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.94rem;
  font-weight: 800;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--primary-dark);
}

.download-link,
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 850;
}

.download-link,
.primary-action {
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(34, 158, 217, 0.26);
}

.secondary-action {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid var(--line);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
}

.hero {
  padding: 70px 0 64px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.8fr);
  gap: 64px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 900;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
}

h2 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
}

h3 {
  font-size: 1.12rem;
}

p {
  margin: 0;
}

.hero-text {
  max-width: 660px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-media {
  position: relative;
  min-height: 540px;
}

.api-hero {
  padding-bottom: 46px;
}

.api-doc-layout {
  padding-top: 0;
}

.phone-frame {
  margin: 0;
  background: #05070a;
  border: 6px solid #05070a;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.phone-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #eef7ff;
}

.main-shot {
  width: min(290px, 62vw);
  height: 580px;
  margin-left: auto;
  position: relative;
  z-index: 2;
}

.side-shot {
  position: absolute;
  left: 0;
  bottom: 24px;
  width: 210px;
  height: 420px;
  opacity: 0.94;
  transform: rotate(-5deg);
}

.web-shot,
.reference-shot {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.web-shot img,
.reference-shot img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.reference-shot {
  margin-top: 24px;
}

.reference-shot figcaption {
  padding: 12px 16px 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  font-weight: 700;
}

.doc-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  padding-bottom: 80px;
}

.doc-layout > *,
.hero-grid > *,
.step > * {
  min-width: 0;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 22px);
  display: grid;
  gap: 4px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.toc strong {
  margin-bottom: 8px;
}

.toc a {
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-weight: 750;
  font-size: 0.94rem;
}

.toc a:hover,
.toc a.is-active {
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.doc-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  min-width: 0;
}

.doc-section {
  scroll-margin-top: calc(var(--header-h) + 24px);
  min-width: 0;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.doc-section > h2 + p,
.doc-section > p + h2,
.doc-section > h2 + ol,
.doc-section > h2 + ul {
  margin-top: 14px;
}

.doc-section > p:not(.eyebrow) {
  color: var(--muted);
}

.info-grid,
.feature-list,
.warning-grid,
.support-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

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

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

.info-grid article,
.feature-list article,
.warning-grid article,
.support-grid a {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.feature-list article:nth-child(3n + 1) {
  border-top: 3px solid var(--primary);
}

.feature-list article:nth-child(3n + 2) {
  border-top: 3px solid var(--green);
}

.feature-list article:nth-child(3n) {
  border-top: 3px solid var(--violet);
}

.warning-grid article {
  border-top: 3px solid var(--danger);
}

.info-grid p,
.feature-list p,
.warning-grid p {
  color: var(--muted);
  margin-top: 8px;
}

.check-list,
.number-list {
  display: grid;
  gap: 12px;
  padding-left: 1.2rem;
  color: var(--muted);
}

.check-list strong,
.number-list strong {
  color: var(--text);
}

.steps {
  display: grid;
  gap: 20px;
  margin-top: 26px;
}

.api-steps {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.api-step-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.api-step-card p {
  margin-top: 8px;
  color: var(--muted);
}

.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 24px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.step-copy {
  display: grid;
  gap: 12px;
}

.step-copy p {
  color: var(--muted);
}

.step-number {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 900;
}

.step .phone-frame {
  width: min(100%, 260px);
  height: 520px;
  justify-self: center;
}

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

.screen-pair .phone-frame {
  width: 100%;
  height: 430px;
}

.command-box {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius);
  overflow-x: auto;
}

.command-box span {
  color: #93c5fd;
  font-weight: 850;
}

.command-box code {
  white-space: nowrap;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}

.note {
  margin-top: 16px;
  padding: 14px 16px;
  color: #6f4a12 !important;
  background: #fff8e6;
  border: 1px solid #f5d78a;
  border-radius: var(--radius);
  font-weight: 700;
}

.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  overflow: hidden;
}

.faq-item button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 18px;
  text-align: left;
  font-weight: 900;
  cursor: pointer;
}

.faq-item button::after {
  content: "+";
  float: right;
  color: var(--primary-dark);
}

.faq-item.is-open button::after {
  content: "-";
}

.faq-item div {
  display: none;
  padding: 0 18px 18px;
  color: var(--muted);
}

.faq-item.is-open div {
  display: block;
}

.support-grid a {
  display: grid;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
}

.support-grid a:hover {
  border-color: var(--primary);
}

.support-grid span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.86rem;
}

.support-grid strong {
  overflow-wrap: anywhere;
}

.top-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: none;
  min-width: 52px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  font-weight: 900;
}

.top-button.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  min-height: 92px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.footer-inner a {
  color: var(--primary-dark);
}

@media (max-width: 980px) {
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 16px;
    right: 16px;
    display: none;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: grid;
  }

  .nav-toggle {
    display: block;
  }

  .hero-grid,
  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toc strong {
    grid-column: 1 / -1;
  }

  .hero-media {
    min-height: 500px;
  }

  .main-shot {
    margin-inline: auto;
  }

  .side-shot {
    left: calc(50% - 260px);
  }

  .info-grid,
  .warning-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .step {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(1180px, calc(100% - 28px));
  }

  .hero {
    padding: 44px 0 40px;
  }

  .hero-grid {
    gap: 36px;
  }

  h1 {
    font-size: 2.45rem;
  }

  .hero-actions {
    display: grid;
  }

  .hero-actions a {
    width: 100%;
  }

  .hero-media {
    min-height: 410px;
  }

  .web-shot {
    align-self: start;
  }

  .main-shot {
    width: 210px;
    height: 420px;
  }

  .side-shot {
    width: 150px;
    height: 300px;
    left: 2px;
    bottom: 14px;
  }

  .doc-section {
    padding: 22px;
  }

  .toc,
  .feature-list,
  .support-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .step {
    padding: 16px;
  }

  .api-step-card {
    grid-template-columns: 1fr;
  }

  .step .phone-frame {
    height: 460px;
  }

  .screen-pair {
    grid-template-columns: 1fr;
  }

  .screen-pair .phone-frame {
    width: min(100%, 250px);
    height: 500px;
    justify-self: center;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 0;
  }
}

@media (max-width: 420px) {
  .brand small {
    display: none;
  }

  h1 {
    font-size: 2.05rem;
  }

  h2 {
    font-size: 1.7rem;
  }

  .hero-text {
    font-size: 1rem;
  }

  .doc-section {
    padding: 18px;
  }

  .step .phone-frame,
  .screen-pair .phone-frame {
    height: 420px;
  }
}
