/* RoboRobin — shared styles for all language versions (/ and /zh/). */

:root {
  --bg: #070b14;
  --bg-alt: #0a1020;
  --brand-navy: #0b1830;
  --surface: rgba(18, 28, 48, 0.55);
  --surface-solid: #0e1628;
  --border: rgba(148, 178, 220, 0.14);
  --border-strong: rgba(34, 211, 238, 0.45);
  --text: #e8eef8;
  --muted: #9aa8bf;
  --accent: #22d3ee;
  --accent-ink: #04121a;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --accent-2: #8b5cf6;
  --radius: 14px;
  --header-h: 72px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

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

section[id] {
  scroll-margin-top: var(--header-h);
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
}

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

/* ---------- Labels / type ---------- */

.label,
.panel-label,
.step-index,
.event-meta,
.status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.label {
  color: var(--accent);
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(2.1rem, 8.4vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
  max-width: 16ch;
}

h2 {
  font-size: clamp(1.7rem, 5.6vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h3 {
  font-size: 1.0625rem;
  line-height: 1.35;
  font-weight: 600;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand-navy);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  margin-right: auto;
  border-radius: 6px;
}

/* The lockup SVG has a navy background and wide padding; crop to the artwork
   (x 94–1774, y 229–698 of its 1774×887 viewBox). */
.brand-logo {
  position: relative;
  display: block;
  height: 50px;
  aspect-ratio: 1680 / 469;
  overflow: hidden;
}

.brand-logo img {
  position: absolute;
  left: -5.595%;
  top: -48.827%;
  width: 105.595%;
  max-width: none;
  height: auto;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  padding: 8px 12px;
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s, background-color 0.2s;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* Narrow desktops: logo, five links and the language toggle share one row. */
@media (min-width: 860px) and (max-width: 1099px) {
  .site-nav {
    gap: 0;
  }

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  line-height: 1;
  white-space: nowrap;
}

.lang-toggle a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.2s, background-color 0.2s;
}

.lang-toggle a:hover {
  color: var(--text);
}

.lang-toggle a[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.flag {
  width: 21px;
  height: 14px;
  flex: none;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* Small phones: logo, language toggle and menu button share one row. */
@media (max-width: 479px) {
  :root {
    --header-h: 64px;
  }

  .header-inner {
    gap: 8px;
  }

  .header-actions {
    gap: 6px;
  }

  .brand-logo {
    height: 37.5px;
  }

  .lang-toggle {
    font-size: 0.75rem;
  }

  .lang-toggle a {
    gap: 8px;
    padding: 0 6px;
  }
}

@media (max-width: 399px) {
  .container {
    padding: 0 16px;
  }

  .lang-toggle {
    padding: 2px;
    font-size: 0.6875rem;
  }

  .lang-toggle a {
    gap: 7px;
    padding: 0 4px;
  }
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  position: relative;
}

.menu-button span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s;
}

.menu-button span:first-child {
  top: 17px;
}

.menu-button span:last-child {
  top: 25px;
}

.menu-button[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.menu-button[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* Mobile nav: collapses into a menu only when JS is available. */
@media (max-width: 859px) {
  .js .menu-button {
    display: block;
  }

  .js .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 8px 12px 16px;
    background: var(--brand-navy);
    box-shadow: 0 24px 40px -12px rgba(0, 0, 0, 0.7);
    border-bottom: 1px solid var(--border);
  }

  .js .site-nav.is-open {
    display: flex;
  }

  .js .site-nav a {
    padding: 14px 12px;
    font-size: 1rem;
    color: var(--text);
  }

  html:not(.js) .header-inner {
    flex-wrap: wrap;
    padding-bottom: 8px;
  }

  html:not(.js) .site-nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background-color 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.4), 0 8px 28px -8px rgba(34, 211, 238, 0.55);
}

.btn-primary:hover {
  background: #4ddcf1;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.6), 0 10px 34px -6px rgba(34, 211, 238, 0.7);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(34, 211, 238, 0.04);
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

.btn:active {
  transform: translateY(1px);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 80px;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 80% 10%, rgba(139, 92, 246, 0.16), transparent 70%),
    radial-gradient(70% 60% at 10% 90%, rgba(34, 211, 238, 0.12), transparent 70%);
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 178, 220, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 178, 220, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 100%);
}

/* Narrow screens: the text spans the hero, so the network sits far back. */
.hero-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.16;
}

/* Wide screens: the network gets its own area to the right of the text column
   (container offset + 32px gutter + 640px column + 48px gap). */
@media (min-width: 1100px) {
  .hero-network {
    left: calc(max(0px, (100% - 1140px) / 2) + 32px + 640px + 48px);
    width: auto;
    opacity: 0.6;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 30%);
    mask-image: linear-gradient(to right, transparent, #000 30%);
  }
}

.net-lines path {
  fill: none;
  stroke: rgba(34, 211, 238, 0.22);
  stroke-width: 1;
}

.net-packets path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 6 600;
  stroke-dashoffset: 0;
  opacity: 0;
}

.net-nodes circle {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.4;
}

.net-nodes circle:nth-child(3n) {
  stroke: var(--accent-2);
}

.hero-content {
  position: relative;
}

.hero-content > * {
  max-width: 640px;
}

.lead {
  margin-top: 20px;
  max-width: min(60ch, 640px);
  font-size: clamp(1.0625rem, 2.6vw, 1.25rem);
  color: var(--muted);
}

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

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(7, 11, 20, 0.6);
  color: var(--muted);
  font-size: 0.6875rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

@media (max-width: 479px) {
  .hero-actions .btn {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .net-packets path {
    opacity: 1;
    animation: packet 9s linear infinite;
  }

  .net-packets path:nth-child(2) {
    animation-duration: 12s;
    animation-delay: -4s;
  }

  .net-nodes circle {
    animation: pulse 4s ease-in-out infinite;
  }

  .net-nodes circle:nth-child(2n) {
    animation-delay: -1.3s;
  }

  .net-nodes circle:nth-child(3n) {
    animation-delay: -2.6s;
  }

  .status-dot {
    animation: blink 2.4s ease-in-out infinite;
  }
}

@keyframes packet {
  to {
    stroke-dashoffset: -606;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

@keyframes blink {
  50% {
    opacity: 0.35;
  }
}

/* ---------- Sections ---------- */

.section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

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

.section-intro {
  margin-top: 16px;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.0625rem;
}

.section-note {
  margin-top: 32px;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  max-width: 62ch;
  color: var(--text);
}

/* About */

.about-grid {
  display: grid;
  gap: 40px;
}

.prose {
  margin-top: 20px;
  display: grid;
  gap: 16px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.0625rem;
}

.stats {
  display: grid;
  gap: 12px;
}

.stat,
.card,
.event,
.panel,
.person {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 22px;
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
  border-radius: 2px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Product cards */

.cards {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.15), 0 0 32px -8px rgba(34, 211, 238, 0.35);
}

.icon {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 10px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(34, 211, 238, 0.25);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Pipeline */

.pipeline {
  position: relative;
  display: grid;
  gap: 28px;
  margin-top: 40px;
  counter-reset: step;
}

.pipeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
  opacity: 0.5;
}

.step {
  position: relative;
  padding-left: 48px;
}

.step-node {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 16px -2px rgba(34, 211, 238, 0.6);
}

.step-node::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.step-index {
  color: var(--accent);
  line-height: 24px;
}

.step h3 {
  margin-top: 6px;
  font-size: 1.25rem;
}

.step p:last-child {
  margin-top: 6px;
  color: var(--muted);
}

/* Events */

.events {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.event {
  padding: 24px;
  overflow: hidden;
}

.event::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent);
}

.event-meta {
  color: var(--accent);
}

.event h3 {
  margin-top: 10px;
  font-size: 1.3125rem;
}

.event-date {
  margin-top: 8px;
  color: var(--muted);
  font-size: 1.0625rem;
}

/* Contact */

.contact-grid {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.people {
  display: grid;
  gap: 14px;
}

.person {
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
}

.person-name {
  font-size: 1.25rem;
  font-weight: 600;
}

.person .contact-link {
  margin-top: 14px;
  align-self: flex-start;
}

.person-role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.panel {
  padding: 22px;
}

.panel-label {
  color: var(--muted);
  margin-bottom: 10px;
}

.person-wechat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.person-wechat .panel-label {
  margin-bottom: 0;
}

.wechat-link[href^="["] {
  display: none;
}

.qr {
  position: relative;
  width: 160px;
  height: 160px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.04);
  overflow: hidden;
}

.qr:has(img) {
  border-style: solid;
  border-color: var(--border);
}

.qr-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 12px;
}

.qr img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.contact-link {
  font-size: 1.125rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(34, 211, 238, 0.4);
  word-break: break-all;
}

address {
  font-style: normal;
  font-size: 1.0625rem;
  line-height: 1.7;
}

/* Footer */

.site-footer {
  padding: 28px 0 36px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

/* ---------- Larger screens ---------- */

@media (min-width: 600px) {
  .container {
    padding: 0 32px;
  }

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

  .events,
  .people {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
  }

}

@media (min-width: 860px) {
  .hero {
    padding: 120px 0 128px;
  }

  .section {
    padding: 112px 0;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .card {
    flex-direction: column;
    align-items: flex-start;
    padding: 26px;
    min-height: 168px;
  }

  .card h3 {
    margin-top: auto;
  }

  /* Horizontal pipeline */
  .pipeline {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }

  .pipeline::before {
    left: 12px;
    right: 12px;
    top: 11px;
    bottom: auto;
    width: auto;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
  }

  .step {
    padding-left: 0;
    padding-top: 44px;
  }

  .step-index {
    line-height: 1.6;
  }
}

@media (min-width: 1100px) {
  .about-grid {
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
    gap: 64px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Simplified Chinese (/zh/) ---------- */

html[lang="zh-CN"] {
  --font-sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", monospace;
}

html[lang="zh-CN"] body {
  line-height: 1.8;
}

html[lang="zh-CN"] h1,
html[lang="zh-CN"] h2,
html[lang="zh-CN"] h3,
html[lang="zh-CN"] .stat-value,
html[lang="zh-CN"] .wordmark {
  letter-spacing: 0;
}

html[lang="zh-CN"] h1 {
  font-size: clamp(1.9rem, 7.4vw, 3.75rem);
  line-height: 1.25;
  /* Break only at the <wbr> in the markup, never mid-phrase. */
  word-break: keep-all;
}

html[lang="zh-CN"] h2,
html[lang="zh-CN"] h3 {
  line-height: 1.4;
  text-wrap: balance;
}

html[lang="zh-CN"] p {
  text-wrap: pretty;
}

/* Monospace labels fall back to the Chinese font; tone down the tracking. */
html[lang="zh-CN"] .label,
html[lang="zh-CN"] .panel-label,
html[lang="zh-CN"] .event-meta,
html[lang="zh-CN"] .stat-label,
html[lang="zh-CN"] .person-role,
html[lang="zh-CN"] .status {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  line-height: 1.5;
}
