/* ==========================================================================
   MyCloudGame / YiLink website v2 - "Signal Horizon" design system
   Implements website-visual-design.md sections 4-10. Dark single theme.
   ========================================================================== */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo-latin-var.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/plex-mono-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/plex-mono-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens (visual doc section 4) ---------- */
:root {
  /* base / night */
  --bg-0: #060d17;
  --bg: #09121f;
  --bg-1: #0c1928;
  --bg-2: #10223366;
  --line: #a7cfff24;
  --line-strong: #a7cfff3d;

  /* text */
  --text: #e9f3ff;
  --text-soft: #e9f3ffb8;
  --text-dim: #e9f3ff73;
  --text-on-accent: #04202f;

  /* brand + semantics */
  --accent: #86d7ff;
  --accent-hi: #b3e5ff;
  --accent-dim: #86d7ff29;
  --accent-strong: #e0a14a;
  --success: #68d9ac;
  --danger: #ff7b7b;
  --focus: #b3e5ff;

  /* depth: tinted soft shadows only, no glow */
  --shadow-1: 0 1px 2px #02060bcc;
  --shadow-2: 0 12px 32px -12px #02060bb3;
  --shadow-cta: 0 6px 20px -6px #86d7ff40;

  /* shape discipline: 10 / 16 / 22 only */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  /* type scale */
  --fs-display: clamp(2.25rem, 4vw, 3.35rem);
  --fs-h2: clamp(1.75rem, 3vw, 2.5rem);
  --fs-h3: 1.25rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-mono: 0.8125rem;

  --font-display: 'Archivo', 'Avenir Next', 'Gill Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --font-zh: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;

  --header-h: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 78% -10%, #1b4a6e38, transparent 60%),
    radial-gradient(900px 480px at 12% 8%, #12395a2e, transparent 60%),
    radial-gradient(1400px 300px at 50% 118%, #e0a14a14, transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { padding: 0; list-style: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
}
h1 {
  font-size: var(--fs-display);
  font-stretch: 125%;
  letter-spacing: -0.01em;
  line-height: 1.08;
}
h2 { font-size: var(--fs-h2); line-height: 1.15; }
h3 { font-size: var(--fs-h3); line-height: 1.3; }
p { color: var(--text-soft); max-width: 65ch; }
em { line-height: 1.1; }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}
pre {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
}
pre code { background: none; border: 0; padding: 0; }

/* technical annotation / eyebrow */
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
}
.eyebrow { margin-bottom: 18px; }
.eyebrow .dot { color: var(--accent); }

/* ---------- Utilities ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
.section { padding: 96px 0; }
.section-head { margin-bottom: 48px; }
.section-head p { margin-top: 14px; }

/* signature horizon light band */
.horizon {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg,
    transparent, #86d7ff59 30%, #86d7ff 50%, #86d7ff59 70%, transparent);
}
.horizon-breathe { animation: horizon-breathe 4s ease-in-out infinite; }
@keyframes horizon-breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* engineering grid texture: paint on ::before layers only, never in scrollers */
.grid-texture { position: relative; }
.grid-texture::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(#a7cfff08 1px, transparent 1px),
    linear-gradient(90deg, #a7cfff08 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(70% 70% at 50% 40%, #000 30%, transparent 100%);
}

/* scroll reveal: IO adds .revealed (see js/analytics.js) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--d, 0) * 60ms);
}
.reveal.revealed { opacity: 1; transform: none; }

/* ---------- Buttons (visual doc 7.1) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease,
    background-color 180ms ease, border-color 180ms ease, filter 180ms ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, #9edfff, #6ec6f5);
  color: var(--text-on-accent);
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover { color: var(--text-on-accent); filter: brightness(1.06); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); }
.btn[disabled],
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.35);
  transform: none;
  box-shadow: none;
  pointer-events: none;
}
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--accent-dim); color: var(--text); }
.btn-sm { padding: 9px 16px; font-size: var(--fs-small); }

.btn-text {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  padding: 0;
}
.btn-text:hover { color: var(--accent-hi); }
.btn-text .arrow { display: inline-block; transition: transform 180ms ease; }
.btn-text:hover .arrow { transform: translateX(4px); }

/* ---------- Header (visual doc 7.2) ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  transition: background-color 200ms ease;
}
.site-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent, #86d7ff59 30%, #86d7ff 50%, #86d7ff59 70%, transparent);
  opacity: 0.9;
  transition: opacity 200ms ease;
}
.site-header.is-scrolled {
  background: rgba(9, 18, 31, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.site-header.is-scrolled::after { opacity: 0.35; }
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.01em;
  color: #fff;
  flex-shrink: 0;
}
.brand:hover { color: #fff; }
.main-nav > ul { display: flex; gap: 4px; }
.main-nav a {
  display: inline-block;
  padding: 8px 12px;
  color: var(--text-soft);
  font-size: var(--fs-small);
  border-radius: var(--radius-sm);
  transition: color 160ms ease, background-color 160ms ease;
}
.main-nav a:hover { color: var(--text); background: var(--accent-dim); }
.main-nav a.is-active { color: var(--accent); }
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Browse dropdown */
.browse { position: relative; }
.browse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: var(--fs-small);
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  transition: color 160ms ease, background-color 160ms ease;
}
.browse-toggle:hover { color: var(--text); background: var(--accent-dim); }
.browse-toggle .chev { transition: transform 180ms ease; }
.browse.open .browse-toggle .chev,
.browse:focus-within .browse-toggle .chev { transform: rotate(180deg); }
.browse-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 300px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
}
.browse:hover .browse-panel,
.browse:focus-within .browse-panel,
.browse.open .browse-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.browse-item {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  transition: background-color 160ms ease;
}
.browse-item:hover { background: var(--accent-dim); }
.browse-item .browse-item-title {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-small);
}
.browse-item .browse-item-desc {
  display: block;
  color: var(--text-dim);
  font-size: var(--fs-mono);
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 2px;
}

/* language switch pill (one of the two legal pill shapes) */
.lang-pill {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}
.lang-pill a {
  padding: 5px 12px;
  font-size: var(--fs-mono);
  font-family: var(--font-mono);
  color: var(--text-dim);
  transition: color 160ms ease, background-color 160ms ease;
}
.lang-pill a:hover { color: var(--text); }
.lang-pill a.is-current { background: var(--accent-dim); color: var(--accent); }

/* hamburger (mobile) */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.nav-toggle:hover { background: var(--accent-dim); }

/* mobile drawer */
.mobile-drawer {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  z-index: 49;
  background: rgba(6, 13, 23, 0.97);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 24px 20px 32px;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-drawer.is-open { display: flex; }
.mobile-drawer a.drawer-link {
  display: block;
  padding: 14px 8px;
  font-size: 1.0625rem;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.mobile-drawer .drawer-group-label {
  margin: 20px 8px 6px;
}
.mobile-drawer .drawer-console { margin-top: auto; padding-top: 24px; }
.mobile-drawer .drawer-console .btn { width: 100%; }
.mobile-drawer .lang-pill { margin: 18px 8px 0; }

body.drawer-open { overflow: hidden; }

/* ---------- Cards (visual doc 7.3) ---------- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 28px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}
.card h3 { margin-bottom: 10px; }
.card p { font-size: var(--fs-small); }
.card .card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--accent);
  margin-bottom: 18px;
}
.card .btn-text { margin-top: 16px; font-size: var(--fs-small); }

/* asymmetric 2x2 grid: first cell spans two rows */
.grid-everyone {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
}
.grid-everyone > .card-tall { grid-row: span 2; display: flex; flex-direction: column; }
.grid-everyone > .card-wide { grid-column: 1 / -1; }
.grid-everyone .card-tall p { font-size: var(--fs-body); }

/* 1 wide + 2 narrow row */
.grid-1w2n {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 20px;
}
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* placeholder slot for visual assets pending real screenshots */
.shot-slot {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background:
    radial-gradient(120% 100% at 50% 0%, #10223380, transparent 70%),
    var(--bg-1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  aspect-ratio: 16 / 10;
}
.shot-slot .shot-slot-label { text-align: center; padding: 12px; }

/* ---------- Steps (visual doc 7.4) ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0;
  counter-reset: step;
}
.steps > li {
  position: relative;
  padding: 0 28px;
}
.steps > li + li::before {
  content: '';
  position: absolute;
  top: 30px;
  left: -10px;
  width: 20px;
  border-top: 1px dashed var(--line-strong);
}
.steps > li:last-child::after {
  content: '\2192';
  position: absolute;
  top: 18px;
  right: -6px;
  color: var(--text-dim);
}
.step-num {
  display: block;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: 64px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.steps h3 { margin-bottom: 8px; }
.steps p { font-size: var(--fs-small); }

/* vertical variant (Gamespace band, docs) */
.steps-vertical {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.steps-vertical > li {
  position: relative;
  padding: 0 0 28px 56px;
}
.steps-vertical > li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 40px;
  bottom: 4px;
  border-left: 1px dashed var(--line-strong);
}
.steps-vertical .step-num {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1rem;
  font-stretch: normal;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  margin: 0;
  background: var(--bg-1);
}

/* ---------- Pricing (visual doc 7.5) ---------- */
.billing-toggle {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.billing-toggle button {
  border-radius: 999px;
  padding: 7px 18px;
  font-size: var(--fs-small);
  color: var(--text-dim);
  transition: background-color 160ms ease, color 160ms ease;
}
.billing-toggle button[aria-pressed='true'] {
  background: var(--accent-dim);
  color: var(--accent);
}
.billing-toggle .save-tag {
  color: var(--accent-strong);
  font-size: var(--fs-mono);
  font-family: var(--font-mono);
  margin-left: 6px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.plan-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 28px;
  display: flex;
  flex-direction: column;
}
.plan-featured {
  border-radius: var(--radius-lg);
  border-color: var(--line-strong);
  position: relative;
  padding-top: 36px;
}
.plan-price {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 600;
  font-size: 2.25rem;
  line-height: 1.1;
  color: var(--text);
  margin: 14px 0 2px;
  white-space: nowrap;
  min-height: 2.5rem; /* one line, uniform across cards */
}
.plan-price .price-period {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-left: 2px;
}
.plan-featured .plan-price { font-size: 2.75rem; }
.plan-cycle { font-size: var(--fs-small); color: var(--text-dim); }
.plan-feats { margin: 20px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.plan-feats li {
  position: relative;
  padding-left: 24px;
  font-size: var(--fs-small);
  color: var(--text-soft);
}
.plan-feats li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.plan-desc {
  font-size: var(--fs-small);
  color: var(--text-soft);
  margin: 14px 0 0;
  line-height: 1.5;
  height: 63px; /* fixed height so the benefits list starts aligned across cards */
  overflow: hidden;
}
.plan-card .btn { margin-top: auto; }
[data-pricing] .price-yearly { display: none; }
[data-pricing].is-yearly .price-yearly { display: inline; }
[data-pricing].is-yearly .price-monthly { display: none; }

/* Plans row: 4 flat columns — YiLink Free (individual) + Free / Starter / Pro. */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}
.plan-individual {
  border-color: #86d7ff4d;
  background: linear-gradient(180deg, rgba(134, 215, 255, 0.06), transparent);
}
@media (max-width: 900px) {
  .plans-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .plans-grid { grid-template-columns: 1fr; }
}

.enterprise-card { width: 100%; }

/* ---------- Compare table (visual doc 7.6) ---------- */
.compare-wrap { overflow-x: auto; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}
.compare-table th, .compare-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
}
.compare-table thead th {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text);
  border-bottom-color: var(--line-strong);
}
.compare-table th:first-child,
.compare-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--bg);
  color: var(--text-soft);
}
.compare-table .col-yilink { background: var(--accent-dim); }
.compare-table .cell-yes { color: var(--accent); }
.compare-table .cell-no { color: var(--text-dim); }
.compare-cards { display: none; }

/* ---------- FAQ accordion (visual doc 7.7) ---------- */
.faq-wrap { max-width: 48rem; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  padding: 20px 4px;
  font-weight: 600;
  color: var(--text);
  transition: color 160ms ease;
}
.faq-q:hover { color: var(--accent-hi); }
.faq-icon {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  transition: transform 200ms ease;
}
.faq-icon::before, .faq-icon::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 1px;
  width: 16px;
  height: 1.5px;
  background: var(--accent);
}
.faq-icon::after { transform: rotate(90deg); }
.faq-q[aria-expanded='true'] .faq-icon { transform: rotate(45deg); }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-q[aria-expanded='true'] + .faq-a { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; }
.faq-a-inner p { padding: 0 4px 22px; font-size: var(--fs-small); }

/* ---------- Forms (visual doc 7.8) ---------- */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: var(--fs-small);
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 2px #86d7ff33;
}
.field .field-error { color: var(--danger); font-size: var(--fs-small); margin-top: 6px; }
.field textarea { min-height: 120px; resize: vertical; }

/* feedback list entries */
.feedback-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.feedback-item .feedback-title { color: var(--text); font-weight: 600; font-size: var(--fs-small); }
.feedback-item time { margin-left: auto; }

/* ---------- Badges (visual doc 7.9) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-cyan { color: var(--accent); border-color: #86d7ff3d; }
.badge-amber { color: var(--accent-strong); border-color: #e0a14a3d; }
.badge-green { color: var(--success); border-color: #68d9ac3d; }
.badge-plain::before { display: none; }

/* ---------- Hero (visual doc 8.1) ---------- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 32px) 0 72px;
  overflow: hidden;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: 48px;
  align-items: center;
}
.hero-sub { font-size: 1.125rem; margin-top: 22px; }
.hero-cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-visual { position: relative; }
.hero-visual .shot-slot {
  border-radius: var(--radius-lg);
  border-style: solid;
  border-color: var(--line);
  min-height: 320px;
}
.hero-visual .horizon { position: absolute; left: 8%; right: 8%; bottom: -1px; }
.hero-visual img { border-radius: var(--radius-lg); border: 1px solid var(--line); height: auto; }

/* metric strip */
.metric-row {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  padding: 28px 0;
}
.metric .metric-num {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--text);
}
.metric .metric-label { font-size: var(--fs-mono); }

/* Gamespace dark narrative band */
.band-dev {
  position: relative;
  background: var(--bg-0);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 96px 0;
  overflow: hidden;
}
.band-dev-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: start;
}
.band-dev-copy p { margin-top: 18px; }
.band-dev-copy .btn-text { margin-top: 26px; }

/* bottom CTA */
.cta-final { text-align: center; padding: 112px 0; }
.cta-final h2 { margin-bottom: 30px; }

/* ---------- Footer (visual doc 7.10) ---------- */
.site-footer { background: var(--bg-0); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 64px 0 48px;
}
.footer-brand .brand { display: inline-block; margin-bottom: 14px; }
.footer-brand p { font-size: var(--fs-small); color: var(--text-dim); max-width: 34ch; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-soft); font-size: var(--fs-small); }
.footer-col a:hover { color: var(--accent-hi); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 22px 0 28px;
}
.footer-bottom p { font-size: var(--fs-mono); color: var(--text-dim); max-width: none; }

/* ---------- 404 (visual doc 7.11) ---------- */
.notfound {
  min-height: 70dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--header-h) + 48px) 20px 80px;
}
.notfound .notfound-code {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 600;
  font-size: 120px;
  line-height: 1;
  color: var(--text-dim);
}
.notfound p { margin: 18px 0 30px; }

/* ---------- Docs / content pages ---------- */
.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 72ch) 1fr;
  gap: 56px;
  padding-top: calc(var(--header-h) + 56px);
  padding-bottom: 96px;
}
.doc-content h2 { margin-top: 56px; }
.doc-content h2:first-child { margin-top: 0; }
.doc-content p, .doc-content li { color: var(--text-soft); }
.doc-content ul { list-style: disc; padding-left: 22px; }
.doc-content li { margin-bottom: 6px; }
.doc-toc {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  align-self: start;
  font-size: var(--fs-small);
}
.doc-toc a { display: block; padding: 5px 0; color: var(--text-dim); }
.doc-toc a.is-current { color: var(--accent); }

/* ---------- Chinese mirror typography (visual doc 5.3) ---------- */
:lang(zh) body, :lang(zh) .doc-content li { font-size: 1.0625rem; line-height: 1.75; }
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3,
:lang(zh) .brand, :lang(zh) .plan-price, :lang(zh) .step-num,
:lang(zh) .notfound-code, :lang(zh) .compare-table thead th {
  font-family: var(--font-zh);
  font-stretch: normal;
  letter-spacing: 0.02em;
}
:lang(zh) .hero-sub { font-size: 1.125rem; }
/* mono technical annotations stay latin in zh pages by design */

/* ---------- Responsive (visual doc 10) ---------- */
@media (max-width: 1280px) {
  .container { padding: 0 32px; }
}
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-copy { max-width: 620px; }
  .band-dev-grid { grid-template-columns: 1fr; gap: 48px; }
  .pricing-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid .plan-featured { grid-column: span 2; order: -1; }
  .doc-layout { grid-template-columns: minmax(0, 72ch); }
  .doc-toc { display: none; }
}
@media (max-width: 900px) {
  .main-nav, .header-actions .browse, .header-actions > .btn, .header-actions > .lang-pill {
    display: none;
  }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .section { padding: 64px 0; }
  .hero { padding-bottom: 56px; }
  .hero-visual { order: 2; }
  .grid-everyone, .grid-1w2n, .grid-2col, .pricing-grid { grid-template-columns: 1fr; }
  .grid-everyone > .card-tall { grid-row: auto; }
  .pricing-grid .plan-featured { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .cta-final { padding: 80px 0; }
  /* steps collapse to vertical timeline */
  .steps { grid-template-columns: 1fr; }
  .steps > li { padding: 0 0 32px 56px; }
  .steps > li + li::before, .steps > li:last-child::after { display: none; }
  .steps > li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 40px;
    bottom: 4px;
    border-left: 1px dashed var(--line-strong);
  }
  .steps .step-num {
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1rem;
    font-stretch: normal;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: var(--font-mono);
    margin: 0;
    background: var(--bg-1);
  }
  /* compare table switches to stacked cards (dual markup) */
  .compare-wrap { display: none; }
  .compare-cards { display: grid; gap: 20px; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
  .plans-grid-2 { grid-template-columns: 1fr; }
  .metric-row { gap: 28px; }
}

/* ---------- Reduced motion: full static fallback (visual doc 6) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .horizon-breathe { animation: none; }
}

/* ==========================================================================
   Page-specific blocks (download / changelog / gamespace / pricing / support)
   ========================================================================== */

/* compact subpage head */
.page-head { padding: calc(var(--header-h) + 72px) 0 8px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-head .page-sub { margin-top: 16px; font-size: 1.0625rem; }
.page-head .meta-row {
  margin-top: 22px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

/* download */
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dl-card { display: flex; flex-direction: column; }
.dl-card .dl-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 14px 0 22px;
  color: var(--text-dim);
  font-size: var(--fs-mono);
  font-family: var(--font-mono);
}
.dl-card .btn { margin-top: auto; }
.note-band {
  display: flex;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  padding: 18px 22px;
}
.note-band p { margin: 0; font-size: var(--fs-small); }

/* changelog timeline */
.timeline { max-width: 56rem; }
.timeline-item {
  position: relative;
  padding: 0 0 44px 36px;
  border-left: 1px solid var(--line);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}
.timeline-item .timeline-date { display: block; margin-bottom: 6px; }
.timeline-item h2 { font-size: 1.375rem; margin-bottom: 12px; }
.timeline-item ul { list-style: none; }
.timeline-item li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: var(--fs-small);
}
.timeline-item li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 1px;
  background: var(--line-strong);
}

/* gamespace hero: left copy / right fact column */
.gs-hero { padding: calc(var(--header-h) + 72px) 0 80px; }
.gs-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 64px;
  align-items: start;
}
.fact-list { margin-top: 8px; }
.fact-list li { border-top: 1px solid var(--line); padding: 18px 0; }
.fact-list li:last-child { border-bottom: 1px solid var(--line); }
.fact-list .fact-label { display: block; margin-bottom: 6px; }
.fact-list p { font-size: var(--fs-small); margin: 0; }

/* problem -> solution pair */
.ps-grid {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  gap: 20px;
  align-items: stretch;
}
.ps-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.5rem;
}
.ps-before { opacity: 0.72; }
.ps-after { border-color: #86d7ff3d; }
.ps-card h3 { margin-bottom: 10px; }
.ps-card p { font-size: var(--fs-small); }

/* funnel chain (mono event flow) */
.funnel-chain {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.06em;
  color: var(--accent);
  overflow-x: auto;
  white-space: nowrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-0);
  margin-top: 14px;
}

/* capability / scenario grids */
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.scenario-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }

/* pricing boundary note */
.pricing-note {
  max-width: 56rem;
  margin: 56px auto 0;
  text-align: center;
}
.pricing-note p { margin: 0 auto; font-size: var(--fs-small); color: var(--text-dim); }

/* support */
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.contact-card .contact-value { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--accent); word-break: break-all; margin-top: 14px; }
.contact-card .contact-action { margin-top: 14px; }
.contact-card .contact-action .btn-text { margin-top: 0; }
.qr-img { width: 180px; border-radius: var(--radius-sm); border: 1px solid var(--line); margin-top: 14px; }
.wechat-row { display: flex; align-items: flex-start; gap: 14px; margin-top: 0; }
.wechat-row .wechat-info { flex: 1 1 0; min-width: 0; }
.wechat-row .qr-img {
  flex: 0 0 auto;
  width: clamp(120px, 32vw, 150px);
  height: auto;
  aspect-ratio: 1;
  margin-top: 0;
}
.feedback-list { margin-top: 8px; }
.status-badge { flex-shrink: 0; }
.feedback-note { font-size: var(--fs-mono); color: var(--text-dim); margin-top: 14px; }

/* blog placeholder / empty state */
.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 72px 32px;
  text-align: center;
}
.empty-state p { margin: 12px auto 0; max-width: 46ch; }
.empty-glyph {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

/* compare mobile cards */
.compare-cards .card h3 { display: flex; align-items: center; justify-content: space-between; }
.compare-cards dl { margin-top: 12px; }
.compare-cards .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-small);
}
.compare-cards .row:last-child { border-bottom: 0; }
.compare-cards .row dt { color: var(--text-dim); }
.compare-cards .row dd { color: var(--text-soft); text-align: right; }

@media (max-width: 1024px) {
  .gs-hero-grid { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 768px) {
  .dl-grid, .cap-grid, .scenario-grid, .support-grid, .contact-grid { grid-template-columns: 1fr; }
  .ps-grid { grid-template-columns: 1fr; }
  .ps-arrow { transform: rotate(90deg); padding: 4px 0; }
  .page-head { padding-top: calc(var(--header-h) + 48px); }
}

/* grid items must be allowed to shrink below intrinsic width (e.g. shot-slot
   aspect-ratio 16/10 x min-height 320px implies a 512px min-content width) */
.hero-grid > *, .band-dev-grid > *, .gs-hero-grid > *, .grid-everyone > *,
.grid-1w2n > *, .grid-2col > *, .dl-grid > *, .cap-grid > *, .scenario-grid > *,
.support-grid > *, .contact-grid > *, .pricing-grid > *, .ps-grid > *,
.compare-cards > *, .doc-layout > *, .steps > *, .footer-grid > * {
  min-width: 0;
}
.shot-slot { min-width: 0; max-width: 100%; }

/* ---------- Two-path cards (copy revision: how-it-works / 3-minute setup) ---------- */
.grid-paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.path-card:hover { transform: none; }
.path-card .eyebrow { margin-bottom: 12px; }
.path-card h3 { margin-bottom: 22px; }
.path-card h4 {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
/* steps inside a path card: always the vertical numbered variant */
.path-card .steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.path-card .steps > li {
  position: relative;
  padding: 0 0 24px 52px;
}
.path-card .steps > li:last-child { padding-bottom: 0; }
.path-card .steps > li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 17px;
  top: 40px;
  bottom: 4px;
  border-left: 1px dashed var(--line-strong);
}
.path-card .steps > li + li::before,
.path-card .steps > li:last-child::after { display: none; }
.path-card .steps > li:not(:last-child)::after { display: block; }
.path-card .steps .step-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--accent);
  background: var(--bg-1);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-stretch: normal;
  letter-spacing: 0.05em;
  margin: 0;
}
.path-card .steps p { font-size: var(--fs-small); }

/* PWA hint line under the hero CTAs */
.hero-pwa-hint {
  margin-top: 16px;
  text-transform: none;
  letter-spacing: 0.03em;
  font-weight: 400;
}
.grid-everyone .card-media { margin-top: 22px; width: 100%; height: auto; border-radius: var(--radius-md); border: 1px solid var(--line); }
.hero-credit { margin-top: 10px; font-size: 12px; color: var(--text-dim); }
.feedback-item-click { cursor: pointer; }
.feedback-item-click:hover .feedback-title { text-decoration: underline; }
.fb-reply { margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--line-strong); background: rgba(255,255,255,.03); border-radius: 4px; }
.fb-reply-label { font-size: var(--fs-mono); color: var(--text-dim); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .06em; }
.fb-reply-text { font-size: var(--fs-body); color: var(--text-soft); white-space: pre-wrap; }
.plans-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.plans-grid-2 .plan-card { display: flex; flex-direction: column; }
