/* ==========================================================================
   klipper-tui Modern Landing Page Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Theme Variables & Design System
   -------------------------------------------------------------------------- */
:root {
  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Universal Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* OMINOUS THEME (Default) */
[data-theme="ominous"] {
  --bg-page: #080607;
  --bg-surface: #120e10;
  --bg-card: #181315;
  --bg-card-hover: #221b1e;
  --border-subtle: #2d2024;
  --border-active: #a32638;

  --primary: #a32638;
  --primary-hover: #c43249;
  --primary-subtle: rgba(163, 38, 56, 0.15);
  --accent: #c4485a;

  --text-main: #f0e6e8;
  --text-muted: #9e8d91;
  --text-dim: #6e5e62;

  --success: #4f7d5e;
  --warning: #c08238;
  --error: #cf3b3b;

  --temp-hot: #d1553d;
  --temp-bed: #7b6f9c;

  --glow-color: rgba(163, 38, 56, 0.22);

  --path-done: #d1553d;
  --path-todo: #5c4a52;
  --path-head: #e0a13c;
}

/* MAINSAIL THEME (Blue) */
[data-theme="mainsail"] {
  --bg-page: #0a0e14;
  --bg-surface: #121820;
  --bg-card: #19222e;
  --bg-card-hover: #222d3d;
  --border-subtle: #253346;
  --border-active: #2196f3;

  --primary: #2196f3;
  --primary-hover: #42a5f5;
  --primary-subtle: rgba(33, 150, 243, 0.15);
  --accent: #64b5f6;

  --text-main: #e3ebf5;
  --text-muted: #8da0b8;
  --text-dim: #5c6f85;

  --success: #4caf50;
  --warning: #ff9800;
  --error: #d41216;

  --temp-hot: #ff5722;
  --temp-bed: #2196f3;

  --glow-color: rgba(33, 150, 243, 0.2);

  --path-done: #ff5722;
  --path-todo: #9999cc;
  --path-head: #ffcc00;
}

/* FORGE THEME (Warm Amber) */
[data-theme="forge"] {
  --bg-page: #0d0c0a;
  --bg-surface: #17150f;
  --bg-card: #1f1c14;
  --bg-card-hover: #2c271c;
  --border-subtle: #3a3325;
  --border-active: #c87f2a;

  --primary: #c87f2a;
  --primary-hover: #df9338;
  --primary-subtle: rgba(200, 127, 42, 0.15);
  --accent: #e0a13c;

  --text-main: #f3ecdb;
  --text-muted: #a69a83;
  --text-dim: #716754;

  --success: #7d8c46;
  --warning: #d8a13a;
  --error: #c14a2b;

  --temp-hot: #e0752a;
  --temp-bed: #6f9ba8;

  --glow-color: rgba(200, 127, 42, 0.2);

  --path-done: #e0752a;
  --path-todo: #5a5240;
  --path-head: #f0d07a;
}

/* --------------------------------------------------------------------------
   2. Global Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

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

kbd {
  display: inline-block;
  padding: 0.15em 0.45em;
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1;
  color: var(--text-main);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Background Ambient Glows */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  transition: background var(--transition-normal);
}

.glow-top {
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
}

.glow-bottom {
  bottom: 200px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
}

/* --------------------------------------------------------------------------
   3. Header Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: rgba(10, 8, 9, 0.8);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  background-color: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.brand-name {
  color: var(--text-main);
}

.brand-accent {
  color: var(--accent);
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-item {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-item:hover {
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Theme Dropdown */
.theme-dropdown-wrapper {
  position: relative;
}

.theme-select-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.theme-select-btn:hover {
  border-color: var(--border-active);
}

.theme-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary);
}

.chevron-icon {
  transition: transform var(--transition-fast);
}

.theme-dropdown-btn.open .chevron-icon {
  transform: rotate(180deg);
}

.theme-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 170px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.35rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 1000;
}

.theme-dropdown-menu.show {
  display: flex;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-align: left;
  transition: all var(--transition-fast);
}

.theme-option:hover, .theme-option.active {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.theme-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.ominous-swatch { background-color: #a32638; }
.mainsail-swatch { background-color: #2196f3; }
.forge-swatch { background-color: #c87f2a; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.925rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-subtle);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-active);
  color: #fff;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.mobile-toggle {
  display: none;
  padding: 0.4rem;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   4. Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  padding: 5rem 0 3.5rem;
  text-align: center;
  z-index: 1;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--primary-subtle);
  border: 1px solid var(--border-active);
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.75rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero-headline {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  max-width: 860px;
}

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

.hero-subhead {
  font-size: 1.18rem;
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 2.25rem;
  font-weight: 400;
}

/* Install Bar */
.hero-install-container {
  width: 100%;
  max-width: 580px;
  margin-bottom: 3.5rem;
}

.install-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
  justify-content: center;
}

.install-tab-btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background-color: transparent;
  transition: all var(--transition-fast);
}

.install-tab-btn:hover {
  color: var(--text-main);
}

.install-tab-btn.active {
  background-color: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--border-subtle);
}

.install-command-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.65rem 0.85rem 0.65rem 1.25rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  transition: border-color var(--transition-fast);
}

.install-command-bar:hover {
  border-color: var(--border-active);
}

.prompt-prefix {
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-mono);
  margin-right: 0.75rem;
  user-select: none;
}

.install-command-bar code {
  flex: 1;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow-x: auto;
}

.btn-copy {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.btn-copy:hover {
  color: var(--text-main);
  background-color: var(--bg-card-hover);
  border-color: var(--border-active);
}

.copy-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  white-space: nowrap;
}

.btn-copy:hover .copy-tooltip,
.btn-copy.copied .copy-tooltip {
  opacity: 1;
}

/* Stats Row */
.hero-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.25rem 2rem;
  background-color: rgba(18, 14, 16, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 2rem;
  background-color: var(--border-subtle);
}

/* --------------------------------------------------------------------------
   5. Interactive Terminal Simulator Section
   -------------------------------------------------------------------------- */
.demo-section {
  padding: 4rem 0 6rem;
  position: relative;
  z-index: 2;
}

.section-header {
  margin-bottom: 2.75rem;
}

.section-header.text-center {
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
}

/* Terminal Frame */
.terminal-frame {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

.terminal-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-page);
  border-bottom: 1px solid var(--border-subtle);
}

.window-controls {
  display: flex;
  gap: 0.45rem;
}

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

.dot-close { background-color: #ff5f56; }
.dot-min { background-color: #ffbd2e; }
.dot-max { background-color: #27c93f; }

.terminal-session-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.session-printer-badge {
  font-weight: 700;
  color: var(--text-main);
}

.session-host {
  color: var(--text-dim);
}

.session-status {
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.75rem;
}

.state-printing {
  background-color: rgba(79, 125, 94, 0.2);
  color: #6edb8c;
  border: 1px solid rgba(79, 125, 94, 0.4);
}

.fps-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Terminal Nav Tabs */
.terminal-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.tui-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tui-tab:hover {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.tui-tab.active {
  background-color: var(--primary);
  color: #ffffff;
}

.key-hint {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.05rem 0.3rem;
  background-color: rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  color: #fff;
}

/* Terminal Screen Area */
.terminal-screen {
  min-height: 380px;
  background-color: var(--bg-page);
  padding: 1.25rem;
  position: relative;
}

.tui-view-panel {
  display: none;
}

.tui-view-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Common TUI widgets */
.tui-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

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

.badge-success {
  background-color: rgba(79, 125, 94, 0.2);
  color: #79d698;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.dim { color: var(--text-dim); }
.bold { font-weight: 700; }
.highlight { color: var(--text-main); }
.font-sm { font-size: 0.85rem; }

.tui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.tui-btn:hover {
  border-color: var(--border-active);
  background-color: var(--bg-card-hover);
}

.tui-btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.tui-btn-primary {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tui-btn-primary:hover {
  background-color: var(--primary-hover);
}

.tui-btn-danger {
  background-color: rgba(207, 59, 59, 0.2);
  color: #ff6b6b;
  border-color: rgba(207, 59, 59, 0.4);
}

.tui-btn-danger:hover {
  background-color: var(--error);
  color: #fff;
}

/* 1. Dashboard Styles */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.job-meta-row {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: var(--bg-surface);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.progress-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.stats-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  background-color: var(--bg-surface);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.coord-display-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.coord-cell {
  background-color: var(--bg-surface);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.825rem;
}

.coord-cell .axis {
  color: var(--accent);
  font-weight: 700;
  margin-right: 0.3rem;
}

.quick-jog-row {
  display: flex;
  gap: 0.5rem;
}

.temp-readout-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.temp-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.temp-name {
  font-size: 0.825rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dot-hot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--temp-hot);
}

.dot-bed {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--temp-bed);
}

.temp-nums {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.temp-bar {
  width: 100%;
  height: 6px;
  background-color: var(--bg-surface);
  border-radius: 999px;
  overflow: hidden;
}

.hot-fill { background-color: var(--temp-hot); }
.bed-fill { background-color: var(--temp-bed); }

.presets-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.presets-btn-grid .tui-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.presets-btn-grid .tui-btn small {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.active-preset {
  border-color: var(--border-active);
  background-color: var(--primary-subtle);
}

/* 2. Console Styles */
.console-wrapper {
  display: flex;
  flex-direction: column;
  height: 340px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.console-output {
  flex: 1;
  padding: 0.85rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.log-line {
  line-height: 1.4;
  word-break: break-all;
}

.log-system { color: var(--text-dim); }
.log-success { color: #6edb8c; }
.log-cmd { color: var(--accent); font-weight: 700; }
.log-response { color: var(--text-main); }
.log-dim { color: var(--text-muted); font-style: italic; }

.console-input-bar {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  gap: 0.5rem;
}

.console-prompt {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
}

.console-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-main);
}

/* 3. Move 3D Styles */
.move-layout-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1rem;
}

.jog-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-buttons-row {
  display: flex;
  gap: 0.35rem;
}

.home-buttons-row .tui-btn {
  flex: 1;
  padding: 0.35rem 0.4rem;
  font-size: 0.75rem;
}

.jog-step-selector {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.step-btn {
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.step-btn.active {
  background-color: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* The cross and the Z column sit side by side, as they do in the app. */
.jog-cluster {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.jog-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  flex: 1 1 auto;
  max-width: 260px;
}

.z-jog-col {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  gap: 0.35rem;
  width: 84px;
}

.z-jog-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* The middle of the cross reads as a readout, not another jog button. */
.jog-center {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--accent);
  font-family: var(--font-mono);
}

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

.jog-arrow, .jog-center {
  padding: 0.5rem 0.2rem;
  font-size: 0.78rem;
}

.z-jog-row {
  display: flex;
  gap: 0.35rem;
}

.z-jog-row .tui-btn {
  flex: 1;
}

.wireframe-3d-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
}

.wireframe-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.wireframe-actions {
  display: flex;
  gap: 0.4rem;
}

.wireframe-canvas-container {
  flex: 1;
  position: relative;
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#wireframeCanvas {
  max-width: 100%;
  height: auto;
}

.wireframe-overlay-coords {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  background-color: rgba(0, 0, 0, 0.6);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* 4. Files Styles */
.files-panel-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.files-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.files-table-wrapper {
  overflow-x: auto;
}

.tui-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  text-align: left;
}

.tui-table th {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-weight: 600;
}

.tui-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.active-print-row {
  background-color: var(--primary-subtle);
}

.badge-mini-active {
  background-color: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.4rem;
}

/* 5. Bed Mesh Styles */
.mesh-panel-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1rem;
}

.mesh-sidebar {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mesh-stats-block {
  background-color: var(--bg-surface);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.mesh-stat-item {
  display: flex;
  justify-content: space-between;
}

.text-blue { color: #2196f3; }
.text-orange { color: #ff9800; }
.text-green { color: #4caf50; }

.mesh-actions-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mesh-heightmap-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
}

.mesh-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.825rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.gradient-scale-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.scale-gradient {
  width: 70px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, #2196f3, #4caf50, #ffeb3b, #d41216);
}

.heightmap-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0.5rem;
  background-color: var(--bg-page);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  align-content: center;
}

.mesh-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: transform 0.15s ease;
  cursor: pointer;
}

.mesh-cell:hover {
  transform: scale(1.15);
  z-index: 10;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* 6. Webcam Styles */
.webcam-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.webcam-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.webcam-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.live-rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #ff5f56;
  background-color: rgba(255, 95, 86, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

.rec-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #ff5f56;
  animation: blink 1.2s infinite;
}

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

.webcam-canvas-area {
  position: relative;
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#webcamSimCanvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.webcam-hud {
  position: absolute;
  bottom: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #6edb8c;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

/* 7. Temp Graph (Braille) Styles */
.graph-panel-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.graph-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.graph-legend {
  display: flex;
  gap: 1.25rem;
}

.legend-item {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.swatch-hot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background-color: var(--temp-hot);
}

.swatch-bed {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background-color: var(--temp-bed);
}

.braille-graph-viewport {
  background-color: var(--bg-page);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  overflow-x: auto;
}

.braille-text-canvas {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  line-height: 1.15;
  color: var(--text-main);
  white-space: pre;
}

/* 8. Settings Styles */
.settings-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.settings-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.theme-radios {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Statusbar Footer */
.terminal-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.statusbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.key-cmd {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* --------------------------------------------------------------------------
   6. Features Grid
   -------------------------------------------------------------------------- */
.features-section {
  padding: 6rem 0;
  position: relative;
  z-index: 1;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-normal);
}

.feature-card:hover {
  border-color: var(--border-active);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--primary-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.feature-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.65rem;
}

.feature-text {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   7. Architecture Section
   -------------------------------------------------------------------------- */
.arch-section {
  padding: 5rem 0;
  background-color: rgba(18, 14, 16, 0.4);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.arch-flow-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  gap: 1rem;
}

.arch-node-col {
  flex: 1;
}

.arch-node {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  transition: border-color var(--transition-fast);
}

.arch-node:hover {
  border-color: var(--border-active);
}

.node-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.node-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.node-subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.node-specs {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.arch-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
}

.connector-line {
  width: 60px;
  height: 2px;
  background-color: var(--border-active);
  position: relative;
}

.connector-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.4rem;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   8. Quickstart & Installation
   -------------------------------------------------------------------------- */
.quickstart-section {
  padding: 6rem 0;
}

.quickstart-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.qs-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.qs-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.qs-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.qs-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex: 1;
}

.code-snippet-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  gap: 0.5rem;
}

.code-snippet-box code {
  font-size: 0.825rem;
  color: var(--text-main);
  word-break: break-all;
}

.copy-snippet-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.copy-snippet-btn:hover {
  color: var(--text-main);
  border-color: var(--border-active);
}

/* --------------------------------------------------------------------------
   9. Keybindings Reference
   -------------------------------------------------------------------------- */
.shortcuts-section {
  padding: 5rem 0;
  background-color: rgba(18, 14, 16, 0.4);
}

.shortcuts-table-container {
  max-width: 800px;
  margin: 0 auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.table-search-bar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.table-search-bar input {
  width: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition-fast);
}

.table-search-bar input:focus {
  border-color: var(--border-active);
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.shortcuts-table th {
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
}

.shortcuts-table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.shortcuts-table tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.cat-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.cat-danger {
  background-color: rgba(207, 59, 59, 0.15);
  color: #ff6b6b;
  border-color: rgba(207, 59, 59, 0.3);
}

/* --------------------------------------------------------------------------
   10. CTA Section
   -------------------------------------------------------------------------- */
.cta-section {
  padding: 6rem 0;
}

.cta-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 3.5rem 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.cta-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}

.cta-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 2.25rem;
}

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-page);
  padding: 3rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.footer-text a {
  color: var(--accent);
  text-decoration: underline;
}

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

.footer-links a:hover {
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   12. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .hero-headline {
    font-size: 2.6rem;
  }
  .features-grid, .quickstart-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .arch-flow-card {
    flex-direction: column;
  }
  .arch-connector {
    transform: rotate(90deg);
    padding: 1.5rem 0;
  }
  .connector-label {
    transform: rotate(-90deg);
  }
  .move-layout-grid, .mesh-panel-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 1rem;
  }
  .nav-links.show {
    display: flex;
  }
  .mobile-toggle {
    display: block;
  }
  .hero-headline {
    font-size: 2.1rem;
  }
  .hero-stats-row {
    flex-direction: column;
    gap: 1rem;
  }
  .stat-divider {
    width: 80%;
    height: 1px;
  }
  .features-grid, .quickstart-grid, .dashboard-grid, .settings-panel-grid {
    grid-template-columns: 1fr;
  }
  .terminal-titlebar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* --------------------------------------------------------------------------
   Screenshots — real captures, not mockups
   -------------------------------------------------------------------------- */
.shots-section {
  padding: 96px 0;
  border-top: 1px solid var(--border-subtle);
}

.shots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 28px;
  margin-top: 48px;
}

.shot-card {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-normal),
              transform var(--transition-normal);
}

.shot-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
}

.shot-card img {
  display: block;
  width: 100%;
  height: auto;
  /* The SVG carries its own terminal chrome and background. */
  background: var(--bg-page);
}

.shot-card figcaption {
  padding: 16px 20px 20px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

.shot-card figcaption strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-main);
  font-weight: 600;
}

@media (max-width: 900px) {
  .shots-grid {
    grid-template-columns: 1fr;
  }
  .shots-section {
    padding: 64px 0;
  }
}

/* --------------------------------------------------------------------------
   Terminal fidelity
   --------------------------------------------------------------------------
   Everything inside the frame is meant to read as the TUI, not as a web
   dashboard. The app draws its panels and buttons out of box-drawing
   characters on a monospace grid: thin single-line borders with rounded
   corners, no fills, no gradients, no pill badges, and colour used only to
   mean something. These rules come last so they win over the generic card and
   button styling above.
   -------------------------------------------------------------------------- */

.terminal-frame,
.terminal-frame input,
.terminal-frame button {
  font-family: var(--font-mono);
}

.terminal-frame {
  border-radius: var(--radius-md);
}

/* --- Panels --------------------------------------------------------------- */

.terminal-frame .tui-card {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  box-shadow: none;
  padding: 0.85rem 1.1rem 1rem;
}

.terminal-frame .tui-card:hover {
  border-color: var(--border-subtle);
  transform: none;
}

/* The title is the first thing inside the border, in the accent colour, with
   nothing opposite it. The app has no room for a status chip up there. */
.terminal-frame .card-title {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.terminal-frame .card-header {
  border: 0;
  padding: 0;
  margin-bottom: 0.65rem;
}

.terminal-frame .tui-line {
  font-size: 0.8rem;
  line-height: 1.65;
  white-space: nowrap;
  overflow-x: auto;
  color: var(--text-main);
}

.terminal-frame .dim {
  color: var(--text-muted);
}

.terminal-frame .ok {
  color: var(--success);
}

.terminal-frame .target {
  color: var(--success);
}

.terminal-frame .state-live {
  color: #4a9eff;
  font-weight: 600;
}

/* --- Bars are block characters, as they are in the terminal --------------- */

.terminal-frame .bar {
  letter-spacing: -0.5px;
}

.terminal-frame .bar-done,
.terminal-frame .bar-speed {
  color: var(--warning);
}

.terminal-frame .bar-flow {
  color: var(--success);
}

.terminal-frame .bar-todo {
  color: var(--border-subtle);
}

/* --- Buttons -------------------------------------------------------------- */

.terminal-frame .tui-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.terminal-frame .tui-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  padding: 0.4rem 0.85rem;
  box-shadow: none;
}

.terminal-frame .tui-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--text-dim);
  transform: none;
}

.terminal-frame .tui-btn:disabled {
  color: var(--text-dim);
  border-color: var(--border-subtle);
  opacity: 1;
}

/* The app tints the border and the label, never the fill. */
.terminal-frame .tui-btn-primary,
.terminal-frame .tui-btn-danger {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.terminal-frame .tui-btn-primary:hover:not(:disabled),
.terminal-frame .tui-btn-danger:hover:not(:disabled) {
  background: var(--primary-subtle);
}

/* An empty input shows its placeholder, boxed like everything else. */
.terminal-frame .tui-input {
  display: inline-block;
  min-width: 7.5rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* --- Chrome --------------------------------------------------------------- */

.terminal-frame .session-status,
.terminal-frame .fps-badge,
.terminal-frame .badge-success,
.terminal-frame .badge-mini-active,
.terminal-frame .live-rec-badge {
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.terminal-frame .session-status {
  color: #4a9eff;
}

.terminal-frame .badge-success,
.terminal-frame .fps-badge {
  color: var(--success);
}

.terminal-frame .badge-mini-active {
  color: var(--warning);
}

/* --- Heightmap: solid colour, the way the terminal draws it ---------------- */

/* The terminal draws each probe point as two solid colour cells with no
   number in them. text-indent hides the label without collapsing the box the
   way font-size: 0 would. */
.terminal-frame .mesh-cell {
  text-indent: -9999px;
  overflow: hidden;
  border-radius: 0;
  border: 0;
  min-height: 26px;
}

.terminal-frame .heightmap-grid {
  gap: 0;
  align-content: stretch;
}

/* --- Files table ---------------------------------------------------------- */

.terminal-frame .tui-table,
.terminal-frame .tui-table th,
.terminal-frame .tui-table td {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.terminal-frame .tui-table th {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-weight: 400;
}

@media (max-width: 820px) {
  .terminal-frame .tui-line {
    font-size: 0.72rem;
  }
}

/* The app marks the active tab with accent text and a rule beneath it, and
   shows each tab's key as a bare accent letter — not as a filled pill. */
.terminal-frame .tui-tab {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 400;
  padding: 0.5rem 0.9rem;
  border-bottom: 2px solid transparent;
}

.terminal-frame .tui-tab:hover {
  background: transparent;
  color: var(--text-main);
}

.terminal-frame .tui-tab.active {
  background: transparent;
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.terminal-frame .key-hint,
.terminal-frame .key-cmd kbd {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin-right: 0.35rem;
  border-radius: 0;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: inherit;
  font-weight: 400;
}

.terminal-frame .terminal-statusbar {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.terminal-frame .key-cmd {
  color: var(--text-muted);
}

/* The jog column carries four home buttons, a cross, a Z column, a step row
   and the Z offset controls; 240px clipped most of them. */
.terminal-frame .move-layout-grid {
  grid-template-columns: 340px 1fr;
}

.terminal-frame .jog-panel {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.terminal-frame .home-buttons-row {
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.terminal-frame .home-buttons-row .tui-btn {
  flex: 0 0 auto;
  padding: 0.4rem 0.7rem;
}

.terminal-frame .jog-step-selector {
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

/* A selected step is marked the way the app marks it: accent text in a
   bordered box, not a filled pill. */
.terminal-frame .step-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
}

.terminal-frame .step-btn.active {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.terminal-frame .wireframe-3d-panel,
.terminal-frame .mesh-sidebar,
.terminal-frame .mesh-heightmap-container,
.terminal-frame .files-panel-wrapper,
.terminal-frame .webcam-container,
.terminal-frame .graph-panel-wrapper,
.terminal-frame .settings-card,
.terminal-frame .console-wrapper {
  background: transparent;
  border-radius: 6px;
}

.hero-note {
  max-width: 640px;
  margin: 1.5rem auto 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}

.hero-note strong {
  color: var(--text-main);
}

.hero-note a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--border-active);
}

.hero-note a:hover {
  color: var(--primary-hover);
}

/* --- Toolpath viewer (demo) ----------------------------------------------- */

.terminal-frame .toolpath-panel {
  margin-top: 1rem;
  padding: 0.85rem 1.1rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.terminal-frame .toolpath-panel .row-label {
  align-self: center;
  min-width: 2.5rem;
  font-size: 0.78rem;
}

.terminal-frame .toolpath-canvas-wrap {
  margin-top: 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  background: var(--bg-page);
  overflow: hidden;
}

/* Braille needs a font that actually has the glyphs and a tight, uniform
   grid; line-height 1 keeps the dot rows touching so strokes read as lines
   rather than dotted rules. */
.terminal-frame #toolpathView {
  margin: 0;
  padding: 0.4rem 0.5rem;
  /* Braille lives at U+2800-28FF, which plenty of monospace fonts skip.
     These carry it on Linux, macOS and Windows respectively. */
  font-family: "DejaVu Sans Mono", "Noto Sans Mono", "Liberation Mono",
               "Menlo", "Cascadia Mono", var(--font-mono), monospace;
  font-size: clamp(7px, 1.25vw, 17px);
  line-height: 1;
  letter-spacing: 0;
  white-space: pre;
  overflow-x: auto;
  color: var(--path-todo);
  cursor: crosshair;
}

.terminal-frame .held {
  color: var(--warning);
}

/* --------------------------------------------------------------------------
   Screenshot lightbox
   -------------------------------------------------------------------------- */

.shot-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.shot-open:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(3px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: center;
}

.lightbox-figure img {
  max-width: 100%;
  /* Leave room for the caption below it. */
  max-height: calc(100vh - 9rem);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-page);
}

.lightbox-figure figcaption {
  max-width: 60ch;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.lightbox-figure figcaption strong {
  color: var(--text-main);
}

.lightbox-close,
.lightbox-step {
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  line-height: 1;
  transition: border-color var(--transition-fast),
              background var(--transition-fast);
}

.lightbox-close:hover,
.lightbox-step:hover,
.lightbox-close:focus-visible,
.lightbox-step:focus-visible {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.lightbox-close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
}

.lightbox-step {
  width: 2.75rem;
  height: 4rem;
  font-size: 2rem;
}

@media (max-width: 700px) {
  .lightbox-step {
    display: none;      /* swipe room is scarce; the caption matters more */
  }
  .lightbox-figure img {
    max-height: calc(100vh - 11rem);
  }
}
