:root {
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --bg: #fff;
  --bg-gray: #f5f5f7;
  --dark: #0b0b0f;
  --card-bg: #fff;
  --card-border: rgba(0, 0, 0, 0.06);
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  --accent: #d56b1d;
  --accent-hover: #a2521c;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-border: rgba(0, 0, 0, 0.08);
  --pill-bg: rgba(0, 0, 0, 0.05);
  --code-bg: #f5f5f7;
  --menu-bg: rgba(250, 250, 252, 0.96);
  --hairline: rgba(0, 0, 0, 0.1);
  --radius: 20px;
  --content: 980px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f5f5f7;
    --text-secondary: #98989d;
    --bg: #000;
    --bg-gray: #1c1c1e;
    --dark: #111114;
    --card-bg: #1c1c1e;
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: none;
    --accent: #ee8e2d;
    --accent-hover: #f3a84b;
    --nav-bg: rgba(0, 0, 0, 0.7);
    --nav-border: rgba(255, 255, 255, 0.12);
    --pill-bg: rgba(255, 255, 255, 0.08);
    --code-bg: #1c1c1e;
    --menu-bg: rgba(22, 22, 24, 0.96);
    --hairline: rgba(255, 255, 255, 0.16);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.47059;
  letter-spacing: -0.022em;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 48px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.nav-inner {
  max-width: var(--content);
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 17px; font-weight: 600; }
.nav-brand:hover { text-decoration: none; }
.nav-brand img { width: 22px; height: 22px; border-radius: 5px; }
.nav-links { margin-left: auto; display: flex; gap: 24px; }
.nav-links a { color: var(--text); font-size: 12px; opacity: 0.82; letter-spacing: -0.01em; }
.nav-links a:hover { opacity: 1; text-decoration: none; }
.nav-links a.active { color: var(--accent); opacity: 1; }
.nav-toggle, .nav-burger, .nav-scrim { display: none; }

section { padding: 100px 22px; text-align: center; }
.section-gray { background: var(--bg-gray); }
.section-dark { color: #f5f5f7; background: var(--dark); }
.wrap { max-width: var(--content); margin: 0 auto; }
.eyebrow { margin-bottom: 6px; color: var(--accent); font-size: 21px; font-weight: 600; letter-spacing: 0; }
h1 { margin: 0; font-size: clamp(48px, 8vw, 88px); font-weight: 650; line-height: 1.04; letter-spacing: -0.035em; }
h2 { font-size: clamp(34px, 5vw, 56px); font-weight: 620; line-height: 1.07; letter-spacing: -0.025em; }
.sub { margin-top: 14px; color: var(--text-secondary); font-size: clamp(19px, 2.6vw, 28px); line-height: 1.25; }
.section-dark .sub { color: #a1a1a6; }
.cta { margin-top: 28px; display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 12px 22px; border-radius: 980px; font-size: 17px; line-height: 1; transition: background .2s; }
.btn:hover { text-decoration: none; }
.btn-primary { color: #fff; background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.btn-secondary:hover { color: #fff; background: var(--accent); }
.btn-link { padding: 12px 6px; color: var(--accent); }
.brew { max-width: 500px; margin: 22px auto 0; padding: 12px 16px; display: flex; align-items: center; gap: 12px; color: var(--text); background: var(--pill-bg); border-radius: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; letter-spacing: 0; }
.brew code { flex: 1; overflow-x: auto; text-align: left; white-space: nowrap; }
.brew button { padding: 2px 4px; color: var(--accent); background: transparent; border: 0; cursor: pointer; font: inherit; font-size: 13px; }
.section-dark .brew { color: #f5f5f7; background: rgba(255, 255, 255, .08); }

.hero { padding-top: 70px; padding-bottom: 52px; }
.hero-icon { width: 128px; height: 128px; margin: 0 auto 24px; border-radius: 29px; box-shadow: 0 18px 48px rgba(27, 25, 82, 0.28); }
.hero .meta { margin-top: 18px; color: var(--text-secondary); font-size: 15px; }
.features { margin-top: 60px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; text-align: left; }
.feature { padding: 32px 28px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.feature .ico { margin-bottom: 14px; font-size: 30px; }
.feature h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.feature p { margin-top: 8px; color: var(--text-secondary); font-size: 16px; line-height: 1.42; }

.showcase { padding: 28px 22px 100px; }
.relay {
  position: relative;
  max-width: 900px;
  min-height: 330px;
  margin: 0 auto;
  padding: 92px 60px;
  display: grid;
  grid-template-columns: 1fr .72fr 1fr .72fr 1fr;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 36px;
  background:
    radial-gradient(70% 100% at 10% 20%, rgba(94, 92, 230, .20), transparent 60%),
    radial-gradient(75% 100% at 92% 86%, rgba(90, 200, 250, .18), transparent 62%),
    var(--bg-gray);
}
.device { position: relative; z-index: 2; min-width: 0; padding: 23px 12px; display: flex; flex-direction: column; align-items: center; background: rgba(255, 255, 255, .72); border: 1px solid rgba(255, 255, 255, .8); border-radius: 24px; box-shadow: 0 16px 42px rgba(32, 30, 88, .12); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
@media (prefers-color-scheme: dark) { .device { background: rgba(36, 36, 40, .72); border-color: rgba(255, 255, 255, .12); } }
.device-icon { font-size: 42px; }
.device strong { margin-top: 8px; font-size: 18px; }
.device small { margin-top: 3px; color: var(--text-secondary); font-size: 13px; }
.relay-line { position: relative; height: 42px; color: var(--text-secondary); font-size: 11px; text-align: center; }
.relay-line i { position: absolute; top: 13px; left: 0; right: 0; height: 2px; overflow: hidden; background: rgba(94, 92, 230, .2); }
.relay-line i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--accent), transparent); transform: translateX(-100%); animation: signal 2.2s ease-in-out infinite; }
.relay-line:nth-of-type(4) i::after { animation-delay: 1.1s; }
.relay-line span { position: relative; top: 22px; white-space: nowrap; }
.lock-pulse { position: absolute; right: 3%; bottom: 8%; z-index: 3; width: 48px; height: 48px; display: grid; place-items: center; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 0 rgba(94, 92, 230, .4); animation: lock-pulse 2.2s ease-out infinite; }
.scene-caption { margin-top: 30px; color: var(--text-secondary); font-size: 20px; }
@keyframes signal { 45%, 100% { transform: translateX(100%); } }
@keyframes lock-pulse { 70% { box-shadow: 0 0 0 22px rgba(94, 92, 230, 0); } 100% { box-shadow: 0 0 0 0 rgba(94, 92, 230, 0); } }
@media (prefers-reduced-motion: reduce) { .relay-line i::after, .lock-pulse { animation: none; } }

footer { padding: 34px 22px; color: var(--text-secondary); background: var(--bg-gray); font-size: 12px; }
.footer-inner { max-width: var(--content); margin: 0 auto; }
.footer-links { margin-bottom: 14px; padding-bottom: 14px; display: flex; gap: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--hairline); }
.footer-links a { color: var(--text-secondary); }
footer p { line-height: 1.5; }
.footer-apps { margin-top: 10px; }
.footer-apps .cur { color: var(--text); font-weight: 600; }

.doc { max-width: 1100px; margin: 0 auto; display: flex; align-items: flex-start; }
.doc-side { position: sticky; top: 48px; flex: 0 0 260px; max-height: calc(100vh - 48px); padding: 32px 16px 32px 22px; overflow-y: auto; border-right: 1px solid var(--hairline); }
.doc-side .side-title { margin-bottom: 12px; color: var(--text-secondary); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.doc-side a { display: block; padding: 5px 10px; color: var(--text-secondary); border-radius: 7px; font-size: 14px; letter-spacing: -.01em; }
.doc-side a:hover { color: var(--text); background: var(--pill-bg); text-decoration: none; }
.doc-side a.active { color: var(--accent); background: var(--pill-bg); font-weight: 500; }
.doc-side a.lvl-3 { padding-left: 22px; font-size: 13px; }
.doc-main { flex: 1; min-width: 0; padding: 40px 40px 120px; }
.doc-eyebrow { color: var(--accent); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.md { max-width: 720px; }
.md h1 { margin: 6px 0 24px; font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.md h2 { margin: 48px 0 14px; padding-top: 8px; scroll-margin-top: 64px; font-size: 28px; font-weight: 600; letter-spacing: -.015em; }
.md h3 { margin: 30px 0 10px; scroll-margin-top: 64px; font-size: 20px; font-weight: 600; }
.md p { margin: 14px 0; color: var(--text); font-size: 17px; line-height: 1.6; }
.md ul, .md ol { margin: 14px 0 14px 22px; }
.md li { margin: 6px 0; font-size: 17px; line-height: 1.6; }
.md strong { font-weight: 600; }
.md code { padding: .15em .4em; background: var(--pill-bg); border-radius: 5px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; letter-spacing: 0; }
.md pre { margin: 18px 0; padding: 16px 18px; overflow-x: auto; background: var(--code-bg); border: 1px solid var(--card-border); border-radius: 12px; }
.md pre code { padding: 0; background: none; font-size: 13.5px; line-height: 1.5; }
.md table { width: 100%; margin: 18px 0; border-collapse: collapse; font-size: 15px; }
.md th, .md td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline); }
.md th { border-bottom-width: 2px; font-weight: 600; }
.md blockquote { margin: 18px 0; padding: 12px 18px; color: var(--text-secondary); background: var(--pill-bg); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; }

.releases-head { max-width: 760px; margin: 0 auto; padding: 56px 22px 8px; text-align: center; }
.releases-head h1 { font-size: clamp(40px, 6vw, 64px); }
.release-list { max-width: 760px; margin: 0 auto; padding: 24px 22px 120px; }
.release { margin: 22px 0; padding: 28px 30px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); }
.release-top { margin-bottom: 4px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.release-top h2 { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.release-tag { padding: 3px 9px; color: var(--accent); background: var(--pill-bg); border-radius: 980px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.release-date { margin-left: auto; color: var(--text-secondary); font-size: 13px; }
.release .md { max-width: none; }
.release .md p, .release .md li { font-size: 15.5px; }
.state { max-width: 760px; margin: 0 auto; padding: 40px 22px; color: var(--text-secondary); font-size: 16px; text-align: center; }

@media (max-width: 820px) {
  .doc { display: block; }
  .doc-side { display: none; }
  .doc-main { padding: 28px 22px 80px; }
  .features { grid-template-columns: 1fr; }
  .relay { min-height: 0; padding: 48px 26px; grid-template-columns: 1fr; gap: 10px; }
  .relay-line { width: 60px; height: 50px; margin: 0 auto; transform: rotate(90deg); }
  .relay-line span { display: none; }
  .device { width: 180px; margin: 0 auto; }
  .lock-pulse { right: calc(50% - 112px); bottom: 5%; }
}

@media (max-width: 640px) {
  .nav-inner { gap: 12px; padding: 0 16px; }
  .nav-burger { width: 34px; height: 34px; margin-left: auto; margin-right: -8px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after { width: 18px; height: 2px; display: block; background: var(--text); border-radius: 2px; transition: transform .2s, top .2s, background .2s; }
  .nav-burger span { position: relative; }
  .nav-burger span::before, .nav-burger span::after { content: ""; position: absolute; left: 0; }
  .nav-burger span::before { top: -6px; }
  .nav-burger span::after { top: 6px; }
  .nav-toggle:checked ~ .nav-burger span { background: transparent; }
  .nav-toggle:checked ~ .nav-burger span::before { top: 0; transform: rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span::after { top: 0; transform: rotate(-45deg); }
  .nav-links { position: absolute; top: 48px; left: 0; right: 0; z-index: 2; margin: 0; padding: 6px 16px 12px; display: none; flex-direction: column; gap: 0; background: var(--menu-bg); border-bottom: 1px solid var(--nav-border); box-shadow: 0 12px 30px rgba(0, 0, 0, .18); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links a { padding: 12px 4px; color: var(--text); border-top: 1px solid var(--hairline); font-size: 16px; opacity: 1; }
  .nav-links a:first-child { border-top: 0; }
  .nav-toggle:checked ~ .nav-scrim { position: fixed; inset: 48px 0 0; z-index: 1; display: block; }
  section { padding: 76px 20px; }
  .hero { padding-top: 54px; }
  .showcase { padding: 18px 18px 76px; }
  .md table { display: block; overflow-x: auto; }
}
