@import url("https://fonts.googleapis.com/css2?family=Sora:wght@350;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --bg: #fff;
  --copy: #0a0a0a;
  --muted: #737373;
  --subtle: #a3a3a3;
  --primary: #171717;
  --primary-bright: #262626;
  --primary-ink: #fff;
  --secondary: #fafafa;
  --line: #e5e5e5;
  --hover: rgba(0,0,0,.045);
  --grid: rgba(0,0,0,.045);
  --shade: linear-gradient(90deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.86) 38%, rgba(255,255,255,.12) 68%, transparent 100%);
  --shell-start: #e5e5e5;
  --shell-mid: #d4d4d4;
  --shell-end: #a3a3a3;
  --cut: #fafafa;
  --ridge: #a3a3a3;
  --assembly: #f5f5f5;
  --assembly-inner: #fff;
  --shadow: rgba(0,0,0,.16);
  --code-bg: #0a0a0a;
  --code-fg: #fafafa;
  --code-c: #737373;
  --code-s: #a3e3a3;
  --code-k: #f5a3a3;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000;
  --copy: #fafafa;
  --muted: #a3a3a3;
  --subtle: #737373;
  --primary: #fafafa;
  --primary-bright: #e5e5e5;
  --primary-ink: #000;
  --secondary: #0a0a0a;
  --line: #262626;
  --hover: rgba(255,255,255,.08);
  --grid: rgba(255,255,255,.055);
  --shade: linear-gradient(90deg, rgba(0,0,0,.98) 0%, rgba(0,0,0,.84) 38%, rgba(0,0,0,.16) 68%, transparent 100%);
  --shell-start: #262626;
  --shell-mid: #171717;
  --shell-end: #0a0a0a;
  --cut: #0a0a0a;
  --ridge: #525252;
  --assembly: #171717;
  --assembly-inner: #0a0a0a;
  --shadow: rgba(0,0,0,.8);
  --code-bg: #fafafa;
  --code-fg: #0a0a0a;
  --code-c: #737373;
  --code-s: #2f7a2f;
  --code-k: #9b2c2c;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--copy);
  font-family: "Sora", "HarmonyOS Sans SC", system-ui, "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
code, pre { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ===== topbar ===== */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 68px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 90%, transparent), transparent);
}
.topbar-frame {
  width: min(1440px, 100%);
  height: 100%;
  margin: auto;
  padding: 0 max(20px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; }
.brand-symbol {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 2px solid var(--copy); border-radius: 50%; font-size: 12px; font-weight: 800;
}
.brand strong { letter-spacing: .13em; font-size: 14px; font-weight: 800; }
nav { display: flex; align-items: center; gap: 3px; }
nav a, .account-nav a {
  position: relative; min-height: 40px; padding: 0 12px; border-radius: 5px;
  display: inline-flex; align-items: center; color: var(--muted); font-size: 13px; font-weight: 550;
}
nav a:hover, .account-nav a:hover { color: var(--copy); background: var(--hover); }
nav a.active { color: var(--copy); }
nav a.active::after { content: ""; position: absolute; height: 2px; left: 12px; right: 12px; bottom: 3px; background: var(--primary); }
.account-nav { justify-self: end; display: flex; align-items: center; gap: 2px; }
.icon-button {
  width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 5px;
  color: var(--muted); background: transparent; cursor: pointer;
}
.icon-button:hover { color: var(--copy); background: var(--hover); }
.icon-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }

/* ===== hero ===== */
.hero { position: relative; min-height: 100svh; background: var(--bg); overflow: hidden; }
.signal-field, .signal { position: absolute; inset: 0; width: 100%; height: 100%; }
.signal { display: block; }
.hero-shade { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: var(--shade); }
.hero-copy {
  position: absolute; z-index: 2; left: max(20px, calc(50vw - 700px)); bottom: clamp(44px, 8vh, 88px);
  width: min(760px, calc(100% - 40px));
}
.eyebrow { color: var(--primary); letter-spacing: .17em; font-size: 11px; font-weight: 700; }
h1 { margin: 13px 0 0; font-size: clamp(58px, 8vw, 104px); line-height: .98; letter-spacing: -.055em; font-weight: 800; }
h1 span { color: var(--primary); }
h2 { max-width: 760px; margin: 18px 0 0; font-size: clamp(21px, 2.25vw, 32px); line-height: 1.42; letter-spacing: -.025em; font-weight: 350; }
.description { max-width: 650px; margin: 14px 0 0; color: var(--muted); font-size: clamp(14px, 1.15vw, 17px); line-height: 1.75; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  min-height: 48px; padding: 0 20px; border: 1px solid var(--line); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; font-weight: 650;
  transition: transform .16s, background .16s, border-color .16s;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: var(--primary-ink); border-color: var(--primary); background: var(--primary); box-shadow: 0 0 28px color-mix(in srgb, var(--primary) 14%, transparent); }
.button.primary:hover { background: var(--primary-bright); border-color: var(--primary-bright); }
.button.secondary { color: var(--copy); background: var(--secondary); }
.button.secondary:hover { border-color: var(--primary); }
.principle { margin-top: 22px; display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: 10px; letter-spacing: .08em; }
.principle span { width: 28px; height: 1px; background: var(--primary); }
.scroll-note { position: absolute; right: 24px; bottom: 24px; z-index: 3; display: flex; align-items: center; gap: 9px; color: var(--subtle); font-size: 9px; letter-spacing: .12em; writing-mode: vertical-rl; }
.scroll-note span { width: 1px; height: 34px; background: var(--line); }

/* ===== svg animations ===== */
.grid-lines path { stroke: var(--grid); stroke-width: 1; fill: none; }
.network path { stroke: color-mix(in srgb, var(--primary) 25%, transparent); stroke-width: 1; stroke-dasharray: 5 11; fill: none; animation: flow 13s linear infinite; }
.orbit ellipse { stroke: color-mix(in srgb, var(--primary) 28%, transparent); stroke-width: 1; stroke-dasharray: 7 14; fill: none; transform-box: fill-box; transform-origin: center; animation: orbit 32s linear infinite; }
.orbit-two ellipse { animation-duration: 39s; animation-direction: reverse; }
.shell-start { stop-color: var(--shell-start); }.shell-mid { stop-color: var(--shell-mid); }.shell-end { stop-color: var(--shell-end); }
.edge-start { stop-color: var(--primary); stop-opacity: .08; }.edge-mid { stop-color: var(--primary-bright); stop-opacity: .9; }.edge-end { stop-color: var(--primary); stop-opacity: .12; }
.core-start { stop-color: var(--primary-bright); stop-opacity: .7; }.core-mid { stop-color: var(--primary); stop-opacity: .22; }.core-end { stop-color: var(--bg); stop-opacity: 0; }
.signal-object { transform-box: fill-box; transform-origin: center; animation: float 9s ease-in-out infinite; }
.core-glow { fill: url(#core); filter: url(#glow); opacity: .5; }
.shell { fill: url(#shell); stroke: color-mix(in srgb, var(--primary) 22%, transparent); stroke-width: 1.4; }
.cut { fill: var(--cut); stroke: color-mix(in srgb, var(--ridge) 70%, transparent); stroke-width: 2; }
.ridge { fill: none; stroke: var(--ridge); stroke-opacity: .42; stroke-width: 1.2; }
.edge { fill: none; stroke: url(#edge); stroke-width: 2.6; }
.assembly polygon { fill: var(--assembly); stroke: color-mix(in srgb, var(--primary) 72%, transparent); stroke-width: 1.4; }
.assembly .assembly-inner { fill: var(--assembly-inner); stroke-opacity: .55; }
.assembly circle { fill: var(--primary); filter: url(#glow); }
.assembly path { fill: none; stroke: color-mix(in srgb, var(--primary) 36%, transparent); }
.nodes circle { fill: var(--primary); opacity: .8; }

@keyframes reveal { to { opacity: 1; filter: blur(0); transform: translateY(0); } from { transform: translateY(10px); } }
@keyframes float { 0%,100% { transform: translateY(-5px) rotate(-1deg); } 50% { transform: translateY(12px) rotate(1deg); } }
@keyframes orbit { to { stroke-dashoffset: -180; } }
@keyframes flow { to { stroke-dashoffset: -160; } }

/* ===== generic sections (capabilities / quickstart / endpoints) ===== */
.capabilities, .quickstart, .endpoints { padding: clamp(72px, 10vh, 120px) 20px; }
.cap-inner, .qs-inner, .ep-inner { width: min(1280px, 100%); margin: 0 auto; }
.cap-head { margin-bottom: clamp(32px, 5vh, 56px); }
.cap-eyebrow { color: var(--primary); letter-spacing: .17em; font-size: 11px; font-weight: 700; }
.capabilities h3, .quickstart h3, .endpoints h3 {
  margin: 10px 0 0; font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -.04em; font-weight: 700; line-height: 1.1;
}
.qs-desc { margin: 12px 0 0; color: var(--muted); font-size: clamp(14px, 1.1vw, 17px); line-height: 1.7; max-width: 640px; }

/* capabilities grid */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.cap-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 24px 22px;
  background: var(--secondary); transition: transform .2s, border-color .2s, background .2s;
  min-width: 0;
}
.cap-card:hover { transform: translateY(-2px); border-color: var(--primary); background: var(--bg); }
.cap-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--primary); margin-bottom: 18px; }
.cap-icon svg { width: 30px; height: 30px; }
.cap-card h4 { margin: 0 0 8px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.cap-card p { min-width: 0; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.cap-card code { max-width: 100%; font-size: 12px; padding: 1px 5px; border-radius: 3px; background: color-mix(in srgb, var(--primary) 8%, transparent); overflow-wrap: anywhere; word-break: break-word; }

/* quickstart */
.qs-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.qs-tab {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 7px 14px; border-radius: 5px; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  cursor: pointer; transition: color .16s, background .16s, border-color .16s;
}
.qs-tab:hover { color: var(--copy); }
.qs-tab.active { color: var(--primary-ink); background: var(--primary); border-color: var(--primary); }
.qs-code {
  margin: 0; padding: 22px 24px; border-radius: 10px;
  background: var(--code-bg); color: var(--code-fg);
  font-size: 13px; line-height: 1.65; overflow-x: auto;
  box-shadow: 0 14px 38px color-mix(in srgb, var(--primary) 10%, transparent);
}
.qs-code code { white-space: pre; display: block; }
.qs-code .c { color: var(--code-c); font-style: italic; }
.qs-code .s { color: var(--code-s); }
.qs-code .k { color: var(--code-k); }

/* endpoints */
.ep-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ep-list li {
  display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.ep-method {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 26px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
}
.ep-method.get  { color: #1f6f43; background: color-mix(in srgb, #1f6f43 12%, transparent); }
.ep-method.post { color: #1c4d8c; background: color-mix(in srgb, #1c4d8c 12%, transparent); }
:root[data-theme="dark"] .ep-method.get  { color: #6ed99c; background: color-mix(in srgb, #6ed99c 14%, transparent); }
:root[data-theme="dark"] .ep-method.post { color: #8fb6ee; background: color-mix(in srgb, #8fb6ee 14%, transparent); }
.ep-path { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; }
.ep-desc { color: var(--muted); font-size: 13px; }

/* footer */
.foot {
  border-top: 1px solid var(--line);
  padding: 28px 20px;
}
.foot-inner {
  width: min(1280px, 100%); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 12px; color: var(--muted); letter-spacing: .04em;
}
.foot-sub { color: var(--subtle); }

/* ===== reveal animations ===== */
.reveal { opacity: 0; filter: blur(4px); animation: reveal .7s cubic-bezier(.16,1,.3,1) forwards; }
.eyebrow { animation-delay: .1s; } h1 { animation-delay: .22s; } h2 { animation-delay: .4s; } .description { animation-delay: .55s; } .actions { animation-delay: .7s; } .principle { animation-delay: .85s; }

/* ===== responsive ===== */
@media (max-width: 900px) {
  .topbar-frame { grid-template-columns: 1fr auto; }
  nav { display: none; }
  .account-nav a:not(.register) { display: none; }
  .hero { min-height: 100dvh; }
  .hero-shade { background: linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 85%, transparent) 58%, transparent 88%); }
  .signal-field { transform: translate(17%, -16%) scale(.82); opacity: .78; }
  .hero-copy { left: 20px; bottom: max(32px, env(safe-area-inset-bottom)); width: calc(100% - 40px); }
  h1 { font-size: clamp(50px, 17vw, 78px); }
  h2 { max-width: 600px; }
  .description { max-width: 560px; }
  .scroll-note { display: none; }
  .cap-grid { grid-template-columns: 1fr; }
  .ep-list li { grid-template-columns: 60px 1fr; }
  .ep-desc { grid-column: 2; padding-top: 4px; }
}
@media (max-width: 560px) {
  .topbar { height: 60px; }
  .topbar-frame { padding: 0 16px; }
  .brand strong { font-size: 12px; }
  .hero-copy { left: 16px; width: calc(100% - 32px); bottom: max(24px, env(safe-area-inset-bottom)); }
  .eyebrow { font-size: 9px; }
  h1 { margin-top: 9px; }
  h2 { margin-top: 12px; font-size: 20px; line-height: 1.38; }
  .description { font-size: 13px; line-height: 1.65; }
  .actions { margin-top: 20px; gap: 8px; }
  .button { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .principle { margin-top: 16px; font-size: 8px; }
  .signal-field { transform: translate(24%, -23%) scale(.7); }
  .capabilities, .quickstart, .endpoints { padding: 56px 16px; }
  .qs-code { font-size: 12px; padding: 16px 18px; }
  .foot-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ===== three-tier responsive refinement: desktop / tablet / mobile ===== */
html { scroll-padding-top: 72px; overflow-x: clip; }
body { overflow-x: clip; }
img, svg, video, canvas { max-width: 100%; }
.cap-card, .qs-code, .ep-list li { min-width: 0; }

/* Desktop: wide and compact laptop screens */
@media (min-width: 1200px) {
  .hero-copy { max-width: min(760px, 52vw); }
  .cap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 901px) and (max-width: 1199px) {
  .topbar-frame { padding-inline: 24px; }
  nav a { padding-inline: 9px; }
  .hero-copy { left: 28px; width: min(650px, 58vw); }
  .signal-field { transform: translateX(8%) scale(.92); transform-origin: center; }
  .cap-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .cap-card { padding: 21px 18px; }
}

/* Tablet: keep navigation useful and cards in two columns */
@media (min-width: 641px) and (max-width: 900px) {
  .topbar-frame { grid-template-columns: auto 1fr auto; padding-inline: 22px; gap: 15px; }
  nav { display: flex; justify-self: center; gap: 0; }
  nav a { min-height: 38px; padding-inline: 8px; font-size: 11px; }
  .account-nav { grid-column: 3; }
  .hero { min-height: max(720px, 100svh); }
  .hero-copy { left: 32px; bottom: 54px; width: min(650px, calc(100% - 64px)); }
  .signal-field { transform: translate(25%, -22%) scale(.75); opacity: .66; }
  h1 { font-size: clamp(62px, 12vw, 88px); }
  h2 { max-width: 580px; font-size: clamp(22px, 3.5vw, 29px); }
  .description { max-width: 580px; }
  .capabilities, .quickstart, .endpoints { padding-inline: 28px; }
  .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cap-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .qs-code { max-width: 100%; }
}

/* Mobile */
@media (max-width: 640px) {
  html { scroll-padding-top: 60px; }
  .topbar { height: 60px; background: color-mix(in srgb, var(--bg) 91%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
  .topbar-frame { display: flex; padding-inline: 14px; gap: 8px; }
  .brand { flex: 0 0 auto; }
  .brand-symbol { width: 28px; height: 28px; }
  nav { display: none; }
  .account-nav { margin-left: auto; }
  .account-nav .icon-button { width: 40px; height: 40px; }
  .hero { min-height: max(650px, 100svh); }
  .hero-shade { background: linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 94%, transparent) 52%, color-mix(in srgb, var(--bg) 20%, transparent) 78%, transparent 100%); }
  .signal-field { transform: translate(32%, -25%) scale(.62); transform-origin: center; opacity: .54; }
  .hero-copy { left: 16px; right: 16px; width: auto; bottom: max(30px, calc(env(safe-area-inset-bottom) + 18px)); }
  h1 { font-size: clamp(52px, 21vw, 82px); overflow-wrap: anywhere; }
  h2 { max-width: 92%; font-size: clamp(19px, 5.8vw, 24px); }
  .description { max-width: 96%; font-size: 13px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .actions .button { width: 100%; min-width: 0; padding-inline: 10px; }
  .principle { letter-spacing: .04em; white-space: normal; }
  .capabilities, .quickstart, .endpoints { padding: 54px 16px; }
  .cap-grid { grid-template-columns: 1fr; gap: 10px; }
  .cap-card { padding: 20px 18px; }
  .cap-card p { font-size: 13px; }
  .cap-card code { display: inline; padding-inline: 3px; font-size: 11px; white-space: normal; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
  .qs-tabs { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .qs-tabs::-webkit-scrollbar { display: none; }
  .qs-tab { flex: 1 0 auto; min-height: 42px; }
  .qs-code { width: 100%; max-width: calc(100vw - 32px); padding: 16px; border-radius: 7px; font-size: 11px; line-height: 1.6; overscroll-behavior-inline: contain; }
  .ep-list li { grid-template-columns: 58px minmax(0, 1fr); gap: 9px; padding: 14px 0; }
  .ep-path { min-width: 0; overflow-wrap: anywhere; word-break: break-word; font-size: 11px; }
  .ep-desc { grid-column: 2; font-size: 11px; line-height: 1.5; }
  .foot { padding-inline: 16px; }
  .foot-inner { width: 100%; }
}
@media (max-width: 380px) {
  .brand strong { display: none; }
  .hero { min-height: max(620px, 100svh); }
  .actions { grid-template-columns: 1fr; }
  .principle span { width: 18px; }
}

/* Removed homepage Key-query component: prevent stale CSS from affecting layout. */
