/*
 * Turemi website — one stylesheet for every page.
 * Static only: no JavaScript, remote fonts or third-party assets. Colours are tokens on :root and are
 * redefined for dark mode, so components never hard-code a theme colour.
 */

:root {
  color-scheme: light dark;

  --brand: #0067ff;
  --brand-strong: #0052cc;
  --brand-ink: #0057d9;
  --brand-soft: #e9f1ff;
  --brand-line: #c9dcff;
  --on-brand: #ffffff;

  --bg: #f6f8fc;
  --bg-tint: #eef4ff;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --ink: #0b1526;
  --ink-2: #3d4a63;
  --ink-3: #5c6880;
  --line: #e2e7f0;
  --line-strong: #cfd7e4;

  --shadow-sm: 0 1px 2px rgba(15, 30, 60, 0.06), 0 1px 1px rgba(15, 30, 60, 0.04);
  --shadow-md: 0 12px 32px -12px rgba(16, 42, 92, 0.18), 0 2px 6px rgba(16, 42, 92, 0.06);
  --shadow-lg: 0 40px 80px -32px rgba(0, 62, 158, 0.35), 0 12px 28px -12px rgba(16, 42, 92, 0.18);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC",
    "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --page: 1160px;
  --read: 720px;
  --gutter: 24px;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #0067ff;
    --brand-strong: #2b7fff;
    --brand-ink: #7cb0ff;
    --brand-soft: rgba(0, 103, 255, 0.16);
    --brand-line: rgba(124, 176, 255, 0.32);

    --bg: #0a0e16;
    --bg-tint: #0d1626;
    --surface: #111826;
    --surface-2: #172133;
    --ink: #eef2f8;
    --ink-2: #b7c1d3;
    --ink-3: #8f9bb2;
    --line: #222c3e;
    --line-strong: #2e3a50;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 16px 36px -16px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 40px 80px -32px rgba(0, 0, 0, 0.8), 0 12px 28px -12px rgba(0, 40, 110, 0.45);
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a {
  color: var(--brand-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: rgba(0, 103, 255, 0.22);
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

p {
  margin: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom-color: var(--line);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header {
    background: var(--bg);
  }
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  flex: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
}

.brand-cn {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 15px;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.button-primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 8px 20px -8px rgba(0, 103, 255, 0.6);
}

.button-primary:hover {
  background: var(--brand-strong);
}

.button-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--brand-line);
  background: var(--brand-soft);
}

@media (prefers-reduced-motion: no-preference) {
  .button:hover {
    transform: translateY(-1px);
  }
}

/* ---------- Home: hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 88px;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(0, 103, 255, 0.16), transparent 70%),
    radial-gradient(700px 420px at -10% 20%, rgba(0, 103, 255, 0.07), transparent 70%),
    var(--bg);
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 14px;
  font-weight: 600;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(0, 103, 255, 0.18);
}

.hero h1 {
  font-size: clamp(38px, 5.4vw, 60px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.06;
}

.hero h1 .accent {
  color: var(--brand);
}

@media (prefers-color-scheme: dark) {
  .hero h1 .accent {
    color: var(--brand-ink);
  }
}

.lede {
  max-width: 34em;
  margin-top: 22px;
  color: var(--ink-2);
  font-size: clamp(17px, 1.7vw, 19px);
  line-height: 1.65;
}

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

.hero-note {
  margin-top: 20px;
  color: var(--ink-3);
  font-size: 14px;
}

/* Illustrative, neutral Android-style phone drawn in HTML/CSS (centered punch-hole camera, not a real screenshot). */

.phone-figure {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin: 0;
  width: min(340px, 100%);
}

.illustration-note {
  position: relative;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 8% 6% 4%;
  border-radius: 48px;
  background: linear-gradient(160deg, rgba(0, 103, 255, 0.22), rgba(0, 103, 255, 0));
  filter: blur(40px);
}

.phone {
  position: relative;
  width: min(340px, 100%);
  padding: 9px;
  border-radius: 34px;
  background: linear-gradient(160deg, #1b2436, #0b111c);
  box-shadow: var(--shadow-lg);
}

.phone-screen {
  overflow: hidden;
  border-radius: 26px;
  background: var(--surface);
  padding: 12px 16px 22px;
}

.phone-status {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 2px 8px 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.phone-status .camera {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #0b111c;
  box-shadow: inset 0 0 0 3px #1f2a3d;
}

.phone-status .bars {
  justify-self: end;
  display: inline-flex;
  gap: 3px;
  align-items: flex-end;
}

.phone-status .bars i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: var(--ink);
}

.phone-status .bars i:nth-child(1) { height: 5px; }
.phone-status .bars i:nth-child(2) { height: 7px; }
.phone-status .bars i:nth-child(3) { height: 9px; }
.phone-status .bars i:nth-child(4) { height: 11px; }

.phone-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 4px 14px;
}

.phone-title strong {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.lang-pill svg {
  width: 12px;
  height: 12px;
}

.mock-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.mock-card + .mock-card {
  margin-top: 12px;
}

.mock-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mock-label .chip {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  letter-spacing: 0.02em;
  text-transform: none;
  font-weight: 600;
}

.mock-source {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

.mock-divider {
  height: 1px;
  margin: 10px 0;
  background: var(--line);
}

.mock-target {
  color: var(--brand);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

@media (prefers-color-scheme: dark) {
  .mock-target {
    color: var(--brand-ink);
  }
}

.mock-caption {
  position: relative;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(10, 16, 28, 0.92);
  color: #eef2f8;
}

.mock-caption .mock-label {
  color: #9fb0cc;
}

.mock-caption .mock-source {
  color: #c9d3e4;
  font-size: 14px;
}

.mock-caption .mock-target {
  color: #ffffff;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ddc84;
}

.float-bubble {
  position: absolute;
  right: -14px;
  bottom: 120px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 14px 30px -10px rgba(0, 103, 255, 0.7);
  border: 3px solid var(--surface);
}

.float-bubble svg {
  width: 26px;
  height: 26px;
  color: #fff;
}

/* ---------- Home: sections ---------- */

.section {
  padding: 96px 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-kicker {
  margin-bottom: 12px;
  color: var(--brand-ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head h2 {
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 720;
  letter-spacing: -0.03em;
}

.section-head p {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 18px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-alt .feature {
  background: var(--bg);
}

.feature-wide {
  grid-column: span 3;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
}

@media (prefers-color-scheme: dark) {
  .feature-icon {
    color: var(--brand-ink);
  }
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature h3 {
  font-size: 20px;
  font-weight: 680;
}

.feature p {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 16px;
}

.feature .fine {
  margin-top: auto;
  padding-top: 14px;
  color: var(--ink-3);
  font-size: 14px;
}

/* Online / offline */

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

.mode {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.mode-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.mode-head h3 {
  font-size: 22px;
}

.mode-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

@media (prefers-color-scheme: dark) {
  .mode-badge {
    color: var(--brand-ink);
  }
}

.mode-badge svg {
  width: 22px;
  height: 22px;
}

.mode-online {
  background:
    linear-gradient(160deg, rgba(0, 103, 255, 0.08), rgba(0, 103, 255, 0) 60%),
    var(--surface);
  border-color: var(--brand-line);
}

.checklist {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 30px;
  color: var(--ink-2);
  font-size: 16px;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.5 2.5L13 6.5' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / 18px no-repeat,
    var(--brand);
}

.mode-foot {
  margin-top: 24px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 16px;
}

/* Privacy at a glance */

.glance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.glance li {
  padding: 24px;
  border-top: 2px solid var(--brand);
  border-radius: 4px 4px var(--radius) var(--radius);
  background: var(--bg);
}

.glance h3 {
  font-size: 17px;
  font-weight: 680;
}

.glance p {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 15px;
}

.glance-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* Contact band */

.contact-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 40px;
  border-radius: 28px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(255, 255, 255, 0.18), transparent 70%),
    linear-gradient(135deg, #0067ff, #0047c2);
  color: #ffffff;
  box-shadow: var(--shadow-lg);
}

.contact-band img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.contact-band h2 {
  color: #ffffff;
  font-size: clamp(24px, 2.6vw, 30px);
}

.contact-band p {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.88);
}

.contact-band .button {
  background: #ffffff;
  color: #0047c2;
  box-shadow: none;
}

.contact-band .button:hover {
  background: #e9f1ff;
}

.contact-band :focus-visible {
  outline-color: #ffffff;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 96px;
  padding: 40px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 15px;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
}

.footer-brand img {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}

/* ---------- Legal pages ---------- */

.doc-hero {
  padding: 64px 0 40px;
  background:
    radial-gradient(800px 360px at 90% -20%, rgba(0, 103, 255, 0.13), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  color: var(--ink-3);
  font-size: 14px;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--line-strong);
}

.breadcrumb a {
  color: var(--ink-3);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}

.doc-hero h1 {
  font-size: clamp(34px, 4.6vw, 52px);
  font-weight: 750;
  letter-spacing: -0.035em;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 16px;
  color: var(--ink-3);
  font-size: 15px;
}

.doc-meta strong {
  color: var(--ink-2);
  font-weight: 600;
}

.doc-switch {
  display: inline-flex;
  margin-top: 28px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.doc-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.doc-switch a[aria-current="page"] {
  background: var(--brand);
  color: var(--on-brand);
}

.doc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, var(--read));
  justify-content: center;
  gap: 64px;
  padding-top: 48px;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding-right: 8px;
}

.toc-title {
  margin-bottom: 12px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 16px;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}

.toc a:hover {
  border-left-color: var(--brand);
  color: var(--ink);
}

.toc-mobile {
  display: none;
}

.doc {
  min-width: 0;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-2);
}

.doc-intro p {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.65;
}

.doc-intro p + p {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 17px;
}

.doc section {
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid var(--line);
}

.doc h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.doc h2 .num {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transform: translateY(-3px);
}

.doc h2 .anchor {
  margin-left: auto;
  color: var(--line-strong);
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
}

.doc h2 .anchor:hover,
.doc h2 .anchor:focus-visible {
  color: var(--brand-ink);
}

.doc p + p,
.doc p + ul,
.doc ul + p,
.doc p + .table-wrap,
.doc .table-wrap + p,
.doc ul + .table-wrap {
  margin-top: 16px;
}

.doc ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.doc ul li {
  position: relative;
  padding-left: 22px;
}

.doc ul li + li {
  margin-top: 10px;
}

.doc ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.doc strong {
  color: var(--ink);
  font-weight: 650;
}

.doc a {
  overflow-wrap: anywhere;
}

/* "At a glance" summary */

.doc section.summary {
  margin-top: 36px;
  padding: 28px 30px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(0, 103, 255, 0.07), rgba(0, 103, 255, 0) 70%),
    var(--surface);
}

.doc section.summary h2 {
  font-size: 20px;
}

.doc section.summary + section {
  border-top: 0;
}

/* Tables become stacked cards on narrow screens. */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}

.doc th,
.doc td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.doc thead th {
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.doc tbody tr:last-child td {
  border-bottom: 0;
}

.doc tbody td:first-child {
  color: var(--ink);
  font-weight: 650;
  white-space: nowrap;
}

.doc-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.doc-end p {
  color: var(--ink-2);
  font-size: 16px;
}

.to-top {
  font-size: 15px;
  font-weight: 600;
}

/* ---------- 404 ---------- */

.not-found {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h) - 200px);
  padding: 80px var(--gutter);
  text-align: center;
}

.not-found .code {
  color: var(--brand-ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.not-found h1 {
  margin-top: 12px;
  font-size: clamp(32px, 4vw, 44px);
}

.not-found p {
  max-width: 30em;
  margin: 16px auto 0;
  color: var(--ink-2);
}

.not-found .hero-actions {
  justify-content: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .feature,
  .feature-wide {
    grid-column: span 3;
  }

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

  .doc-layout {
    grid-template-columns: minmax(0, var(--read));
    gap: 0;
  }

  .toc {
    display: none;
  }

  .toc-mobile {
    display: block;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .toc-mobile summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 20px;
    color: var(--ink);
    font-weight: 650;
    cursor: pointer;
    list-style: none;
  }

  .toc-mobile summary::-webkit-details-marker {
    display: none;
  }

  .toc-mobile summary::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--ink-3);
    border-bottom: 2px solid var(--ink-3);
    transform: rotate(45deg) translateY(-3px);
  }

  .toc-mobile[open] summary::after {
    transform: rotate(-135deg) translateY(-2px);
  }

  .toc-mobile ol {
    margin: 0;
    padding: 4px 8px 12px;
    list-style: none;
    border-top: 1px solid var(--line);
  }

  .toc-mobile a {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--ink-2);
    font-size: 15px;
    text-decoration: none;
  }

  .toc-mobile a:hover {
    background: var(--surface-2);
    color: var(--ink);
  }
}

@media (max-width: 860px) {
  .hero {
    padding: 48px 0 64px;
  }

  .hero .container {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

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

  .contact-band {
    grid-template-columns: minmax(0, 1fr);
    text-align: left;
    padding: 32px 28px;
  }

  .section {
    padding: 72px 0;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --header-h: 58px;
  }

  body {
    font-size: 16px;
  }

  .brand-cn {
    display: none;
  }

  .site-nav a {
    padding: 0 10px;
    font-size: 14px;
  }

  .site-nav .nav-contact {
    display: none;
  }

  .hero-actions .button {
    flex: 1 1 100%;
  }

  .float-bubble {
    right: 4px;
  }

  .feature,
  .feature-wide {
    grid-column: 1 / -1;
    padding: 24px;
  }

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

  .mode {
    padding: 24px;
  }

  .doc-hero {
    padding: 40px 0 32px;
  }

  .doc {
    font-size: 16px;
    line-height: 1.7;
  }

  .doc-intro p {
    font-size: 17px;
  }

  .doc section.summary {
    padding: 22px 20px;
  }

  .doc h2 {
    font-size: 21px;
  }

  .doc h2 .anchor {
    display: none;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .doc table,
  .doc tbody,
  .doc tr,
  .doc td {
    display: block;
    width: 100%;
  }

  .doc thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .doc tbody tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
  }

  .doc tbody tr + tr {
    margin-top: 12px;
  }

  .doc td {
    padding: 4px 18px 12px;
    border: 0;
  }

  .doc tbody td:first-child {
    padding: 14px 18px 10px;
    background: var(--surface-2);
    white-space: normal;
  }

  .doc tbody td + td {
    padding-top: 12px;
  }

  .doc td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .doc tbody td:first-child::before {
    display: none;
  }

  .doc-end {
    padding: 20px;
  }
}

@media (max-width: 400px) {
  .site-nav .nav-features {
    display: none;
  }

  .site-nav a {
    padding: 0 9px;
  }
}

@media (forced-colors: active) {
  .button,
  .feature,
  .mode,
  .table-wrap,
  .toc-mobile {
    border: 1px solid CanvasText;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc,
  .toc-mobile,
  .doc-switch,
  .doc-end,
  .skip-link,
  .doc h2 .anchor {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .doc-layout {
    display: block;
    padding-top: 0;
  }

  .doc a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}
