:root {
  --ink: #071018;
  --harbor: #0b1e2e;
  --harbor-light: #102a3e;
  --frost: #eaf7f5;
  --fog: #8ca7b5;
  --azure: #55b7ff;
  --azure-deep: #1679bd;
  --coral: #ff7a68;
  --line: rgba(172, 211, 231, 0.16);
  --panel: rgba(10, 29, 44, 0.78);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --display: "Aptos Display", "Segoe UI Variable Display", "Helvetica Neue", Arial, sans-serif;
  --body: "Aptos", "Segoe UI Variable Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  color: var(--frost);
  background:
    linear-gradient(rgba(85, 183, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85, 183, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 80% 2%, rgba(31, 121, 184, 0.24), transparent 30rem),
    var(--ink);
  background-size: 38px 38px, 38px 38px, auto, auto;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }
code, pre { font-family: var(--mono); }
.shell { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: 12px; padding: 10px 14px; color: var(--ink); background: var(--frost); transform: translateY(-150%); transition: transform 160ms ease; }
.skip-link:focus { transform: translateY(0); }

.site-header { position: relative; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(7, 16, 24, 0.78); backdrop-filter: blur(16px); }
.nav-wrap { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 720; letter-spacing: -0.03em; font-size: 19px; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; color: var(--ink); background: var(--azure); border-radius: 9px 4px 9px 4px; font-family: var(--mono); font-size: 14px; font-weight: 800; letter-spacing: -0.12em; }
nav { display: flex; align-items: center; gap: 28px; }
nav a { color: var(--fog); text-decoration: none; font-size: 14px; transition: color 150ms ease; }
nav a:hover { color: var(--frost); }
.endpoint-pill { display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 99px; color: #b9d5e3; background: rgba(14, 38, 56, 0.68); text-decoration: none; font-family: var(--mono); font-size: 12px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--azure); box-shadow: 0 0 0 5px rgba(85, 183, 255, 0.09); animation: breathe 2.8s ease-in-out infinite; }

.hero { min-height: 690px; display: grid; grid-template-columns: 1.02fr 0.98fr; gap: clamp(50px, 7vw, 92px); align-items: center; padding-block: 92px 104px; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 28px; color: var(--azure); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.15em; }
.eyebrow span + span { color: var(--fog); }
.eyebrow span + span::before { content: "/"; margin-right: 12px; color: rgba(140, 167, 181, 0.45); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 28px; font-family: var(--display); font-size: clamp(54px, 6.6vw, 88px); line-height: 0.94; letter-spacing: -0.065em; font-weight: 760; }
h1 em { color: var(--azure); font-style: normal; font-weight: 470; }
.hero-lead { max-width: 610px; margin-bottom: 34px; color: #abc2cd; font-size: clamp(18px, 2vw, 21px); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; padding: 0 19px; border: 1px solid transparent; border-radius: 8px 3px 8px 3px; cursor: pointer; text-decoration: none; font-size: 14px; font-weight: 680; transition: transform 150ms ease, background 150ms ease, border-color 150ms ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #03101a; background: var(--azure); box-shadow: 0 12px 35px rgba(42, 151, 222, 0.2); }
.button-primary:hover { background: #7ac8ff; }
.button-ghost { border-color: var(--line); color: #c3d7df; background: rgba(9, 27, 41, 0.62); }
.button-ghost:hover { border-color: rgba(85, 183, 255, 0.42); }
.copy-state { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.signal-list { display: flex; flex-wrap: wrap; gap: 18px; padding: 0; margin: 28px 0 0; list-style: none; color: var(--fog); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.signal-list li::before { content: "·"; margin-right: 8px; color: var(--coral); }

.route-visual { position: relative; padding: 36px 0 48px; }
.route-visual::before { content: ""; position: absolute; inset: 4% -8% 0 10%; border: 1px solid rgba(85, 183, 255, 0.09); transform: skewY(-4deg); pointer-events: none; }
.route-label { display: flex; justify-content: space-between; margin: 0 12px 10px; color: var(--fog); font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; }
.route-line { position: absolute; z-index: 0; left: -10%; right: -2%; top: 41px; height: 1px; background: linear-gradient(90deg, transparent, var(--azure) 32%, rgba(85, 183, 255, 0.08)); transform: rotate(-4deg); transform-origin: left; }
.route-line span { position: absolute; width: 9px; height: 9px; top: -4px; left: 16%; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 7px rgba(255, 122, 104, 0.1); animation: packet 4.5s ease-in-out infinite; }
.terminal-card { position: relative; z-index: 2; overflow: hidden; border: 1px solid rgba(129, 188, 218, 0.2); border-radius: 13px 4px 13px 4px; background: rgba(5, 16, 25, 0.92); box-shadow: var(--shadow); transform: rotate(1.6deg); }
.terminal-head, .terminal-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 15px; color: #7893a1; background: rgba(19, 45, 63, 0.54); font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; }
.terminal-head { border-bottom: 1px solid var(--line); }
.terminal-foot { border-top: 1px solid var(--line); }
.terminal-lights { display: flex; gap: 5px; }
.terminal-lights i { display: block; width: 6px; height: 6px; border-radius: 50%; background: #315065; }
.terminal-lights i:first-child { background: var(--coral); }
.terminal-card pre { min-height: 270px; margin: 0; padding: 28px 24px; overflow: auto; color: #d9e9ed; font-size: 11px; line-height: 1.85; }
.code-muted { color: #607d8c; }
.code-accent, .code-key { color: var(--azure); }
.code-string { color: #ffd0c9; }
.stream-state { display: inline-flex; align-items: center; gap: 6px; color: #9cc9df; }
.stream-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--azure); }
.route-note { position: relative; z-index: 3; width: 245px; display: flex; gap: 14px; margin: -8px 0 0 auto; padding: 15px; border-left: 2px solid var(--coral); background: var(--harbor); box-shadow: 0 14px 35px rgba(0, 0, 0, 0.2); transform: rotate(-1.4deg); }
.route-note span { color: var(--coral); font-family: var(--mono); font-size: 10px; }
.route-note p { margin: 0; color: #a9bdc7; font-size: 12px; line-height: 1.55; }

.protocol-band { overflow: hidden; border-block: 1px solid var(--line); background: rgba(11, 30, 46, 0.62); }
.protocol-track { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #8eabb8; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; white-space: nowrap; }
.protocol-track i { width: 4px; height: 4px; border-radius: 50%; background: var(--coral); }

.section { padding-block: 126px; scroll-margin-top: 24px; }
.section-intro { max-width: 720px; margin-bottom: 52px; }
.section-intro.compact { margin-bottom: 40px; }
.section-kicker { margin-bottom: 18px; color: var(--azure); font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; }
h2 { margin-bottom: 20px; font-family: var(--display); font-size: clamp(38px, 5vw, 62px); line-height: 1; letter-spacing: -0.05em; }
.section-intro > p:last-child, .compat-copy > p:last-child { max-width: 650px; color: var(--fog); font-size: 18px; }
.setup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 28px; background: var(--line); border: 1px solid var(--line); }
.setup-card { min-width: 0; padding: 27px; background: #091823; }
.step-tag { display: inline-block; margin-bottom: 32px; color: var(--coral); font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.13em; }
.setup-card h3 { margin-bottom: 13px; font-size: 18px; letter-spacing: -0.02em; }
.inline-value { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 13px; border: 1px solid var(--line); background: #06111a; }
.inline-value code { min-width: 0; overflow: hidden; color: #bcd4dd; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.icon-button, .panel-copy { border: 0; cursor: pointer; }
.icon-button { flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: 5px 7px; color: var(--azure); background: transparent; }
.private-tag, .method-tag { flex: 0 0 auto; padding: 4px 6px; color: #f4b1a8; background: rgba(255, 122, 104, 0.1); font-family: var(--mono); font-size: 8px; text-transform: uppercase; }
.method-tag { color: var(--azure); background: rgba(85, 183, 255, 0.1); }
.code-workbench { overflow: hidden; border: 1px solid rgba(121, 180, 208, 0.22); border-radius: 10px 3px 10px 3px; background: #06111a; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22); }
.tab-list { display: flex; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); background: #0b1c29; }
.tab-list button { min-height: 44px; padding: 0 16px; border: 1px solid transparent; color: var(--fog); background: transparent; cursor: pointer; font-family: var(--mono); font-size: 10px; }
.tab-list button[aria-selected="true"] { border-color: rgba(85, 183, 255, 0.25); color: var(--azure); background: rgba(85, 183, 255, 0.08); }
.code-panel { position: relative; min-height: 310px; }
.code-panel[hidden] { display: none; }
.code-panel pre { margin: 0; padding: 34px; overflow: auto; color: #c9dde4; font-size: 12px; line-height: 1.75; }
.panel-copy { position: absolute; z-index: 2; top: 13px; right: 14px; min-height: 44px; padding: 7px 11px; color: #c7dbe3; background: #102536; font-family: var(--mono); font-size: 9px; text-transform: uppercase; }

.compatibility { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: 9vw; align-items: center; border-top: 1px solid var(--line); }
.compat-matrix { border-top: 1px solid var(--line); }
.compat-matrix > div { display: grid; grid-template-columns: 0.8fr 0.65fr 1.55fr; gap: 16px; align-items: center; padding: 23px 8px; border-bottom: 1px solid var(--line); }
.compat-matrix span { font-weight: 670; }
.compat-matrix b { color: var(--fog); font-family: var(--mono); font-size: 9px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; }
.compat-matrix code { overflow: hidden; color: var(--azure); font-size: 10px; text-overflow: ellipsis; }
.answers { border-top: 1px solid var(--line); }
.answer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.answer-grid article { padding: 31px; background: #091823; }
.answer-grid h3 { margin-bottom: 10px; font-size: 18px; }
.answer-grid p { margin: 0; color: var(--fog); font-size: 14px; }
.answer-grid code { color: #b8d9e8; font-size: 0.9em; }

.site-footer { border-top: 1px solid var(--line); background: #061019; }
.footer-wrap { min-height: 120px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-wrap p { margin: 0; color: var(--fog); font-size: 13px; }
.footer-wrap > a:last-child { color: var(--azure); font-family: var(--mono); font-size: 11px; text-decoration: none; }

:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }

@keyframes breathe { 50% { opacity: 0.45; box-shadow: 0 0 0 8px rgba(85, 183, 255, 0.04); } }
@keyframes packet { 0%, 100% { left: 16%; } 50% { left: 76%; } }

@media (max-width: 900px) {
  nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-block: 72px 84px; }
  .hero-copy { max-width: 720px; }
  .route-visual { width: min(620px, 100%); margin-inline: auto; }
  .setup-grid { grid-template-columns: 1fr; }
  .compatibility { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 1160px); }
  .site-header { position: static; }
  .nav-wrap { min-height: 66px; }
  .endpoint-pill { display: none; }
  .hero { min-height: auto; padding-block: 60px 70px; }
  h1 { font-size: clamp(48px, 15vw, 68px); }
  .hero-actions { flex-direction: column; }
  .button { width: 100%; }
  .signal-list { gap: 9px 15px; }
  .terminal-card { transform: none; }
  .terminal-card pre { min-height: 230px; padding: 22px 16px; font-size: 9px; }
  .route-note { margin-top: 12px; transform: none; }
  .protocol-track { overflow-x: auto; justify-content: flex-start; }
  .section { padding-block: 84px; }
  .setup-card { padding: 23px 18px; }
  .code-panel pre { min-height: 360px; padding: 52px 18px 24px; font-size: 10px; }
  .compat-matrix > div { grid-template-columns: 1fr auto; }
  .compat-matrix code { grid-column: 1 / -1; }
  .answer-grid { grid-template-columns: 1fr; }
  .footer-wrap { min-height: 170px; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
