:root {
  --nav-height: 76px;
  --paper-rgb: 251, 250, 247;
  --surface: #f0efea;
  --surface-strong: #e3ecea;
  --accent: #5264a7;
  --accent-hover: #43528a;
  --focus: rgba(103, 120, 186, 0.45);
  --header-line: rgba(58, 89, 83, 0.18);
  color-scheme: light;
  scroll-behavior: smooth;
}

[data-theme="dark"] {
  --paper: #162522;
  --paper-rgb: 22, 37, 34;
  --ink: #faf1d4;
  --muted: #afc2c5;
  --red: #d19b84;
  --neon: #e8f288;
  --line: rgba(250, 241, 212, 0.16);
  --surface: #203a35;
  --surface-strong: #2d4742;
  --header-line: rgba(250, 241, 212, 0.16);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 18px;
}

body {
  min-width: 320px;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(63, 67, 67, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 67, 67, 0.035) 1px, transparent 1px);
  background-position: 0.5px 0.5px;
  background-size: var(--cell) var(--cell);
  color: var(--ink);
}

[data-theme="dark"] body {
  background-image:
    linear-gradient(rgba(250, 241, 212, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(250, 241, 212, 0.04) 1px, transparent 1px);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  display: none;
}

.newapi-hosted {
  --nav-height: 68px;
}

.newapi-hosted .site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: block;
  min-height: var(--nav-height);
  border-bottom: 1px solid var(--header-line);
  background: rgba(var(--paper-rgb), 0.98);
  backdrop-filter: blur(14px);
}

.newapi-hosted .desktop-links a[aria-current="page"],
.newapi-hosted .mobile-menu a[aria-current="page"] {
  background: var(--surface);
}

.site-nav {
  display: flex;
  width: min(1176px, calc(100% - 112px));
  min-height: var(--nav-height);
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.desktop-links,
.nav-actions {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 158px;
  gap: 10px;
  color: inherit;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 0;
  object-fit: contain;
}

.desktop-links {
  align-self: stretch;
  gap: 4px;
}

.desktop-links a,
.mobile-menu a {
  display: inline-flex;
  align-items: center;
  color: inherit;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  transition: background-color 180ms ease;
}

.desktop-links a {
  min-height: 44px;
  padding-inline: 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.desktop-links a:hover {
  background: var(--surface-strong);
}

.nav-actions {
  justify-content: flex-end;
  gap: 8px;
}

.language-control {
  position: relative;
}

.language-button,
.icon-button,
.login-button,
.dialog-close,
.dialog-primary,
.ctabtn {
  border: 0;
  cursor: pointer;
}

.language-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.language-button:hover,
.icon-button:hover {
  background: var(--surface-strong);
}

.language-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 180ms ease;
}

.language-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  width: 136px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 14px 34px rgba(16, 24, 22, 0.14);
}

.language-menu button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.language-menu button:hover,
.language-menu button[aria-checked="true"] {
  background: var(--surface-strong);
}

.language-menu button[aria-checked="true"]::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.icon-button {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: #3a5953;
  transition: background-color 180ms ease, color 180ms ease;
}

[data-theme="dark"] .icon-button {
  color: var(--muted);
}

.icon-button svg,
.dialog-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sun-icon,
.close-icon {
  display: none;
}

[data-theme="dark"] .moon-icon {
  display: none;
}

[data-theme="dark"] .sun-icon {
  display: block;
}

.login-button,
.dialog-primary {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 180ms ease, transform 180ms ease;
}

.newapi-hosted .login-button.is-user {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
}

.login-button:hover,
.dialog-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.menu-toggle,
.mobile-menu {
  display: none;
}

main {
  position: relative;
  isolation: isolate;
}

#hero-kv {
  top: 0;
  height: 100%;
}

#hero-field {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100svh;
  pointer-events: none;
}

.hero {
  min-height: 100svh;
}

.hhead,
[data-theme="dark"] .hhead {
  background: var(--paper);
}

.hero + .sheet {
  margin-top: -24vh;
}

.sheet {
  background: transparent;
}

#shift,
#process,
#protocol,
#protocol-parts,
#request-demo,
#ai,
#lab,
#contact {
  content-visibility: visible;
  contain-intrinsic-size: none;
}

.intro {
  margin-top: 0;
}

#lab .ch {
  flex-direction: column;
  align-items: flex-start;
  gap: calc(var(--cell) * 1.5);
}

#lab .ch h2 {
  max-width: 18ch;
}

#lab .ch p {
  max-width: 62ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.62;
}

.caro .track-wrap {
  margin-inline: calc(-1 * var(--gutter));
}

.slide {
  letter-spacing: 0;
}

.slide .t,
.slide .d {
  letter-spacing: 0;
}

.slide .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.slide .tags span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(var(--paper-rgb), 0.54);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.sl-arrow svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

[data-theme="dark"] .ed p,
[data-theme="dark"] .proc .ph .pd,
[data-theme="dark"] .proc .dd,
[data-theme="dark"] #lab .ch p,
[data-theme="dark"] .ed .pts li,
[data-theme="dark"] #shift p.s,
[data-theme="dark"] #ai p.s {
  color: #d8ddd7;
}

[data-theme="dark"] .proc .donut,
[data-theme="dark"] #process .donut,
[data-theme="dark"] #protocol-parts .donut {
  background: transparent;
}

[data-theme="dark"] .btn,
[data-theme="dark"] .cta .ctabtn,
[data-theme="dark"] .sl-arrow {
  background: var(--ink);
  color: var(--paper);
}

.mood-card .smiley {
  color: var(--ink);
  background: var(--neon);
}

.mood-card.is-sad .smiley {
  background: #6778ba;
}

.mood-card .smiley rect {
  fill: currentColor;
}

.procflow {
  min-height: 180px;
}

.procflow canvas {
  width: 100%;
  height: 100%;
}

.api-demo {
  position: relative;
  z-index: 2;
  padding: calc(var(--cell) * 8) var(--gutter);
}

.api-demo-layout {
  display: grid;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  gap: clamp(36px, 6vw, 84px);
  align-items: center;
}

@media (min-width: 900px) {
  .api-demo-layout {
    grid-template-columns: minmax(0, 0.78fr) minmax(560px, 1.22fr);
  }
}

.api-demo-copy {
  max-width: 520px;
}

.api-demo-copy .mono {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 10px;
}

.api-demo-copy h2 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(38px, 5.4vw, 78px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
}

.api-demo-copy > p:last-child {
  max-width: 38ch;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.65;
}

.api-console {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(var(--paper-rgb), 0.96);
  box-shadow: 0 26px 70px rgba(25, 39, 36, 0.12);
  font-family: var(--mono);
}

.api-console-bar {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.api-tabs {
  display: flex;
  min-width: 0;
  align-self: stretch;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

.api-tabs::-webkit-scrollbar {
  display: none;
}

.api-tabs button {
  position: relative;
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0;
  cursor: pointer;
}

.api-tabs button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: #0aa575;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.api-tabs button:hover,
.api-tabs button[aria-selected="true"] {
  color: #078660;
}

.api-tabs button[aria-selected="true"]::after {
  transform: scaleX(1);
}

.api-status {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.api-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #08c486;
  box-shadow: 0 0 0 4px rgba(8, 196, 134, 0.1);
}

.api-route {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.api-route span {
  padding: 4px 7px;
  border-radius: 3px;
  background: rgba(8, 196, 134, 0.12);
  color: #078660;
  font-size: 8px;
  font-weight: 700;
}

.api-route code {
  color: var(--ink);
  font-family: inherit;
  font-size: 11px;
}

.api-console-body {
  display: grid;
  grid-template-rows: minmax(250px, 1.35fr) minmax(170px, 0.9fr);
  min-height: 456px;
}

.api-code-block {
  min-width: 0;
  padding: 18px;
}

.api-code-block + .api-code-block {
  border-top: 1px solid var(--line);
}

.api-code-block > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.api-code-block pre {
  min-width: 0;
  margin: 0;
  overflow: auto;
  color: #1260a8;
  font-family: inherit;
  font-size: clamp(10px, 0.9vw, 12px);
  line-height: 1.68;
  scrollbar-color: var(--line) transparent;
}

.api-code-block code {
  font-family: inherit;
}

.api-response pre {
  color: #078660;
}

.api-console-meta {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.api-console-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 12px;
}

.api-console-meta span:last-child {
  margin-left: auto;
}

[data-theme="dark"] .api-console {
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .api-code-block pre {
  color: #8bb8e8;
}

[data-theme="dark"] .api-response pre {
  color: #70d7b5;
}

.btn,
.cta .ctabtn {
  border: 0;
}

.cta-kicker {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 10px;
}

.cta .ctabtn {
  min-height: 56px;
}

.login-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(10, 18, 16, 0.24);
}

.login-dialog::backdrop {
  background: rgba(16, 24, 22, 0.48);
  backdrop-filter: blur(5px);
}

.login-dialog form {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 36px;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

.dialog-close:hover {
  background: var(--surface-strong);
}

.login-dialog img {
  margin-bottom: 28px;
  border-radius: 8px;
}

.login-dialog .mono {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
}

.login-dialog h2 {
  margin: 0 0 14px;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 0;
}

.login-dialog p:not(.mono) {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .api-demo-layout {
    gap: 42px;
  }

  .site-nav {
    width: calc(100% - 48px);
  }

  .brand {
    min-width: auto;
  }

  .desktop-links {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .menu-toggle[aria-expanded="true"] .menu-icon {
    display: none;
  }

  .menu-toggle[aria-expanded="true"] .close-icon {
    display: block;
  }

  .mobile-menu {
    position: fixed;
    top: var(--nav-height);
    right: 24px;
    left: 24px;
    z-index: 200;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 18px 40px rgba(16, 24, 22, 0.16);
  }

  .mobile-menu:not([hidden]) {
    display: grid;
  }

  .mobile-menu a {
    min-height: 46px;
    padding-inline: 14px;
    border-radius: 6px;
  }

  .mobile-menu a:hover {
    background: var(--surface-strong);
  }
}

@media (max-width: 680px) {
  :root {
    --nav-height: 68px;
  }

  .site-nav {
    width: calc(100% - 32px);
    min-height: var(--nav-height);
    gap: 10px;
  }

  .brand span,
  .language-control,
  .login-button {
    display: none;
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

  #hero-kv {
    top: 0;
    height: 100%;
  }

  .hero + .sheet {
    margin-top: -20vh;
  }

  .slide.cs .reveal-cta {
    display: none;
  }

  .procflow {
    min-height: 128px;
  }

  .api-demo {
    padding: calc(var(--cell) * 5) var(--gutter);
  }

  .api-demo-copy h2 {
    max-width: 11ch;
    font-size: clamp(36px, 12vw, 54px);
  }

  .api-console-bar,
  .api-route,
  .api-code-block,
  .api-console-meta {
    padding-right: 14px;
    padding-left: 14px;
  }

  .api-tabs {
    gap: 18px;
  }

  .api-status {
    display: none;
  }

  .api-console-body {
    grid-template-rows: minmax(280px, 1.35fr) minmax(190px, 0.9fr);
    min-height: 500px;
  }

  .api-code-block pre {
    font-size: 10px;
  }

  .api-console-meta {
    gap: 7px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .api-console-meta span:not(:last-child)::after {
    margin-left: 7px;
  }

  .api-console-meta span:last-child {
    margin-left: 0;
  }

  .login-dialog form {
    padding: 30px 24px 26px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
