:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-strong: #e8effa;
  --surface: #ffffff;
  --surface-raised: #f4f7fc;
  --surface-soft: #edf4ff;
  --border: #d8e0ed;
  --border-strong: #b9c5d7;
  --text: #071326;
  --muted: #4d5870;
  --dim: #7d8799;
  --blue: #195fe8;
  --blue-strong: #0c4ed6;
  --blue-soft: rgba(25, 95, 232, 0.08);
  --green: #0f8f61;
  --green-soft: rgba(15, 143, 97, 0.09);
  --red: #ce1f1f;
  --red-soft: rgba(206, 31, 31, 0.08);
  --amber: #a66500;
  --amber-soft: rgba(166, 101, 0, 0.1);
  --code-bg: #edf3ff;
  --accent-glow: rgba(25, 95, 232, 0.16);
  --shadow: 0 24px 64px rgba(15, 23, 42, 0.11);
  --mono: "JetBrains Mono", Consolas, "Liberation Mono", Menlo, Monaco, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090c12;
  --bg-strong: #0d111b;
  --surface: #111722;
  --surface-raised: #151d2b;
  --surface-soft: #101b31;
  --border: #263348;
  --border-strong: #34435c;
  --text: #edf3ff;
  --muted: #aab5c8;
  --dim: #73809a;
  --blue: #6ea1ff;
  --blue-strong: #2f6df6;
  --blue-soft: rgba(110, 161, 255, 0.12);
  --green: #57d39a;
  --green-soft: rgba(87, 211, 154, 0.11);
  --red: #ff7b7b;
  --red-soft: rgba(255, 123, 123, 0.1);
  --amber: #f6bd5c;
  --amber-soft: rgba(246, 189, 92, 0.11);
  --code-bg: #0e1629;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
  --accent-glow: rgba(110, 161, 255, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, var(--bg-strong) 0, var(--bg) 380px),
    var(--bg);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  opacity: 0.82;
  background-image:
    linear-gradient(color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px);
  background-position:
    0 0,
    0 0;
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 82% 54% at 50% 0%, #000 20%, transparent 100%);
  animation: grid-drift 28s linear infinite;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  opacity: 0.5;
  background:
    radial-gradient(700px 500px at 50% -120px, var(--accent-glow), transparent 70%),
    linear-gradient(115deg, transparent 0 22%, var(--blue-soft) 32%, transparent 44%),
    linear-gradient(245deg, transparent 0 58%, var(--green-soft) 72%, transparent 86%);
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 860px;
  margin: 0 auto 24px;
  font-size: clamp(3.2rem, 6.4vw, 5.2rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 2.25rem;
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

code,
pre {
  font-family: var(--mono);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

main,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 64px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(1.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 7px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--border) 72%, transparent);
}

.topbar nav,
.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.topbar a,
.footer a {
  text-decoration: none;
}

.topbar a:hover,
.footer a:hover {
  color: var(--blue);
}

.nav-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.actions {
  flex-wrap: wrap;
}

.actions.center {
  justify-content: center;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 17px;
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.external-link::after {
  display: inline-block;
  margin-left: 5px;
  content: "\2197";
  font-size: 0.9em;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform 160ms ease;
}

.external-link:hover::after {
  transform: translate(2px, -3px);
}

.button.compact {
  min-height: 36px;
  padding: 0 13px;
  font-size: 0.78rem;
}

.button-primary {
  color: #ffffff;
  background: var(--blue-strong);
}

.button-secondary {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border-color: var(--border);
}

.button-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

.theme-toggle {
  display: inline-flex;
  position: relative;
  overflow: hidden;
  width: 36px;
  min-width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease;
}

.theme-toggle:hover {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 42%, var(--border));
  background: var(--surface-raised);
}

.theme-toggle:focus-visible,
.copy-button:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.theme-icon {
  position: absolute;
  width: 18px;
  height: 18px;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.theme-icon-sun {
  opacity: 0;
  transform: translateY(8px) rotate(-35deg) scale(0.82);
}

.theme-icon-moon {
  opacity: 1;
  transform: translateY(0) rotate(0) scale(1);
}

:root[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  transform: translateY(0) rotate(0) scale(1);
}

:root[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  transform: translateY(-8px) rotate(35deg) scale(0.82);
}

.section-band {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 74px 24px;
}

.hero {
  display: grid;
  justify-items: center;
  min-height: 700px;
  padding-top: 34px;
  text-align: center;
}

.hero-copy {
  max-width: 930px;
}

.eyebrow,
.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.version-pill {
  min-height: 36px;
  padding: 0 15px;
  color: var(--dim);
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 7%, transparent);
  text-transform: none;
}

.eyebrow span,
.version-pill span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.accent-text {
  color: var(--blue);
}

.lede {
  max-width: 700px;
  margin: 0 auto 30px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  line-height: 1.7;
}

.terminal-shell {
  width: min(100%, 880px);
  margin-top: 62px;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.terminal-shell:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  color: var(--muted);
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.terminal-bar span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot.red {
  background: #ff5f57;
}

.dot.amber {
  background: #febc2e;
}

.dot.green {
  background: #28c840;
}

.terminal-body {
  padding: 22px 24px;
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.75;
}

.terminal-body p {
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.prompt {
  color: var(--blue);
}

.muted {
  color: var(--muted);
}

.indent {
  padding-left: 18px;
}

.danger {
  color: var(--red);
}

.success {
  color: var(--green);
}

.gap {
  margin-top: 16px;
}

.cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 4px;
  vertical-align: middle;
  background: var(--blue);
  animation: blink 1.1s step-end infinite;
}

.section-heading {
  max-width: 700px;
  margin-bottom: 38px;
}

.section-heading.centered {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
}

.transform-section,
.logic-section,
.limits-section,
.quality-section {
  border-top: 1px solid var(--border);
}

.quality-section {
  width: 100%;
  max-width: none;
  padding-right: clamp(24px, 6vw, 96px);
  padding-left: clamp(24px, 6vw, 96px);
  background: color-mix(in srgb, var(--surface) 36%, transparent);
}

.quality-section > * {
  width: min(100%, 1180px);
  margin-right: auto;
  margin-left: 0;
}

.transform-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.code-panel,
.step-card,
.logic-grid article,
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--surface-raised) 70%, transparent);
}

.code-panel {
  overflow: hidden;
}

.code-panel-header {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 16px;
  color: var(--muted);
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.badge {
  font-weight: 750;
}

.badge.success {
  color: var(--green);
}

.badge.danger {
  color: var(--red);
}

pre {
  overflow-x: auto;
  margin: 0;
  padding: 18px;
  color: var(--text);
  background: var(--surface);
  font-size: 0.82rem;
  line-height: 1.72;
}

.key {
  color: var(--blue);
}

.val {
  color: var(--green);
}

.number {
  color: var(--amber);
}

.comment {
  color: var(--dim);
}

.moved {
  color: var(--red);
  opacity: 0.62;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.flow-card {
  display: grid;
  min-width: 148px;
  gap: 8px;
  justify-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  text-align: center;
}

.flow-card strong {
  color: var(--blue);
  font-size: 2rem;
  line-height: 1;
}

.flow-card small {
  max-width: 160px;
  overflow-wrap: anywhere;
}

.workflow-band {
  width: 100%;
  max-width: none;
  padding-right: clamp(24px, 6vw, 96px);
  padding-left: clamp(24px, 6vw, 96px);
  background: color-mix(in srgb, var(--surface) 54%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.workflow-band > * {
  width: min(100%, 1180px);
  margin-right: auto;
  margin-left: 0;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.step-card {
  position: relative;
  min-height: 270px;
  padding: 26px;
  overflow: hidden;
  transition:
    transform 170ms ease,
    border-color 170ms ease,
    background-color 170ms ease;
}

.step-card:hover,
.logic-grid article:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface);
}

.step-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  content: "";
  background: var(--blue);
}

.step-card:nth-child(2)::before {
  background: var(--green);
}

.step-card:nth-child(3)::before {
  background: var(--amber);
}

.step-card:nth-child(4)::before {
  background: var(--green);
}

.step-index {
  display: block;
  margin-bottom: 18px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 750;
}

.step-card p {
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.68;
}

.step-card code {
  display: block;
  overflow-x: auto;
  padding: 12px;
  color: var(--muted);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.step-card code span {
  color: var(--blue);
}

.logic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.logic-grid article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  min-height: 136px;
  padding: 22px;
  transition:
    transform 170ms ease,
    border-color 170ms ease;
}

.logic-marker {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 800;
}

.logic-marker.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.logic-marker.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.logic-marker.green {
  color: var(--green);
  background: var(--green-soft);
}

.logic-marker.red {
  color: var(--red);
  background: var(--red-soft);
}

.logic-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.table-wrap {
  overflow-x: auto;
}

.limits-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.limits-table th,
.limits-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.limits-table th {
  color: var(--dim);
  background: var(--surface-raised);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.limits-table tr:last-child td {
  border-bottom: 0;
}

.limits-table td:first-child,
.limits-table td:nth-child(2) {
  font-family: var(--mono);
  font-weight: 750;
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 750;
}

.pill.strict {
  color: var(--green);
  background: var(--green-soft);
}

.pill.advisory {
  color: var(--amber);
  background: var(--amber-soft);
}

.pill.custom {
  color: var(--muted);
  background: var(--surface-raised);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.chip-grid span {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 64%, transparent);
  font-family: var(--mono);
  font-size: 0.92rem;
  text-align: center;
  padding: 0 18px;
}

.chip-grid span::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  content: "";
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.cta {
  width: min(calc(100% - 48px), 1128px);
  margin: 20px auto 76px;
  padding: 48px 28px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.cta p {
  margin-bottom: 24px;
  color: var(--muted);
}

.install-command {
  display: inline-flex;
  max-width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding: 0 10px 0 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.install-command code {
  min-width: 0;
  overflow-x: auto;
  font-size: 0.84rem;
  white-space: nowrap;
}

.install-command code span {
  color: var(--blue);
}

.copy-button {
  display: inline-flex;
  min-width: 92px;
  height: 30px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-raised);
  cursor: pointer;
}

.copy-button svg {
  width: 15px;
  height: 15px;
}

.copy-button:hover,
.copy-button.copied {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 45%, var(--border));
}

.copy-button span {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.footer {
  display: grid;
  grid-template-columns: minmax(180px, auto) 1fr minmax(180px, auto);
  align-items: center;
  gap: 32px;
  padding: 34px 48px;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 78%, #000000 10%);
  border-top: 1px solid var(--border);
}

.footer-version {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
}

.release-icon {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.footer > span {
  justify-self: end;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.82rem;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes grid-drift {
  from {
    background-position:
      0 0,
      0 0;
  }

  to {
    background-position:
      56px 56px,
      56px 56px;
  }
}

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

@media (max-width: 980px) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 1.9rem;
  }

  .topbar,
  .footer {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 18px 20px;
  }

  .topbar nav,
  .footer nav {
    justify-content: flex-start;
  }

  .transform-grid,
  .workflow-grid,
  .logic-grid {
    grid-template-columns: 1fr;
  }

  .flow-card {
    min-height: 90px;
  }

  .flow-card strong {
    transform: rotate(90deg);
  }

  .chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  h1 {
    font-size: 2.35rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .topbar nav {
    display: none;
  }

  .topbar {
    gap: 14px;
  }

  .nav-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .section-band {
    padding: 54px 18px;
  }

  .hero {
    min-height: auto;
    padding-top: 38px;
  }

  .terminal-body {
    padding: 18px;
    font-size: 0.78rem;
  }

  pre {
    padding: 16px;
    font-size: 0.76rem;
  }

  .limits-table {
    min-width: 640px;
    font-size: 0.84rem;
  }

  .limits-table th,
  .limits-table td {
    padding: 13px 14px;
  }

  .code-panel-header {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 12px 16px;
  }

  .chip-grid {
    grid-template-columns: 1fr;
  }

  .cta {
    width: calc(100% - 32px);
    padding: 40px 18px;
  }

  .install-command {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.05rem;
  }

  h2 {
    font-size: 1.45rem;
  }

  .actions .button {
    width: 100%;
  }

  .actions {
    width: 100%;
  }

  .hero {
    padding-top: 30px;
  }

  .version-pill {
    max-width: 100%;
    justify-content: center;
    text-align: center;
  }

  .terminal-shell {
    margin-top: 42px;
  }

  .terminal-body {
    padding: 16px;
    font-size: 0.72rem;
  }

  .step-card,
  .logic-grid article {
    padding: 20px;
  }

  .logic-grid article {
    grid-template-columns: 1fr;
  }

  .install-command {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .install-command code {
    width: 100%;
  }

  .copy-button {
    width: 100%;
  }
}
