/* ==========================================================================
   Design System: se-skills
   Strict adherence to international design standards:
   - Unified typeface family (Inter for UI, JetBrains Mono strictly for code)
   - Zero border visual cages (surface elevation and negative space hierarchy)
   - High-contrast, authentic developer tool aesthetic
   - Tabular-nums for numeric alignment
   ========================================================================== */

:root {
  /* Surface Elevation Hierarchy */
  --bg: #090a0f;
  --surface-0: #090a0f;
  --surface-1: #0e1117;
  --surface-2: #141822;
  --surface-3: #1c2230;
  --surface-hover: #181f2c;
  --surface-active: #222b3c;

  /* Subtle Dividers (No Harsh or Opaque Borders) */
  --divider: rgba(255, 255, 255, 0.075);
  --divider-subtle: rgba(255, 255, 255, 0.04);
  --focus-ring: #38bdf8;

  /* 3-Tier Semantic Typography Tokens (Inter) */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Semantic Status & Syntax Accents */
  --cyan: #38bdf8;
  --emerald: #34d399;
  --rose: #f87171;
  --amber: #fbbf24;
  --purple: #c084fc;

  /* Typeface Standards */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.25) transparent;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.25) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  transition: background 0.15s ease;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--cyan);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--text-primary);
  color: var(--bg);
  padding: 8px 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 1000;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Brand */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(9, 10, 15, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--divider);
  height: 60px;
  display: flex;
  align-items: center;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  display: block;
  flex-shrink: 0;
}

.brand-title {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

/* Navigation Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger[aria-expanded="true"] {
  color: var(--text-primary);
}

.dropdown-chevron {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-dropdown-trigger[aria-expanded="true"] .dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 170px;
  background: var(--surface-2);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100;
}

.nav-dropdown-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 500;
  border-radius: calc(var(--radius-sm) - 2px);
  transition: background 0.12s ease, color 0.12s ease;
}

.dropdown-item:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

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

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--surface-1);
  color: var(--text-secondary);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-header:hover {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 84px 0 64px;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(56, 189, 248, 0.08), transparent 75%);
}

.hero-heading {
  font-size: clamp(2.1rem, 4.5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
  max-width: 840px;
  color: var(--text-primary);
}

.hero-sub {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 720px;
  margin-bottom: 36px;
}

/* Console Command Box */
.console-box {
  background: var(--surface-1);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  max-width: 760px;
  margin-bottom: 40px;
  overflow: hidden;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.5);
}

.console-nav {
  display: flex;
  background: var(--surface-2);
  border-bottom: none;
  padding: 6px;
  gap: 4px;
}

.console-tab-btn {
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.console-tab-btn:hover {
  color: var(--text-secondary);
  background: var(--surface-3);
}

.console-tab-btn.active {
  background: var(--surface-1);
  color: var(--cyan);
  font-weight: 600;
}

.console-content {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.console-cmd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.925rem;
  color: var(--text-primary);
  overflow-x: auto;
}

.console-prompt-char {
  color: var(--text-muted);
  user-select: none;
}

.btn-copy-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--surface-3);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-copy-action:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--cyan);
}

.btn-copy-action.copied {
  background: rgba(52, 211, 153, 0.15);
  color: var(--emerald);
  border-color: rgba(52, 211, 153, 0.35);
}

.console-explainer {
  padding: 10px 20px;
  font-size: 0.775rem;
  color: var(--text-muted);
  border-top: 1px solid var(--divider-subtle);
  background: var(--surface-1);
}

/* Common Section Layout */
.section {
  padding: 72px 0;
  border-top: 1px solid var(--divider);
}

.section-h2 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.section-p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 660px;
  margin-bottom: 36px;
  line-height: 1.6;
}

/* Quickstart Flow (Vertical Lineage, No Visual Cages) */
.flow-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 820px;
}

.flow-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 18px;
  padding: 20px 24px;
  background: var(--surface-1);
  border: 1px solid var(--divider-subtle);
  border-radius: var(--radius-md);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.flow-row:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.1);
}

.flow-number {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cyan);
  background: var(--surface-2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.flow-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.flow-body p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.inline-code-box {
  background: var(--bg);
  border: 1px solid var(--divider-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.inline-code-box code {
  color: var(--text-primary);
  font-family: inherit;
}

.btn-inline-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.btn-inline-copy:hover {
  color: var(--text-primary);
}

.btn-inline-copy.copied {
  color: var(--emerald);
}

/* Scenario Selector for Workbench */
.workbench-scenarios {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.scenario-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface-1);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.scenario-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.scenario-btn.active {
  background: var(--surface-3);
  color: var(--cyan);
  font-weight: 600;
}

.workbench {
  background: var(--surface-1);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.workbench-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--divider);
  gap: 12px;
  flex-wrap: wrap;
}

.workbench-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-icon {
  color: var(--text-muted);
}

.file-name {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  color: var(--text-primary);
  font-weight: 500;
}

.file-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-3);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.workbench-view-toggle {
  display: flex;
  background: var(--surface-1);
  border: none;
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.view-toggle-btn.active {
  background: var(--surface-3);
  color: var(--cyan);
}

.workbench-view {
  display: none;
}

.workbench-view.active {
  display: block;
}

/* Mode 1: Split View (Side by Side) */
.split-view.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
}

.code-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.pane-baseline {
  border-right: 1px solid var(--divider);
}

.pane-header {
  padding: 12px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--divider-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pane-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}



.pane-body {
  padding: 20px;
  flex-grow: 1;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
  -webkit-overflow-scrolling: touch;
}

.code-block {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
  white-space: pre;
  min-width: max-content;
}

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

/* Sleek Ergonomic Custom Scrollbars (Linear & Raycast Aesthetic) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 999px;
  transition: background 0.15s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.pane-footer {
  padding: 14px 18px;
  background: var(--surface-1);
  border-top: 1px solid var(--divider-subtle);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.footer-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 4px;
}

.footer-baseline .footer-label {
  color: var(--rose);
}

.footer-enforced .footer-label {
  color: var(--cyan);
}

/* Mode 2: Unified Diff View */
.diff-header {
  padding: 8px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--divider);
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--text-muted);
}

.diff-body {
  overflow-x: auto;
  background: var(--bg);
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  line-height: 1.65;
}

.diff-line td {
  padding: 2px 8px;
}

.diff-gutter-num {
  width: 32px;
  text-align: right;
  color: var(--text-muted);
  user-select: none;
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  opacity: 0.6;
}

.diff-marker {
  width: 14px;
  text-align: center;
  user-select: none;
  font-weight: 600;
  font-size: 0.8rem;
}

.diff-code {
  white-space: pre;
  color: var(--text-secondary);
}

.diff-line.diff-del {
  background: rgba(248, 113, 113, 0.08);
}

.diff-line.diff-del .diff-marker {
  color: var(--rose);
}

.diff-line.diff-del .diff-code {
  color: #fca5a5;
}

.diff-line.diff-add {
  background: rgba(52, 211, 153, 0.08);
}

.diff-line.diff-add .diff-marker {
  color: var(--emerald);
}

.diff-line.diff-add .diff-code {
  color: #6ee7b7;
}

/* Syntax Highlighting */
.s-kw { color: var(--purple); }
.s-fn { color: var(--cyan); }
.s-str { color: var(--emerald); }
.s-com { color: var(--text-muted); font-style: italic; }
.s-err { color: var(--rose); }
.s-ok { color: var(--emerald); }

/* Specifications Catalog */
.catalog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.catalog-switch {
  display: flex;
  background: var(--surface-1);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.switch-btn {
  padding: 7px 16px;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.switch-btn:hover {
  color: var(--text-secondary);
}

.switch-btn.active {
  background: var(--surface-3);
  color: var(--text-primary);
  font-weight: 600;
}

.catalog-search-wrap {
  position: relative;
  min-width: 260px;
  max-width: 360px;
  flex-grow: 1;
}

.catalog-search-field {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: var(--surface-1);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: border-color 0.15s ease;
}

.catalog-search-field:focus {
  border-color: var(--cyan);
  outline: none;
}

/* Progressive Disclosure: Category Filter Pills */
.category-pills-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
  width: 100%;
}

.pills-scroll-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: var(--surface-1);
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.pills-scroll-btn:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.pills-scroll-btn:active {
  background: var(--surface-3);
  transform: scale(0.96);
}

.pills-scroll-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

.category-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  flex: 1;
  min-width: 0;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.pill-btn {
  padding: 5px 12px;
  background: var(--surface-1);
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-height: 28px;
}

.pill-btn:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.pill-btn.active {
  background: var(--surface-3);
  color: var(--cyan);
  font-weight: 600;
}

.search-glyph {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.catalog-count-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

/* Styled Catalog Card (Matches app.js Output) */
.catalog-card {
  background: var(--surface-1);
  border: 1px solid var(--divider-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 180px;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.catalog-card:hover {
  transform: translateY(-2px);
  background: var(--surface-hover);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.45);
}

/* Vertical Header Decoupling (SLOP-17 & §3.10 Invariant) */
.card-overline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin-bottom: 8px;
}

.card-tag {
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: transparent;
  padding: 0;
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.catalog-cmd-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
  border: none;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.catalog-cmd-tag:hover {
  background: rgba(56, 189, 248, 0.22);
}

.catalog-cmd-tag.copied {
  background: rgba(52, 211, 153, 0.18);
  color: var(--emerald);
  border: none;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--divider-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-ref {
  color: var(--text-muted);
}

.catalog-empty-state {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-1);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

/* CLI Table Card */
.cli-table-card {
  background: var(--surface-1);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.table-dataset {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.table-dataset th {
  padding: 12px 20px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--divider);
}

.table-dataset td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--divider-subtle);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.5;
}

.table-dataset tr:last-child td {
  border-bottom: none;
}

.table-dataset tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.table-dataset td code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border: 1px solid var(--divider-subtle);
}

.cli-code-text {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  color: var(--cyan);
  white-space: nowrap;
}

.cli-code-text code {
  color: var(--cyan);
  font-weight: 600;
  background: rgba(56, 189, 248, 0.08) !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
}

/* Engineering Audit / Dogfooding Grid (2x2 Balanced Layout) */
.audit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.audit-card {
  background: var(--surface-1);
  border: 1px solid var(--divider-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.audit-card:hover {
  transform: translateY(-2px);
  background: var(--surface-hover);
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.45);
}

.audit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.audit-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.audit-badge {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audit-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 18px;
  flex-grow: 1;
}

.audit-desc:last-child {
  margin-bottom: 0;
}

.audit-metric {
  font-size: 0.775rem;
  font-family: var(--font-mono);
  color: var(--emerald);
  font-weight: 600;
  border-top: 1px solid var(--divider-subtle);
  padding-top: 12px;
}

/* Standards Foundation Quad */
.standards-quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.standard-block {
  background: var(--surface-1);
  border: 1px solid var(--divider-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.15s ease;
}

.standard-block:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.standard-num {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.standard-summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--divider);
  padding: 40px 0;
  background: var(--surface-1);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-nav-list {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-nav-list a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav-list a:hover {
  color: var(--text-primary);
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .standards-quad {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-heading {
    font-size: 2.3rem;
  }
  .split-view.active {
    grid-template-columns: 1fr;
  }
  .pane-baseline {
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }
}

@media (max-width: 768px) {
  .audit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
  .standards-quad {
    grid-template-columns: 1fr;
  }
  .console-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-copy-action {
    width: 100%;
    justify-content: center;
  }
  .flow-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .audit-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ==========================================================================
   Project Architecture Presets & Bento Studio (Linear Craft Standards)
   ========================================================================== */
.archetype-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.archetype-tab-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface-1);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.archetype-tab-btn:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.archetype-tab-btn.active {
  background: var(--surface-3);
  color: var(--cyan);
  font-weight: 600;
}

/* Dual-Pane Bento Preset Studio */
.preset-bento-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 24px;
  background: var(--surface-1);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.preset-spec-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  min-width: 0;
}

.preset-spec-header {
  border-bottom: none;
  padding-bottom: 0;
}

.preset-spec-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.preset-spec-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.preset-cmd-strip {
  background: var(--bg);
  border: 1px solid var(--divider-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.cmd-strip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cmd-strip-row code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cyan);
}

/* Right Column: Stack List */
/* Right Column: Directive Bubbles (Pill Architecture) */
.preset-stack-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.stack-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--divider-subtle);
}

.stack-pane-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}



.preset-bubbles-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  align-content: flex-start;
}

.preset-bubble {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  user-select: all;
  transition: all 0.15s ease;
}

.preset-bubble:hover {
  background: rgba(56, 189, 248, 0.2);
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .preset-bento-grid {
    grid-template-columns: 1fr;
  }
  .install-meta-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Lenis Smooth Scroll (Darkroom.engineering) & ScrollTrigger Invariants
   ========================================================================== */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* Accessibility: WCAG 2.2 SC 2.3.3 Reduced Motion Invariants */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
