:root {
  --page: #f8fbfd;
  --paper: #ffffff;
  --paper-soft: #f2f8fb;
  --ink: #071225;
  --muted: #5f6f82;
  --quiet: #8392a4;
  --line: #dce7ef;
  --line-strong: #c6d7e2;
  --cyan: #08a6cf;
  --green: #17b26a;
  --amber: #f59e0b;
  --blue: #1663d9;
  --shadow: 0 24px 70px rgba(17, 35, 52, 0.12);
  --soft-shadow: 0 12px 34px rgba(17, 35, 52, 0.08);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--page);
  color: var(--ink);
}

body[data-theme="signal"] {
  --page: #f2fffc;
  --paper-soft: #e9fbf7;
  --cyan: #00a7d6;
  --green: #00b978;
  --blue: #0f7bcf;
}

body[data-theme="obsidian"] {
  --page: #081113;
  --paper: #0e191c;
  --paper-soft: #111f23;
  --ink: #eef8f8;
  --muted: #aac0c4;
  --quiet: #769298;
  --line: rgba(130, 216, 229, 0.2);
  --line-strong: rgba(130, 216, 229, 0.34);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --soft-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(8, 166, 207, 0.12), transparent 34rem),
    linear-gradient(220deg, rgba(23, 178, 106, 0.11), transparent 32rem),
    var(--page);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(8, 80, 110, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 80, 110, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent 72%);
}

body[data-theme="obsidian"]::before {
  background-image:
    linear-gradient(rgba(130, 216, 229, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 216, 229, 0.045) 1px, transparent 1px);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

button {
  font: inherit;
}

.site-header,
.site-footer,
main {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 74px;
  border-bottom: 1px solid rgba(198, 215, 226, 0.62);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 23px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid color-mix(in srgb, var(--cyan) 44%, var(--line));
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cyan) 13%, white), var(--paper));
  box-shadow: 0 10px 24px rgba(8, 166, 207, 0.12);
}

body[data-theme="obsidian"] .brand-mark {
  background: linear-gradient(180deg, rgba(8, 166, 207, 0.16), rgba(23, 178, 106, 0.08));
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a {
  transition: color 160ms ease;
}

.top-nav a:hover {
  color: var(--ink);
}

.header-action,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
}

.header-action {
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, var(--cyan) 55%, var(--line));
  color: var(--cyan);
  background: var(--paper);
  box-shadow: var(--soft-shadow);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  align-items: center;
  gap: 44px;
  min-height: 560px;
  padding: 34px 0 20px;
}

.hero-copy {
  position: relative;
  z-index: 3;
}

.hero h1 {
  max-width: 620px;
  margin: 0;
  color: var(--ink);
  font-size: 66px;
  line-height: 0.98;
  font-weight: 840;
}

.hero p {
  max-width: 560px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  border: 1px solid transparent;
  padding: 0 22px;
}

.button.primary {
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  box-shadow: 0 16px 34px rgba(8, 166, 207, 0.22);
}

.button.secondary {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
  box-shadow: var(--soft-shadow);
}

.button.compact {
  min-height: 52px;
  padding-inline: 20px;
}

.button svg,
.api-base button svg,
.endpoint-url button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.api-base {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 16px;
  width: min(450px, 100%);
  margin-top: 30px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  box-shadow: var(--soft-shadow);
}

.api-base span {
  grid-column: 1 / 2;
  color: var(--muted);
  font-size: 13px;
}

.api-base code,
.endpoint-url code {
  grid-column: 1 / 2;
  color: #069455;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 19px;
}

body[data-theme="obsidian"] .api-base code,
body[data-theme="obsidian"] .endpoint-url code {
  color: #51ee9d;
}

.api-base button,
.endpoint-url button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper-soft);
  cursor: pointer;
}

.api-base button {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  align-self: center;
}

.hero-visual {
  position: relative;
  margin-right: calc((100vw - min(1200px, 100vw - 40px)) / -2);
  overflow: hidden;
  border: 1px solid rgba(198, 215, 226, 0.72);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-visual img {
  min-height: 460px;
  object-fit: cover;
}

.float-card {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 5px;
  min-width: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.float-card span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.float-card strong {
  font-size: 13px;
}

.float-card em {
  color: var(--green);
  font-size: 13px;
  font-style: normal;
}

.routing-card {
  top: 13%;
  left: 7%;
}

.status-card {
  right: 8%;
  bottom: 12%;
}

.endpoint-card,
.routing-section,
.feature-card,
.telemetry-section,
.style-section,
.integration-section {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  box-shadow: var(--soft-shadow);
}

.endpoint-card {
  display: grid;
  grid-template-columns: 0.7fr 1fr auto;
  gap: 24px;
  align-items: center;
  margin: 18px 0 34px;
  padding: 28px 34px;
}

.endpoint-card h2,
.section-copy h2,
.feature-copy h2,
.integration-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 31px;
  line-height: 1.1;
}

.endpoint-card p,
.section-copy p,
.feature-copy p,
.integration-section p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.62;
}

.endpoint-url {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 12px 14px 12px 24px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.routing-section {
  display: grid;
  grid-template-columns: 0.56fr 1fr;
  gap: 30px;
  align-items: center;
  padding: 34px;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--cyan) 50%, var(--line));
  border-radius: 9px;
  color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 8%, var(--paper));
}

.section-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 28px;
  font-size: 14px;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 17px;
  height: 17px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 48%, var(--cyan) 49%, var(--cyan) 57%, transparent 58%),
    linear-gradient(45deg, transparent 52%, var(--cyan) 53%, var(--cyan) 60%, transparent 61%);
}

.routing-visual,
.feature-card.image-card img,
.telemetry-section img {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.routing-visual img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 22px;
}

.feature-card {
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 28px;
}

.model-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.model-table > div {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 14px;
  min-height: 46px;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.model-table > div:last-child {
  border-bottom: 0;
}

.model-table b {
  color: var(--quiet);
  font-size: 12px;
  text-transform: uppercase;
}

.model-table em {
  justify-self: start;
  padding: 5px 10px;
  border-radius: 7px;
  color: #067a46;
  background: rgba(23, 178, 106, 0.12);
  font-style: normal;
  font-size: 12px;
}

.feature-card.image-card img {
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.telemetry-section {
  display: grid;
  grid-template-columns: 0.46fr 1fr;
  gap: 30px;
  align-items: center;
  margin-top: 22px;
  padding: 34px;
}

.telemetry-section img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.style-section {
  display: grid;
  grid-template-columns: 0.42fr 1fr;
  gap: 26px;
  align-items: center;
  margin-top: 22px;
  padding: 28px;
}

.style-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.style-option {
  min-height: 122px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(8, 166, 207, 0.08), transparent),
    var(--paper);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.style-option.is-active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 16%, transparent);
}

.style-option span {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 780;
}

.style-option small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.style-option.dark {
  color: #eef8f8;
  background:
    linear-gradient(135deg, rgba(8, 166, 207, 0.24), transparent),
    #071113;
}

.style-option.dark small {
  color: #aac0c4;
}

.integration-section {
  display: grid;
  grid-template-columns: 0.7fr 1fr;
  gap: 28px;
  align-items: center;
  margin: 22px 0 44px;
  padding: 34px;
}

.integration-section pre {
  margin: 0;
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--paper-soft) 86%, var(--paper));
  color: #087044;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.7;
}

body[data-theme="obsidian"] .integration-section pre {
  color: #51ee9d;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 104px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer .brand {
  color: var(--ink);
  font-size: 19px;
}

.site-footer a:last-child {
  color: var(--cyan);
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--green) 45%, var(--line));
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .site-header,
  .site-footer,
  main {
    width: min(100% - 28px, 760px);
  }

  .top-nav {
    display: none;
  }

  .hero,
  .endpoint-card,
  .routing-section,
  .feature-grid,
  .telemetry-section,
  .style-section,
  .integration-section {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 30px;
    min-height: 0;
    padding-top: 38px;
  }

  .hero h1 {
    font-size: 48px;
  }

  .hero p {
    font-size: 18px;
  }

  .hero-visual {
    margin-right: 0;
    border-right: 1px solid var(--line);
    border-radius: 10px;
  }

  .hero-visual img {
    min-height: 320px;
  }
}

@media (max-width: 580px) {
  .site-header {
    min-height: 66px;
  }

  .brand {
    font-size: 20px;
  }

  .header-action {
    min-height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .hero {
    gap: 22px;
    padding-top: 34px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero p {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
    margin-top: 26px;
  }

  .button {
    width: 100%;
  }

  .api-base code,
  .endpoint-url code {
    font-size: 15px;
  }

  .hero-visual img {
    min-height: 230px;
  }

  .float-card {
    display: none;
  }

  .endpoint-card,
  .routing-section,
  .feature-card,
  .telemetry-section,
  .style-section,
  .integration-section {
    padding: 20px;
  }

  .endpoint-card h2,
  .section-copy h2,
  .feature-copy h2,
  .integration-section h2 {
    font-size: 28px;
  }

  .style-options {
    grid-template-columns: 1fr;
  }

  .model-table > div {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 14px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
