:root {
  --bg: #070a12;
  --bg-elevated: #0d1322;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-solid: #0f172a;
  --bg-hover: rgba(30, 41, 59, 0.7);
  --ink: #f8fafc;
  --ink-secondary: #cbd5e1;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(56, 189, 248, 0.35);
  --blue: #2563eb;
  --blue-glow: #38bdf8;
  --amber: #f59e0b;
  --emerald: #10b981;
  --purple: #8b5cf6;
  --danger: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-card: 0 20px 50px -12px rgba(2, 6, 23, 0.7), 0 0 0 1px rgba(148, 163, 184, 0.12);
  --shadow-glow: 0 0 40px -8px rgba(56, 189, 248, 0.25);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -15%, rgba(37, 99, 235, 0.28), transparent),
    radial-gradient(ellipse 50% 40% at 85% 20%, rgba(16, 185, 129, 0.1), transparent),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.35) 1px, transparent 1px),
    linear-gradient(to right, rgba(15, 23, 42, 0.35) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  line-height: 1.65;
  accent-color: var(--blue-glow);
  -webkit-font-smoothing: antialiased;
}

/* Header & Navigation */
header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(7, 10, 18, 0.82);
  border-block-end: 1px solid var(--line);
  padding: 16px 24px;
}

.header-inner,
header > .nav {
  max-inline-size: 1200px;
  margin-inline: auto;
  display: flex;
  align-items: safe center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

header > .sub {
  max-inline-size: 1200px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 14px;
}

.brand {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: safe center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-content: center;
  inline-size: 30px;
  block-size: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #030712;
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
}

.brand-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--blue-glow);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.navlinks {
  display: flex;
  align-items: safe center;
  gap: 20px;
  font-size: 14px;
  flex-wrap: wrap;
}

.navlinks a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.18s ease;
}

.navlinks a:hover,
.navlinks a.active {
  color: var(--blue-glow);
}

.lang {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.85);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lang:hover {
  border-color: var(--blue-glow);
  background: rgba(30, 41, 59, 0.9);
}

/* Containers */
.wrap {
  max-inline-size: 1120px;
  margin-inline: auto;
  padding: 32px 24px 96px;
}

.wrap-wide {
  max-inline-size: 1200px;
  margin-inline: auto;
  padding: 0 24px 96px;
}

/* Hero Section */
.hero {
  padding: 64px 0 48px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: safe center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--blue-glow);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-block-end: 20px;
}

.eyebrow-dot {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.hero h1 {
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.14;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  background: linear-gradient(135deg, #ffffff 30%, #93c5fd 75%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 17px;
  color: var(--ink-secondary);
  margin: 0 0 28px;
  max-inline-size: 62ch;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-block-start: 32px;
  padding-block-start: 24px;
  border-block-start: 1px solid var(--line);
}

.metric-item strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.metric-item span {
  font-size: 13px;
  color: var(--muted);
}

/* Hero Terminal / Code Preview */
.terminal-window {
  background: #050811;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  overflow: clip;
}

.terminal-bar {
  display: flex;
  align-items: safe center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.9);
  border-block-end: 1px solid var(--line);
}

.terminal-dots {
  display: flex;
  gap: 7px;
}

.terminal-dots span {
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ef4444; }
.terminal-dots span:nth-child(2) { background: #f59e0b; }
.terminal-dots span:nth-child(3) { background: #10b981; }

.terminal-tabs {
  display: flex;
  gap: 6px;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--blue-glow);
}

.terminal-body {
  padding: 18px 20px;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
  overflow-x: auto;
  min-block-size: 210px;
}

.tok-kw { color: #c084fc; }
.tok-fn { color: #38bdf8; }
.tok-str { color: #34d399; }
.tok-cm { color: #64748b; }
.tok-num { color: #fbbf24; }

/* Section Headers */
.section-block {
  margin-block-start: 88px;
}

.section-head {
  margin-block-end: 28px;
}

.section-kicker {
  color: var(--blue-glow);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}

.section-head h2 {
  font-size: clamp(24px, 3vw, 32px);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.section-head p {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
  max-inline-size: 72ch;
}

/* Bento Grid & Subgrid Cards */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.bento-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.card,
.feature-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card {
  margin: 20px 0;
}

.feature-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.card h2,
.feature-card h3 {
  font-size: 19px;
  margin: 0 0 8px;
  color: var(--ink);
}

.feature-icon {
  display: inline-grid;
  place-content: center;
  inline-size: 40px;
  block-size: 40px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--blue-glow);
  font-size: 18px;
  margin-block-end: 14px;
}

.feature-icon.amber {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
  color: var(--amber);
}

.feature-icon.emerald {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
  color: var(--emerald);
}

.feature-icon.purple {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.28);
  color: #a78bfa;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  flex-wrap: balance;
  gap: 8px;
  margin-block-start: 14px;
}

.chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
}

.chip.live {
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.chip.hw {
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

/* L0-L4 Architecture Stack */
.arch-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arch-layer {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--blue-glow);
  border-radius: var(--radius-md);
}

.arch-layer.l4 { border-inline-start-color: #a78bfa; }
.arch-layer.l3 { border-inline-start-color: #38bdf8; }
.arch-layer.l2 { border-inline-start-color: #10b981; }
.arch-layer.l1 { border-inline-start-color: #f59e0b; }
.arch-layer.l0 { border-inline-start-color: #f43f5e; }

.arch-level {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.arch-level span {
  display: block;
  font-family: inherit;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.arch-desc {
  font-size: 14px;
  color: var(--ink-secondary);
}

/* Hardware Bus Grid */
.hw-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(12, 19, 36, 0.96));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.hw-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-block-start: 22px;
}

.hw-box {
  background: rgba(7, 10, 18, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
}

.hw-box h4 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--ink);
  display: flex;
  align-items: safe center;
  justify-content: space-between;
}

.hw-box p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* Forms & Controls */
.hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin: 14px 0 6px;
}

input,
textarea,
select {
  inline-size: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(7, 10, 18, 0.85);
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--blue-glow);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

textarea {
  min-block-size: 88px;
  resize: vertical;
}

.row {
  display: flex;
  gap: 14px;
}

.row > div {
  flex: 1;
  min-inline-size: 0;
}

button,
.button {
  border: 0;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: safe center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, background 0.18s ease, border-color 0.18s ease;
}

button:active,
.button:active {
  transform: translateY(1px);
}

.primary {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #fff;
  box-shadow: 0 8px 24px -6px rgba(37, 99, 235, 0.55);
}

.primary:hover {
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
}

.ghost {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--line);
  color: var(--ink);
}

.ghost:hover {
  border-color: var(--blue-glow);
  background: rgba(30, 41, 59, 0.85);
}

.btnrow {
  margin-block-start: 20px;
  display: flex;
  gap: 12px;
  align-items: safe center;
  flex-wrap: wrap;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--muted);
  margin-block-start: 14px;
}

.check input {
  inline-size: 16px;
  block-size: 16px;
  margin-block-start: 3px;
  accent-color: var(--blue-glow);
}

/* Fallback for older browsers without accent-color */
@supports not (accent-color: #38bdf8) {
  .check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--bg);
  }
  .check input[type="checkbox"]:checked {
    background: var(--blue);
    border-color: var(--blue-glow);
  }
}

pre.code {
  background: #050811;
  color: #e2e8f0;
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 12px;
  overflow: auto;
  scrollbar-gutter: stable;
  font-size: 13px;
  line-height: 1.55;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  color: #7dd3fc;
}

pre code {
  color: inherit;
}

.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
  margin: 12px 0;
  font-size: 14px;
}

.kv b {
  color: var(--muted);
  font-weight: 600;
}

/* Status Pills & Alerts */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.p-sandbox { background: rgba(59, 130, 246, 0.18); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.35); }
.p-beta_pending, .p-prod_requested, .p-requested, .p-installing { background: rgba(245, 158, 11, 0.18); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.35); }
.p-approved, .p-active { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.35); }
.p-rejected, .p-failed { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }

.warn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin: 12px 0;
}

.ok {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin: 12px 0;
}

.err,
.bad {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.38);
  color: #fecaca;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin: 12px 0;
}

button.ok,
button.bad {
  padding: 6px 12px;
  margin: 0 4px 0 0;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

html.workspace-locked body > main,
html.workspace-locked body > article.docs,
html.workspace-locked body > .wrap:not(#workspace-auth-gate),
html.workspace-locked body > .wrap-wide,
html.workspace-locked header .navlinks a:not([data-public-nav]),
html.workspace-locked header > .sub {
  display: none !important;
}

/* Tables with responsive container support */
.table-wrapper {
  overflow-x: auto;
  max-inline-size: 100%;
  container-type: inline-size;
  border-radius: var(--radius-md);
}

table {
  inline-size: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.95);
}

th,
td {
  text-align: start;
  padding: 12px 10px;
  border-block-end: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

/* Docs Layout */
.docs {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 36px;
  max-inline-size: 1180px;
  margin-inline: auto;
  padding: 32px 24px 96px;
}

.toc {
  position: sticky;
  inset-block-start: 88px;
  align-self: start;
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
}

.toc a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.toc a:hover {
  color: var(--blue-glow);
  background: rgba(56, 189, 248, 0.08);
}

.doc h1 {
  font-size: 32px;
  margin: 0 0 10px;
}

.doc h2 {
  font-size: 23px;
  margin: 38px 0 12px;
  padding-block-end: 8px;
  border-block-end: 1px solid var(--line);
}

.doc h3 {
  font-size: 17px;
  margin: 22px 0 8px;
  color: var(--ink);
}

.doc p,
.doc li {
  font-size: 15px;
  color: var(--ink-secondary);
}

.doc ul,
.doc ol {
  padding-inline-start: 22px;
}

.doc img {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
}

.badge.ok {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.badge.bad {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

footer {
  max-inline-size: 1200px;
  margin-inline: auto;
  padding: 32px 24px 48px;
  border-block-start: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: safe center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Flagship Visual Hero Stage (product-clean.webp + HUD Callouts + Rotating Badge) */
.hero-visual-stage {
  position: relative;
  margin-block-start: 8px;
  padding: 32px 32px 28px;
  border-radius: var(--radius-xl);
  background: #000000;
  border: 1px solid rgba(56, 189, 248, 0.32);
  box-shadow: var(--shadow-card), 0 0 70px -15px rgba(56, 189, 248, 0.32);
  overflow: clip;
}

.hero-visual-top {
  display: flex;
  align-items: safe center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-block-end: 8px;
  position: relative;
  z-index: 2;
}

.hud-tag {
  display: inline-flex;
  align-items: safe center;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--blue-glow);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 5px 12px;
  border-radius: 999px;
}

.hud-tag::before {
  content: "";
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.hero-product-frame {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-block-size: 340px;
  padding: 4px 0;
  background: #000000;
}

.hero-product-img {
  inline-size: min(100%, 1040px);
  block-size: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  mask-image: radial-gradient(ellipse 92% 88% at 50% 52%, #000 72%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 92% 88% at 50% 52%, #000 72%, transparent 100%);
  filter: contrast(1.1) saturate(1.18);
  cursor: zoom-in;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.hero-product-img:hover {
  transform: scale(1.015);
  filter: contrast(1.15) saturate(1.25);
}

.orbit-seal {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 18px;
  inline-size: 112px;
  block-size: 112px;
  pointer-events: none;
  opacity: 0.9;
}

.orbit-seal svg {
  inline-size: 100%;
  block-size: 100%;
  animation: orbitSpin 22s linear infinite;
}

.orbit-seal-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  color: var(--amber);
  letter-spacing: 0.06em;
}

@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

.hud-callout-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-block-start: 16px;
  padding-block-start: 18px;
  border-block-start: 1px solid var(--line);
}

.hud-callout {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.hud-callout:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.hud-callout-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.06em;
  display: block;
  margin-block-end: 4px;
}

.hud-callout strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
  margin-block-end: 4px;
}

.hud-callout span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* Modular Hardware Showcase (modules.webp + Interactive Switcher + Blueprint SVG) */
.modular-showcase {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 24px;
  margin-block-start: 22px;
  align-items: stretch;
}

.modular-visual-card {
  background: #000000;
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.modular-img-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-block-size: 260px;
  background: #000000;
  border-radius: var(--radius-md);
  overflow: clip;
}

.modular-img {
  inline-size: 100%;
  max-inline-size: 560px;
  block-size: auto;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  mask-image: radial-gradient(ellipse 92% 88% at 50% 50%, #000 72%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 92% 88% at 50% 50%, #000 72%, transparent 100%);
  filter: contrast(1.08) saturate(1.15);
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.modular-img:hover {
  transform: scale(1.03);
}

.module-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 14px;
}

.mod-pill {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mod-pill.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--amber);
  color: #fde68a;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.25);
}

.mod-detail-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.mod-detail-box h4 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #fde68a;
}

.mod-detail-box p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.mod-detail-box pre {
  margin: 0;
  padding: 10px 12px;
  background: #03060c;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: #7dd3fc;
  overflow-x: auto;
}

.blueprint-card {
  background: rgba(7, 10, 18, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.blueprint-svg {
  inline-size: 100%;
  block-size: auto;
  display: block;
  margin-block: 8px;
}

/* Real-World & Hardware Engineering Visual Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.gallery-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: clip;
  border: 1px solid var(--line);
  background: #050811;
  box-shadow: var(--shadow-card);
  cursor: zoom-in;
  group: gallery;
}

.gallery-card.span-7 { grid-column: span 7; }
.gallery-card.span-5 { grid-column: span 5; }
.gallery-card.span-4 { grid-column: span 4; }
.gallery-card.span-6 { grid-column: span 6; }

.gallery-card img {
  inline-size: 100%;
  block-size: 320px;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease, filter 0.35s ease;
  filter: contrast(1.06) saturate(1.12);
}

.gallery-card:hover img {
  transform: scale(1.04);
  filter: contrast(1.12) saturate(1.18);
}

.gallery-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 36px 20px 18px;
  background: linear-gradient(to top, rgba(3, 6, 14, 0.94) 10%, rgba(3, 6, 14, 0.62) 55%, transparent 100%);
}

.gallery-kicker {
  display: inline-flex;
  align-items: safe center;
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-glow);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.32);
  padding: 3px 9px;
  border-radius: 999px;
  margin-block-end: 8px;
}

.gallery-kicker.amber {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.38);
}

.gallery-overlay h3 {
  margin: 0 0 4px;
  font-size: 17px;
  color: #fff;
}

.gallery-overlay p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-secondary);
}

/* Native <dialog> Lightbox Modal */
dialog.lightbox-dialog {
  max-inline-size: min(92vw, 1120px);
  max-block-size: 90vh;
  padding: 16px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(7, 10, 18, 0.96);
  color: var(--ink);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85);
}

/* HDK v1.0 Showcase & Protocol Matrix */
.hdk-banner {
  margin-block-start: 28px;
  background: linear-gradient(145deg, rgba(11, 17, 30, 0.96), rgba(7, 11, 20, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-card), 0 0 50px -18px rgba(245, 158, 11, 0.25);
}

.hdk-head {
  display: flex;
  align-items: safe center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-block-end: 20px;
  padding-block-end: 16px;
  border-block-end: 1px solid var(--line);
}

.hdk-head h3 {
  margin: 4px 0 0;
  font-size: 22px;
  color: var(--ink);
}

.hdk-dl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-block-end: 22px;
}

.hdk-dl-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.hdk-dl-card:hover {
  border-color: var(--amber);
  background: rgba(30, 41, 59, 0.88);
  transform: translateY(-2px);
}

.hdk-dl-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-block-end: 6px;
}

.hdk-dl-card strong {
  font-size: 15px;
  color: var(--ink);
  margin-block-end: 6px;
  display: block;
}

.hdk-dl-card span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.hdk-dl-meta {
  margin-block-start: 12px;
  padding-block-start: 10px;
  border-block-start: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--blue-glow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hdk-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: start;
}

.hdk-pinout-frame {
  background: #060911;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: zoom-in;
}

.hdk-pinout-frame img {
  inline-size: 100%;
  block-size: auto;
  display: block;
  border-radius: 8px;
}

.hdk-proto-box {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
}

.hdk-proto-box h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #fde68a;
}

.hdk-proto-box table {
  font-size: 12.5px;
}

.hdk-proto-box th,
.hdk-proto-box td {
  padding: 8px 8px;
}

dialog.lightbox-dialog::backdrop {
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(8px);
}

.lightbox-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lightbox-inner img {
  max-inline-size: 100%;
  max-block-size: 74vh;
  object-fit: contain;
  border-radius: 10px;
  background: #03060c;
}

.lightbox-bar {
  display: flex;
  align-items: safe center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 36px 0 28px;
  }
  .hud-callout-grid {
    grid-template-columns: 1fr 1fr;
  }
  .modular-showcase,
  .hdk-split {
    grid-template-columns: 1fr;
  }
  .hdk-dl-grid {
    grid-template-columns: 1fr 1fr;
  }
  .gallery-card.span-7,
  .gallery-card.span-5,
  .gallery-card.span-4,
  .gallery-card.span-6 {
    grid-column: span 12;
  }
  .orbit-seal {
    inline-size: 84px;
    block-size: 84px;
  }
  .arch-layer {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 20px 16px 64px;
  }
  .toc {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
    padding: 12px 14px;
  }
  .row {
    flex-direction: column;
  }
  .kv {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.doc,
.card,
.feature-card,
.hero > *,
.modular-showcase > *,
.hdk-split > * {
  min-inline-size: 0;
}

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

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

.card > table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.card > table.hidden {
  display: none !important;
}

.doc-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 20px;
}

.doc-schematic-scroll {
  margin: 14px 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #070a10;
  padding: 10px;
}

.doc-schematic-scroll img {
  width: 100%;
  min-width: 640px;
  height: auto;
  display: block;
  border-radius: 8px;
}

@media (max-width: 768px) {
  header {
    padding: 12px 16px;
  }
  header > .nav {
    gap: 10px;
  }
  .navlinks {
    inline-size: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 14px;
    padding-block: 4px 2px;
  }
  .navlinks::-webkit-scrollbar {
    display: none;
  }
  .navlinks a,
  .navlinks button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .wrap,
  .wrap-wide {
    padding-inline: 16px;
  }
  .terminal-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .terminal-tabs {
    flex-wrap: wrap;
  }
  input,
  textarea,
  select {
    font-size: 16px;
  }
}

@media (max-width: 640px) {
  .doc-media-grid,
  .hdk-dl-grid,
  .hud-callout-grid,
  .hero-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
  .toc {
    grid-template-columns: minmax(0, 1fr);
  }
  .card,
  .hdk-banner,
  .hero-visual-stage,
  .modular-visual-card,
  .blueprint-card {
    padding: 18px 16px;
  }
  .gallery-card img {
    block-size: 230px;
  }
}
