:root {
  --ink: #1c2130;
  --paper: #f7f6ff;
  --panel: rgba(248, 249, 255, 0.88);
  --accent: #1197d8;
  --accent-2: #8459ff;
  --accent-3: #5a52d9;
  --muted: #5a6175;
  --line: rgba(90, 97, 117, 0.18);
  --line-strong: rgba(17, 151, 216, 0.22);
  --shadow: 0 16px 36px rgba(22, 18, 46, 0.1);
  --font-xs: 0.68rem;
  --font-sm: 0.76rem;
  --font-md: 0.875rem;
  --font-base: 0.94rem;
  --font-lg: 1.02rem;
  --font-xl: 1.18rem;
  --font-2xl: 1.48rem;
  --font-3xl: 1.82rem;
  --font-display: 2.1rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: var(--font-md);
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 10%, rgba(80, 221, 255, 0.2), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(141, 101, 255, 0.18), transparent 30%),
    linear-gradient(160deg, #fcfbff 0%, #f2f6ff 46%, #eef0ff 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(17, 151, 216, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 151, 216, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 88%);
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.32;
  z-index: -1;
}

.bg-orb-a {
  width: 320px;
  height: 320px;
  background: rgba(132, 89, 255, 0.55);
  top: -110px;
  right: 4vw;
}

.bg-orb-b {
  width: 360px;
  height: 360px;
  background: rgba(17, 151, 216, 0.34);
  bottom: -150px;
  left: 2vw;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.72rem clamp(0.9rem, 2.5vw, 2rem);
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-size: var(--font-lg);
  font-weight: 700;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  justify-content: flex-end;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.22rem 0.42rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: var(--font-md);
}

.site-nav a:hover {
  border-color: rgba(17, 151, 216, 0.16);
  background: rgba(255, 255, 255, 0.55);
}

.page {
  width: min(1360px, 94vw);
  margin: 0 auto 2.3rem;
}

.site-footer {
  padding: 0 0 1.2rem;
}

.footer-inner {
  width: min(1360px, 94vw);
  margin: 0 auto;
  padding: 0.65rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 249, 255, 0.9);
  box-shadow: var(--shadow);
}

.footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.copyleft-mark {
  width: 16px;
  height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex: 0 0 auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  font-size: var(--font-sm);
}

.footer-links a:hover {
  border-color: rgba(17, 151, 216, 0.16);
  background: rgba(255, 255, 255, 0.55);
}

.hero,
.panel,
.card,
.callout,
.feature-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero {
  border-radius: 24px;
  padding: clamp(0.9rem, 2vw, 1.35rem);
}

.hero-home {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 360px);
  gap: 0.9rem;
}

.hero-copy {
  display: grid;
  gap: 0.62rem;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
  padding: 0.72rem;
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(243, 246, 255, 0.92)),
    linear-gradient(180deg, rgba(17, 151, 216, 0.08), transparent);
  border: 1px solid var(--line-strong);
}

.eyebrow {
  margin: 0;
  font-size: var(--font-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Baskervville", Georgia, serif;
  font-weight: 400;
}

h1 {
  font-size: var(--font-display);
  line-height: 1.08;
}

h2 {
  font-size: var(--font-2xl);
  line-height: 1.12;
}

h3 {
  font-size: var(--font-lg);
  line-height: 1.18;
}

p {
  margin: 0;
  line-height: 1.48;
  overflow-wrap: break-word;
}

.lede,
.panel-note,
.inline-note,
.section-why,
.related-link span {
  color: var(--muted);
}

.lede {
  font-size: var(--font-base);
}

.panel-note,
.inline-note,
.section-why {
  font-size: var(--font-sm);
}

.hero-actions,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 34px;
  padding: 0.42rem 0.68rem;
  border-radius: 9px;
  text-decoration: none;
  border: 0;
  font-family: inherit;
  font-weight: 600;
  font-size: var(--font-sm);
  line-height: 1.18;
  text-align: center;
  white-space: normal;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.btn-secondary {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 255, 0.92));
  border: 1px solid rgba(17, 151, 216, 0.16);
}

.hero-lab-dock {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(300px, 1fr) minmax(300px, 0.95fr);
  align-items: end;
  gap: clamp(0.8rem, 2vw, 1.6rem);
  padding-top: 0.2rem;
}

.hero-dock-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.65rem, 1.6vw, 1rem);
}

.hero-dock-cluster-green {
  justify-content: center;
}

.hero-dock-cluster-blue {
  justify-content: end;
}

.lab-orb-button {
  width: 154px;
  aspect-ratio: 1;
  display: inline-grid;
  place-content: center;
  gap: 0.16rem;
  border: 0;
  border-radius: 50%;
  color: var(--orb-text, #fff6f2);
  text-decoration: none;
  background:
    radial-gradient(circle at 50% 58%, var(--orb-depth), transparent 48%),
    radial-gradient(circle at 36% 26%, var(--orb-glint), transparent 24%),
    radial-gradient(circle at 52% 48%, var(--orb-top) 0%, var(--orb-mid) 54%, var(--orb-bottom) 100%);
  box-shadow:
    inset 0 16px 28px var(--orb-inner-top),
    inset 0 -24px 34px var(--orb-inner-bottom),
    0 16px 22px var(--orb-shadow),
    0 0 0 7px rgba(255, 255, 255, 0.72),
    0 0 0 9px var(--orb-ring);
  font: inherit;
  font-size: var(--font-lg);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 2px 3px var(--orb-text-shadow);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.lab-orb-button:hover,
.lab-orb-button:focus-visible {
  filter: saturate(1.07) brightness(1.03);
  transform: translateY(-1px);
}

.lab-orb-button:active {
  transform: translateY(2px) scale(0.99);
  box-shadow:
    inset 0 26px 34px var(--orb-active-top),
    inset 0 -12px 20px var(--orb-active-bottom),
    0 7px 12px var(--orb-active-shadow),
    0 0 0 7px rgba(255, 255, 255, 0.7),
    0 0 0 9px var(--orb-ring);
}

.lab-orb-button span {
  display: block;
}

.lab-orb-red {
  width: 184px;
  --orb-text: #fff6f2;
  --orb-depth: rgba(96, 4, 4, 0.38);
  --orb-glint: rgba(255, 213, 191, 0.78);
  --orb-top: #ef342e;
  --orb-mid: #b80f16;
  --orb-bottom: #6d050b;
  --orb-inner-top: rgba(255, 184, 157, 0.36);
  --orb-inner-bottom: rgba(49, 0, 4, 0.58);
  --orb-shadow: rgba(112, 4, 12, 0.26);
  --orb-ring: rgba(102, 5, 12, 0.16);
  --orb-text-shadow: rgba(60, 0, 4, 0.42);
  --orb-active-top: rgba(45, 0, 4, 0.52);
  --orb-active-bottom: rgba(255, 183, 154, 0.2);
  --orb-active-shadow: rgba(112, 4, 12, 0.22);
}

.lab-orb-green {
  --orb-text: #f2fff8;
  --orb-depth: rgba(2, 82, 35, 0.36);
  --orb-glint: rgba(214, 255, 225, 0.8);
  --orb-top: #34d66e;
  --orb-mid: #12984c;
  --orb-bottom: #07552c;
  --orb-inner-top: rgba(201, 255, 218, 0.36);
  --orb-inner-bottom: rgba(0, 40, 22, 0.56);
  --orb-shadow: rgba(5, 103, 54, 0.24);
  --orb-ring: rgba(8, 93, 50, 0.15);
  --orb-text-shadow: rgba(0, 39, 22, 0.42);
  --orb-active-top: rgba(0, 44, 23, 0.5);
  --orb-active-bottom: rgba(200, 255, 218, 0.2);
  --orb-active-shadow: rgba(5, 103, 54, 0.2);
}

.lab-orb-blue {
  --orb-text: #f2fbff;
  --orb-depth: rgba(3, 49, 110, 0.36);
  --orb-glint: rgba(214, 249, 255, 0.82);
  --orb-top: #28b6ff;
  --orb-mid: #1076e6;
  --orb-bottom: #073b90;
  --orb-inner-top: rgba(210, 248, 255, 0.38);
  --orb-inner-bottom: rgba(2, 22, 76, 0.56);
  --orb-shadow: rgba(7, 75, 163, 0.24);
  --orb-ring: rgba(7, 72, 151, 0.15);
  --orb-text-shadow: rgba(2, 20, 70, 0.4);
  --orb-active-top: rgba(2, 22, 76, 0.5);
  --orb-active-bottom: rgba(210, 248, 255, 0.2);
  --orb-active-shadow: rgba(7, 75, 163, 0.2);
}

.welcome-overlay[hidden] {
  display: none;
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(0.9rem, 4vw, 2rem);
  background: rgba(12, 17, 31, 0.54);
  backdrop-filter: blur(8px);
}

.welcome-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(82vh, 720px);
  overflow: auto;
  display: grid;
  gap: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 18px;
  padding: clamp(0.95rem, 2.5vw, 1.35rem);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 255, 0.96)),
    radial-gradient(circle at 12% 0%, rgba(239, 52, 46, 0.12), transparent 36%);
  box-shadow: 0 24px 70px rgba(8, 11, 24, 0.34);
  outline: none;
}

.welcome-panel h2 {
  padding-right: 5rem;
}

.welcome-panel p:not(.eyebrow) {
  font-size: var(--font-base);
}

.welcome-markdown {
  display: grid;
  gap: 0.7rem;
}

.welcome-markdown h1 {
  font-size: var(--font-2xl);
  line-height: 1.08;
}

.welcome-markdown h2 {
  font-size: var(--font-xl);
  line-height: 1.12;
}

.welcome-markdown h3 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: var(--font-base);
  font-weight: 700;
  line-height: 1.24;
}

.welcome-markdown ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.46rem;
}

.welcome-markdown ul ul {
  margin-top: 0.36rem;
  gap: 0.34rem;
}

.welcome-markdown li {
  line-height: 1.42;
}

.welcome-markdown code {
  display: inline;
  margin: 0;
  padding: 0.08rem 0.24rem;
  border-radius: 6px;
  font-size: 0.92em;
}

.welcome-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  min-height: 34px;
  padding: 0.32rem 0.54rem;
  border: 1px solid rgba(17, 151, 216, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

body.welcome-open {
  overflow: hidden;
}

.text-link {
  color: var(--accent-3);
  text-decoration: none;
  font-weight: 600;
}

.section-block {
  margin-top: 0.85rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.section-head > * {
  min-width: 0;
}

.section-head.compact {
  margin-bottom: 0.7rem;
}

.section-head h2 {
  font-size: var(--font-3xl);
}

.section-head .panel-note {
  max-width: 46rem;
}

.metric-grid,
.card-grid,
.callout-grid,
.feature-grid,
.inventory-layout,
.detail-layout {
  display: grid;
  gap: 0.64rem;
}

.metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
}

.metric-card,
.mini-card {
  min-width: 0;
  border-radius: 16px;
  padding: 0.58rem 0.68rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(244, 247, 255, 0.88));
  border: 1px solid rgba(17, 151, 216, 0.14);
}

.metric-label {
  display: block;
  margin-bottom: 0.28rem;
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.metric-card strong,
.mini-card strong {
  font-size: var(--font-xl);
  line-height: 1.1;
}

.callout-grid {
  margin-top: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.callout {
  border-radius: 18px;
  padding: 0.72rem 0.8rem;
}

.callout h2 {
  font-size: var(--font-2xl);
}

.callout-live {
  background: linear-gradient(150deg, rgba(240, 251, 255, 0.98), rgba(252, 254, 255, 0.92));
}

.callout-legacy {
  background: linear-gradient(150deg, rgba(248, 243, 255, 0.98), rgba(253, 252, 255, 0.9));
}

.callout-archive {
  background: linear-gradient(150deg, rgba(243, 247, 255, 0.98), rgba(251, 249, 255, 0.9));
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.card,
.feature-card,
.panel {
  border-radius: 20px;
  padding: 0.72rem;
}

.section-card {
  display: grid;
  gap: 0.58rem;
  align-content: start;
}

.card-kicker {
  color: var(--accent-2);
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.22rem 0.46rem;
  border-radius: 999px;
  background: rgba(17, 151, 216, 0.11);
  color: var(--accent);
  font-size: var(--font-xs);
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  border: 1px solid rgba(17, 151, 216, 0.14);
}

.chip-muted {
  background: rgba(132, 89, 255, 0.1);
  color: var(--accent-2);
  border-color: rgba(132, 89, 255, 0.14);
}

.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.feature-card {
  display: grid;
  gap: 0.58rem;
}

.feature-card h3 {
  font-size: var(--font-xl);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
  align-items: flex-start;
}

.detail-layout {
  margin-top: 1rem;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 330px);
  align-items: start;
}

.detail-main,
.detail-sidebar {
  display: grid;
  gap: 0.72rem;
}

.asset-list {
  display: grid;
  gap: 0.64rem;
}

.asset-card {
  border-radius: 16px;
  padding: 0.64rem;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 255, 0.88));
  border: 1px solid rgba(17, 151, 216, 0.12);
}

.asset-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.58rem;
  margin-bottom: 0.42rem;
}

.asset-kind {
  padding: 0.2rem 0.42rem;
  border-radius: 999px;
  background: rgba(132, 89, 255, 0.12);
  color: var(--accent-2);
  font-size: var(--font-xs);
  white-space: nowrap;
}

code {
  display: block;
  margin-top: 0.55rem;
  padding: 0.46rem 0.54rem;
  border-radius: 13px;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: var(--font-xs);
  color: #20323b;
  background: rgba(17, 151, 216, 0.07);
  border: 1px solid rgba(17, 151, 216, 0.1);
  overflow-wrap: anywhere;
}

.stack-links {
  display: grid;
  gap: 0.65rem;
}

.related-link {
  display: grid;
  gap: 0.28rem;
  padding: 0.58rem 0.64rem;
  text-decoration: none;
  color: var(--ink);
  border-radius: 14px;
  border: 1px solid rgba(90, 82, 217, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.related-link:hover {
  border-color: rgba(17, 151, 216, 0.2);
}

.clean-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
}

.compact-list li {
  line-height: 1.38;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: 0.42rem;
}

.mini-card {
  display: grid;
  gap: 0.25rem;
}

.mini-card span {
  min-width: 0;
  font-size: var(--font-sm);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.inventory-layout {
  margin-top: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.archive-card {
  display: grid;
  gap: 0.45rem;
}

.demo-layout {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 0.68rem;
  align-items: start;
}

.top-gap {
  margin-top: 0.85rem;
}

.demo-sidebar,
.demo-main {
  display: grid;
  gap: 0.72rem;
}

.control-panel {
  display: grid;
  gap: 0.64rem;
}

.control-group {
  display: grid;
  gap: 0.35rem;
}

.control-group label {
  font-weight: 600;
}

.control-group input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.slider-meta,
.chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.58rem;
  color: var(--muted);
  font-size: var(--font-xs);
}

.slider-meta output {
  font-weight: 700;
  color: var(--ink);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.preset-btn {
  padding: 0.34rem 0.54rem;
  border-radius: 999px;
  border: 1px solid rgba(17, 151, 216, 0.14);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--font-sm);
  cursor: pointer;
}

.preset-btn:hover,
.preset-btn:focus-visible {
  outline: none;
  border-color: rgba(17, 151, 216, 0.3);
  background: rgba(240, 251, 255, 0.92);
}

.demo-note {
  display: grid;
  gap: 0.35rem;
  padding: 0.68rem 0.78rem;
  border-radius: 16px;
  border: 1px solid rgba(90, 82, 217, 0.12);
  background: rgba(246, 247, 255, 0.82);
}

.demo-callout-grid {
  margin-top: 1rem;
}

.chart-card {
  display: grid;
  gap: 0.7rem;
}

.chart-frame {
  min-height: 240px;
}

.svg-chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart-axis {
  stroke: rgba(30, 35, 40, 0.22);
  stroke-width: 1.4;
}

.chart-bar {
  fill: rgba(17, 151, 216, 0.78);
}

.chart-line {
  fill: none;
  stroke: rgba(17, 151, 216, 0.92);
  stroke-width: 3.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-line-alt {
  stroke: rgba(132, 89, 255, 0.92);
}

.chart-point {
  fill: rgba(90, 82, 217, 0.96);
  stroke: #fff;
  stroke-width: 3;
}

.gridworld {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.grid-cell {
  min-height: 96px;
  border-radius: 16px;
  padding: 0.58rem;
  border: 1px solid rgba(17, 151, 216, 0.14);
  display: grid;
  align-content: space-between;
  gap: 0.35rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.grid-cell strong {
  font-size: var(--font-xl);
}

.grid-cell.path-active {
  border-color: rgba(51, 95, 139, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 0 0 3px rgba(51, 95, 139, 0.09);
}

.path-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  width: fit-content;
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
  border: 1px solid rgba(17, 151, 216, 0.18);
  background: rgba(216, 245, 255, 0.92);
  color: #15435e;
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.grid-cell.goal .path-step {
  background: rgba(226, 248, 240, 0.94);
  border-color: rgba(18, 110, 97, 0.18);
  color: #165747;
}

.grid-cell.hole .path-step {
  background: rgba(255, 240, 232, 0.94);
  border-color: rgba(201, 101, 55, 0.18);
  color: #8a4a29;
}

.grid-cell.goal {
  border-color: rgba(17, 151, 216, 0.26);
}

.grid-cell.hole {
  border-color: rgba(132, 89, 255, 0.22);
}

.grid-cell.start {
  border-color: rgba(90, 82, 217, 0.24);
}

.grid-cell-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: start;
}

.tile-badge,
.arrow-badge,
.path-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0.14rem 0.4rem;
  border-radius: 999px;
  font-size: var(--font-xs);
  border: 1px solid rgba(17, 151, 216, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.grid-caption {
  color: var(--muted);
  font-size: var(--font-sm);
}

.path-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.path-chip-start {
  background: rgba(90, 82, 217, 0.12);
  border-color: rgba(90, 82, 217, 0.16);
  color: var(--accent-3);
}

.detail-layout-demo {
  margin-top: 1.2rem;
}

.glossary-card {
  align-content: start;
}

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.85rem;
}

.tab-btn {
  min-height: 34px;
  padding: 0.42rem 0.66rem;
  border-radius: 999px;
  border: 1px solid rgba(17, 151, 216, 0.14);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.lunar-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, 320px);
  gap: 0.78rem;
  align-items: start;
}

.grabber-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, 320px);
  gap: 0.78rem;
  align-items: start;
}

.lunar-hero-copy,
.lunar-hero-side,
.grabber-hero-copy,
.grabber-hero-side {
  display: grid;
  gap: 0.58rem;
}

.lunar-hero-side,
.grabber-hero-side {
  align-content: start;
}

.lunar-hero h1,
.grabber-hero h1 {
  font-size: var(--font-display);
}

.lunar-layout {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 320px);
  gap: 0.68rem;
  align-items: start;
}

.grabber-layout {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 340px);
  gap: 0.68rem;
  align-items: start;
}

.lunar-stage,
.lunar-sidebar {
  display: grid;
  gap: 0.64rem;
}

.grabber-stage,
.grabber-sidebar {
  display: grid;
  gap: 0.64rem;
}

.stage-panel,
.tab-panel {
  display: none;
}

.stage-panel {
  display: grid;
  gap: 0.58rem;
}

.tab-panel.is-active {
  display: grid;
  gap: 0.58rem;
}

.stage-head {
  display: flex;
  justify-content: space-between;
  gap: 0.58rem;
  align-items: start;
}

.stage-screen {
  border-radius: 18px;
  padding: 0.45rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(113, 212, 255, 0.18), transparent 42%),
    linear-gradient(180deg, #12152d 0%, #171b36 46%, #222646 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-image {
  display: block;
  width: 100%;
  height: min(34vw, 390px);
  object-fit: contain;
  border-radius: 14px;
  background: rgba(6, 10, 19, 0.88);
}

.grabber-screen {
  background:
    radial-gradient(circle at 50% 10%, rgba(241, 196, 81, 0.12), transparent 38%),
    linear-gradient(180deg, #060c14 0%, #0f1724 52%, #121a28 100%);
}

.stage-canvas {
  display: block;
  width: 100%;
  height: min(36vw, 420px);
  border-radius: 14px;
  background: rgba(6, 10, 19, 0.92);
}

.field-stack {
  display: grid;
  gap: 0.25rem;
}

.field-stack span {
  font-weight: 600;
  font-size: var(--font-sm);
}

.field-stack select,
.field-stack input[type="range"] {
  width: 100%;
}

.lunar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.control-cluster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.control-group,
.config-card {
  display: grid;
  gap: 0.42rem;
  padding: 0.62rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(17, 151, 216, 0.12);
}

.grabber-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.54rem;
}

.config-fields {
  display: grid;
  gap: 0.42rem;
}

.config-fields input {
  width: 100%;
}

.timeline-shell {
  display: grid;
  gap: 0.54rem;
}

.timeline-controls {
  display: grid;
  gap: 0.42rem;
}

.gauge-stack {
  display: grid;
  gap: 0.46rem;
}

.dof-gauge {
  display: grid;
  gap: 0.24rem;
}

.dof-gauge-shoulder {
  --gauge-color: rgba(69, 219, 205, 0.9);
}

.dof-gauge-elbow {
  --gauge-color: rgba(255, 122, 82, 0.92);
}

.dof-gauge-grip {
  --gauge-color: rgba(241, 196, 81, 0.92);
}

.gauge-head {
  display: flex;
  justify-content: space-between;
  gap: 0.42rem;
  align-items: center;
  font-size: var(--font-sm);
  font-weight: 600;
}

.gauge-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(17, 23, 34, 0.84) 0%, rgba(17, 23, 34, 0.84) 49%, rgba(235, 239, 244, 0.4) 50%, rgba(17, 23, 34, 0.84) 51%, rgba(17, 23, 34, 0.84) 100%);
}

.gauge-track::after {
  content: "";
  position: absolute;
  inset: 2px calc(50% - 1px) 2px auto;
  width: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
}

.gauge-fill {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 999px;
  background: var(--gauge-color);
  width: 0;
  left: 50%;
  opacity: 0.35;
  box-shadow: 0 0 14px color-mix(in srgb, var(--gauge-color) 60%, transparent);
}

.editor-shell {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(17, 151, 216, 0.14);
  background: #fff;
}

.ace-host,
.editor-fallback {
  min-height: 360px;
  width: 100%;
}

.editor-fallback {
  padding: 0.78rem;
  border: 0;
  resize: vertical;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: var(--font-sm);
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
}

.state-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.54rem 0.58rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(17, 151, 216, 0.12);
}

.state-card strong {
  font-size: var(--font-sm);
}

.job-list {
  display: grid;
  gap: 0.34rem;
}

.job-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.42rem;
  padding: 0.46rem 0.54rem;
  border-radius: 14px;
  border: 1px solid rgba(17, 151, 216, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-size: var(--font-sm);
  cursor: pointer;
}

.job-chip.is-selected {
  border-color: rgba(90, 82, 217, 0.24);
  background: rgba(243, 242, 255, 0.95);
}

.log-viewer {
  margin: 0;
  min-height: 180px;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 16px;
  padding: 0.64rem;
  background: rgba(16, 23, 45, 0.92);
  color: #f3f6ff;
  border: 1px solid rgba(90, 82, 217, 0.16);
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: var(--font-xs);
  line-height: 1.38;
}

@media (max-width: 980px) {
  .hero-home,
  .detail-layout,
  .inventory-layout,
  .demo-layout,
  .lunar-hero,
  .lunar-layout,
  .grabber-hero,
  .grabber-layout {
    grid-template-columns: 1fr;
  }

  .stage-image,
  .stage-canvas {
    height: min(60vw, 360px);
  }

  .hero-lab-dock {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .hero-dock-cluster,
  .hero-dock-cluster-blue {
    justify-content: center;
  }
}

@media (max-width: 760px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .page {
    width: min(94vw, 1180px);
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

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

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

  .control-cluster,
  .grabber-form-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    width: min(94vw, 1180px);
    align-items: flex-start;
  }

  .lab-orb-button,
  .lab-orb-red {
    width: min(154px, 42vw);
  }

  .hero-lab-dock {
    gap: 0.9rem;
  }

  .welcome-panel h2 {
    padding-right: 0;
  }

  .welcome-close {
    position: static;
    justify-self: end;
  }
}
