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

/* =====================
   VARIABLES
   ===================== */
:root {
  /* Surfaces — Graphite Command Pro default (themes.css overrides via data-theme) */
  --bg: #080a0d;
  --surface: #11161d;
  --panel: #1a212a;
  --panel-raised: #202936;
  --border: #263241;
  --surface-glass: rgba(17, 22, 29, 0.72);

  /* Text */
  --text: #e6edf3;
  --text-muted: #8a95a3;
  --text-faint: #64748b;
  --muted: var(--text-muted);

  /* Brand */
  --primary: #2979ff;
  --primary-hover: #3b82f6;
  --primary-active: #1d4ed8;
  --primary-dim: rgba(41, 121, 255, 0.14);
  --glow-primary: rgba(41, 121, 255, 0.35);

  /* Secondary */
  --secondary: #0d9488;
  --secondary-hover: #14b8a6;
  --secondary-active: #0f766e;
  --secondary-dim: rgba(13, 148, 136, 0.14);
  --glow-secondary: rgba(13, 148, 136, 0.3);

  /* Premium */
  --accent: #b88a3c;
  --accent-hover: #d4af37;
  --accent-muted: #8e6a2f;
  --accent-dim: rgba(184, 138, 60, 0.14);
  --glow-accent: rgba(184, 138, 60, 0.3);

  /* Status */
  --success: #228b22;
  --success-soft: rgba(34, 139, 34, 0.14);
  --warning: #cc5500;
  --warning-soft: rgba(204, 85, 0, 0.14);
  --danger: #b23a48;
  --danger-soft: rgba(178, 58, 72, 0.14);
  --info: #0d9488;
  --info-soft: rgba(13, 148, 136, 0.14);

  /* Effects */
  --shadow: rgba(0, 0, 0, 0.45);
  --shadow-card: 0 16px 40px rgba(0, 0, 0, 0.35);
  --shadow-panel: 0 10px 30px rgba(0, 0, 0, 0.28);
  --shadow-modal: 0 24px 80px rgba(0, 0, 0, 0.55);
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-default: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.28);
  --border-active: rgba(41, 121, 255, 0.75);

  /* Spacing (8px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  /* Motion */
  --motion-instant: 80ms;
  --motion-fast: 120ms;
  --motion-normal: 180ms;
  --motion-slow: 280ms;
  --motion-page: 320ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Legacy aliases */
  --sidebar-bg: var(--surface);
  --gold: var(--accent);
  --gold-dim: var(--accent-dim);
  --violet: var(--secondary);
  --magenta: var(--danger);
  --alert: var(--danger);
  --accent-glow: var(--glow-primary);

  /* Typography */
  --font-heading: 'Rajdhani', 'Barlow Condensed', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  --font-display: var(--font-heading);
  --font-sans: var(--font-body);

  /* Sidebar rail */
  --sidebar-w-collapsed: 52px;
  --sidebar-w-expanded: 200px;
  --sidebar-w: var(--sidebar-w-collapsed);

  /* Shape */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-card: var(--radius-lg);
  --radius-btn: var(--radius-md);
}

html[data-sidebar='expanded'] {
  --sidebar-w: var(--sidebar-w-expanded);
}

/* =====================
   BASE
   ===================== */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at top right, rgba(41, 121, 255, 0.12), transparent 35%),
    radial-gradient(circle at bottom left, rgba(184, 138, 60, 0.08), transparent 30%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-variant-numeric: tabular-nums;
}

body::before,
body::after {
  display: none;
}

::selection {
  background: var(--primary-dim);
  color: var(--text);
}

/* =====================
   GRID OVERLAY
   ===================== */
.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--primary) 3%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--primary) 3%, transparent) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 85% 75% at 55% 45%, black 20%, transparent 100%);
}

.grid-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.35;
  mix-blend-mode: overlay;
}

.ambient-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =====================
   APP LAYOUT
   ===================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* =====================
   SIDEBAR
   ===================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  padding: var(--space-3) var(--space-2);
  z-index: 100;
  transition: width var(--motion-normal) var(--ease-out);
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 8%,
    color-mix(in srgb, var(--primary) 12%, transparent) 50%,
    transparent 92%
  );
  pointer-events: none;
  opacity: 0.6;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--panel) 50%, transparent);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease;
}

.sidebar-toggle:hover {
  color: var(--primary);
  border-color: var(--border-active);
}

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

.sidebar-brand {
  min-width: 0;
}

.sidebar-name {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
  white-space: nowrap;
}

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.12rem 0.45rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  max-width: 100%;
}

.badge::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.55;
}

.badge--verified::before {
  opacity: 1;
  animation: pulse 2s ease infinite;
}

/* Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
  padding-top: 0.15rem;
}

.sidebar-nav::before {
  content: 'nav';
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 40%, transparent);
}

.nav-link.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.nav-link.nav-bounce {
  animation: navBounce 0.35s var(--ease-out);
}

.nav-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  flex-shrink: 0;
}

.nav-link.active .nav-dot {
  opacity: 1;
  background: var(--primary);
  box-shadow: none;
}

/* Sidebar bottom */
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.smoke-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.25s ease;
}

.smoke-toggle:hover:not(:disabled) {
  color: #ffb14a;
  border-color: rgba(255, 177, 74, 0.35);
  background: rgba(255, 120, 60, 0.08);
}

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

.smoke-toggle[aria-pressed='true'] {
  color: #ff9a3c;
  border-color: rgba(255, 154, 60, 0.55);
  background: rgba(255, 90, 50, 0.12);
  box-shadow:
    0 0 12px rgba(255, 140, 60, 0.45),
    0 0 28px color-mix(in srgb, var(--danger) 20%, transparent);
}

.smoke-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.smoke-toggle-icon {
  display: block;
}

.smoke-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  display: none;
}

.sidebar-link {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  transition: color 0.15s ease;
}

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

/* Collapsed rail — desktop only */
@media (min-width: 769px) {
  html[data-sidebar='collapsed'] .sidebar-top {
    align-items: center;
  }

  html[data-sidebar='collapsed'] .sidebar-brand,
  html[data-sidebar='collapsed'] .sidebar-nav::before,
  html[data-sidebar='collapsed'] .theme-control--sidebar,
  html[data-sidebar='collapsed'] .sidebar-link {
    display: none;
  }

  html[data-sidebar='collapsed'] .badge {
    font-size: 0;
    line-height: 0;
    padding: 0.3rem;
    min-width: 1.125rem;
    justify-content: center;
    gap: 0;
  }

  html[data-sidebar='collapsed'] .sidebar-nav {
    align-items: center;
    padding-top: 0;
  }

  html[data-sidebar='collapsed'] .nav-link {
    font-size: 0;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-left: none;
    border-radius: var(--radius-sm);
  }

  html[data-sidebar='collapsed'] .nav-link.active {
    border-left: none;
    box-shadow: inset 2px 0 0 var(--primary);
  }

  html[data-sidebar='collapsed'] .nav-dot {
    width: 5px;
    height: 5px;
  }

  html[data-sidebar='collapsed'] .sidebar-bottom {
    align-items: center;
    border-top: none;
    padding-top: var(--space-2);
    margin-top: 0;
  }
}

/* =====================
   MAIN CONTENT
   ===================== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  transition: margin-left var(--motion-normal) var(--ease-out);
}

/* =====================
   SECTIONS
   ===================== */
.section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem clamp(1.5rem, 5vw, 4rem);
  animation: fadeUp 0.55s var(--ease-out) both;
}

/* =====================
   HERO (HOME)
   ===================== */
.section--hero {
  position: relative;
  justify-content: flex-start;
  padding-top: clamp(4rem, 8vh, 6rem);
  padding-bottom: 6rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  width: 100%;
  max-width: 1100px;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fadeUp 0.5s var(--ease-out) 0.05s both;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--primary);
  vertical-align: middle;
  margin-right: 0.75rem;
  box-shadow: 0 0 8px var(--primary);
}

#home h1 {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.05;
  opacity: 0;
  animation: fadeUp 0.55s var(--ease-out) 0.12s both;
}

#home h1 .hero-accent {
  display: block;
  background: linear-gradient(105deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 24px var(--glow-primary));
}

.tagline {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.75rem;
  max-width: 38rem;
  opacity: 0;
  animation: fadeUp 0.55s var(--ease-out) 0.2s both;
}

.sub {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 36rem;
  opacity: 0;
  animation: fadeUp 0.55s var(--ease-out) 0.28s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  opacity: 0;
  animation: fadeUp 0.55s var(--ease-out) 0.36s both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-btn);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  background: linear-gradient(135deg, var(--primary-dim), color-mix(in srgb, var(--primary) 4%, transparent));
  color: var(--primary);
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s ease, border-color 0.2s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: 0 0 24px var(--glow-primary), inset 0 0 12px var(--primary-dim);
}

.hero-cta--ghost {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.hero-cta--ghost:hover {
  border-color: color-mix(in srgb, var(--secondary) 35%, transparent);
  color: var(--secondary);
  box-shadow: 0 0 20px var(--glow-secondary);
}

.hero-panel {
  position: relative;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow:
    0 0 40px var(--glow-primary),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0;
  animation: fadeUp 0.6s var(--ease-out) 0.42s both;
}

.hero-panel::before,
.hero-panel::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  border-style: solid;
  pointer-events: none;
}

.hero-panel::before {
  top: 10px;
  left: 10px;
  border-width: 1px 0 0 1px;
}

.hero-panel::after {
  bottom: 10px;
  right: 10px;
  border-width: 0 1px 1px 0;
}

.hero-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.hero-panel-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-panel-dots {
  display: flex;
  gap: 0.35rem;
}

.hero-panel-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
}

.hero-panel-dots span:nth-child(1) { background: var(--danger); opacity: 0.7; }
.hero-panel-dots span:nth-child(2) { background: var(--secondary); opacity: 0.7; }
.hero-panel-dots span:nth-child(3) { background: var(--primary); opacity: 0.7; }

.hero-terminal {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.75;
  color: var(--muted);
}

.hero-terminal .line-prompt {
  color: var(--primary);
  margin-right: 0.35rem;
}

.hero-terminal .line-out {
  color: var(--text);
}

.hero-terminal .line-dim {
  color: var(--muted);
  opacity: 0.75;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.featured-work {
  width: 100%;
  max-width: 1100px;
  margin-top: clamp(3rem, 7vw, 5rem);
}

.section-header--compact {
  margin-bottom: 1.25rem;
}

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

.featured-card {
  display: flex;
  min-height: 15rem;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 1.35rem;
  color: inherit;
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  transition:
    transform 0.25s var(--ease-out),
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.featured-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary) 22%, transparent);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32), 0 0 24px var(--glow-primary);
}

.featured-kicker,
.tool-type {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.featured-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.15;
  color: var(--text);
}

.featured-card p {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

.stat-chip {
  text-align: center;
  padding: 0.65rem 0.4rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* =====================
   HOME SECTION (legacy selectors)
   ===================== */

.sub-attrib {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.85;
}

/* =====================
   FOOTER
   ===================== */
.site-footer {
  position: fixed;
  bottom: 1.5rem;
  left: calc(var(--sidebar-w) + 2rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  z-index: 1;
}

.site-footer::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--border);
}

/* =====================
   TOOLS SECTION
   ===================== */
#tools {
  justify-content: flex-start;
  padding-top: 5rem;
}

.tools-page-intro {
  max-width: 760px;
  margin-bottom: 2.25rem;
}

.tools-page-intro .hero-eyebrow {
  margin-bottom: 0.75rem;
}

.tools-page-intro .section-header {
  margin-bottom: 0.9rem;
}

.tools-lede {
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

/* =====================
   ABOUT SECTION
   ===================== */
.section--about {
  justify-content: flex-start;
  padding-top: 5rem;
  max-width: 960px;
}

.about-lede {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.7;
  max-width: 38rem;
  margin-bottom: 2.5rem;
}

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

.about-card {
  position: relative;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.65rem;
  transition:
    transform 0.25s var(--ease-out),
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.about-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--secondary) 20%, transparent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 24px color-mix(in srgb, var(--secondary) 6%, transparent);
}

.about-card--wide {
  grid-column: 1 / -1;
}

.about-card-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.65rem;
}

.about-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.55rem;
}

.about-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
}

.about-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary);
  text-decoration: none;
  transition: text-shadow 0.2s ease;
}

.about-link:hover {
  text-shadow: 0 0 12px color-mix(in srgb, var(--primary) 35%, transparent);
}

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

  .about-card--wide {
    grid-column: auto;
  }
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.section-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}

/* =====================
   TOOLS GRID
   ===================== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  max-width: 960px;
}

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

@media (min-width: 901px) {
  .tools-grid .tool-card-link:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc(50% - 0.625rem);
  }
}

/* =====================
   TOOL CARD
   ===================== */
.tool-card {
  position: relative;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.55rem;
  box-shadow: 0 0 20px color-mix(in srgb, var(--primary) 3%, transparent);
  transition:
    transform 0.25s var(--ease-out),
    box-shadow 0.25s ease,
    border-color 0.25s ease;
  cursor: default;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 6%, transparent) 0%, transparent 45%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tool-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 40%, transparent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: color-mix(in srgb, var(--primary) 18%, transparent);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 30px color-mix(in srgb, var(--primary) 8%, transparent),
    inset 0 0 20px color-mix(in srgb, var(--primary) 3%, transparent);
}

.tool-card:hover::before,
.tool-card:hover::after {
  opacity: 1;
}

.tool-card-index {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(255, 255, 255, 0.03);
  pointer-events: none;
  transition: color 0.3s ease;
}

.tool-card:hover .tool-card-index {
  color: color-mix(in srgb, var(--primary) 8%, transparent);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.5s var(--ease-out) var(--reveal-delay, 0ms),
    transform 0.5s var(--ease-out) var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tool-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.tool-card-link:hover .tool-card-cta {
  color: var(--primary);
  text-shadow: 0 0 12px color-mix(in srgb, var(--primary) 35%, transparent);
}

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

.tool-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  padding-right: 1rem;
  overflow-wrap: anywhere;
}

.tool-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.tool-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tool-card-meta span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: rgba(255, 255, 255, 0.02);
}

.tool-card-cta {
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

/* =====================
   STATUS BADGES
   ===================== */
.status-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  letter-spacing: 0.06em;
  font-weight: 400;
}

.status-badge.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}

.status-badge.wip {
  color: var(--secondary);
  background: color-mix(in srgb, var(--secondary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--secondary) 20%, transparent);
}

/* =====================
   ANIMATIONS
   ===================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes navBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .tool-card:hover {
    transform: none;
  }

  .hero-cta:hover {
    transform: none;
  }

  .featured-card:hover {
    transform: none;
  }

  .smoke-toggle {
    transition: none;
  }
}

/* =====================
   WRITEUPS / CASE STUDIES
   ===================== */
.section--writeup {
  justify-content: flex-start;
  padding-top: 4.5rem;
  max-width: 820px;
}

.writeup-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.writeup-back:hover {
  color: var(--primary);
  text-shadow: 0 0 12px color-mix(in srgb, var(--primary) 35%, transparent);
}

.writeup-back--inline {
  display: block;
  margin-top: 0.65rem;
}

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

.writeup-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin: 0.35rem 0 1rem;
}

.writeup-lede {
  font-size: 1.02rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 40rem;
  margin-bottom: 1.35rem;
}

.writeup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.writeup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.writeup-meta dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.writeup-meta dd {
  font-size: 0.85rem;
  color: var(--text);
}

.writeup-block {
  margin-bottom: 2.25rem;
}

.writeup-block h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.writeup-block p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 40rem;
}

.writeup-block code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--primary);
  background: var(--primary-dim);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.writeup-list {
  margin: 0.85rem 0 0;
  padding-left: 1.15rem;
  max-width: 40rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

.writeup-list li + li {
  margin-top: 0.45rem;
}

.writeup-list strong {
  color: var(--text);
  font-weight: 500;
}

.writeup-gallery-section {
  margin-bottom: 2.5rem;
}

.writeup-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.writeup-figure {
  margin: 0;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.writeup-figure:hover {
  border-color: color-mix(in srgb, var(--primary) 15%, transparent);
  box-shadow: 0 0 24px var(--glow-primary);
}

.writeup-figure img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.writeup-figure figcaption {
  padding: 0.85rem 1rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid var(--border);
}

.writeup-callout {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, var(--secondary) 18%, transparent);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.65rem;
  margin-bottom: 2.25rem;
  box-shadow: 0 0 28px color-mix(in srgb, var(--secondary) 5%, transparent);
}

.writeup-callout p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 0.5rem;
}

.writeup-files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.writeup-files li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.writeup-files a {
  color: var(--primary);
  text-decoration: none;
}

.writeup-files a:hover {
  text-shadow: 0 0 12px color-mix(in srgb, var(--primary) 35%, transparent);
}

@media (min-width: 720px) {
  .writeup-gallery {
    grid-template-columns: 1fr;
  }
}

/* =====================
   SMOKE PLAYGROUND
   ===================== */
.main-content--smoke-playground {
  justify-content: flex-start;
  padding: 1.75rem 2rem 4rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.smoke-playground-page-header {
  flex-shrink: 0;
}

.smoke-playground-title {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.smoke-playground-lede {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 36rem;
}

.smoke-playground-layout {
  display: flex;
  flex: 1;
  gap: 1.25rem;
  min-height: 0;
  align-items: stretch;
}

.smoke-playground-panel {
  width: 288px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1rem 1.1rem 1.15rem;
  max-height: min(720px, calc(100vh - 11rem));
  overflow: auto;
}

.smoke-playground-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.smoke-playground-panel-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.smoke-playground-reset {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.smoke-playground-reset:hover:not(:disabled) {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
  background: var(--primary-dim);
}

.smoke-playground-reset:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.smoke-playground-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.smoke-playground-fieldset:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.smoke-playground-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.smoke-playground-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.smoke-playground-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.smoke-playground-row input[type='range'] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.smoke-playground-viewport-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.smoke-playground-viewport {
  position: relative;
  flex: 1;
  min-height: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg);
  overflow: hidden;
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--primary) 4%, transparent);
}

.smoke-playground-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.smoke-playground-reduced {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--bg);
}

/* =====================
   COMMAND CENTER (HOME)
   ===================== */
.grid-overlay--dim {
  opacity: 0.35;
}

.main-content--command {
  animation: none;
  justify-content: flex-start;
  padding: clamp(2rem, 4vh, 3rem) clamp(1.5rem, 4vw, 3rem) 4rem;
}

.section--command {
  width: 100%;
  max-width: 1100px;
  padding: 0;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  align-items: start;
}

.diag-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1rem 1.15rem 1.15rem;
}

.diag-panel--log {
  grid-column: 1 / -1;
}

.diag-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.diag-panel-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
}

.diag-panel-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.diag-panel-link {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.diag-panel-link:hover {
  color: var(--primary);
}

.diag-terminal {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
}

.diag-terminal .line-prompt {
  color: var(--primary);
  margin-right: 0.35rem;
}

.diag-terminal .line-out {
  color: var(--text);
}

.diag-terminal .line-dim {
  color: var(--muted);
}

.diag-terminal p {
  margin: 0.15rem 0;
}

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

.tool-registry-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.4;
}

.tool-registry-table th {
  text-align: left;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding: 0.35rem 0.5rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.tool-registry-table td {
  padding: 0.45rem 0.5rem 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

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

.tool-registry-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.registry-idx {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

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

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

.registry-link a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.registry-link a:hover {
  color: var(--text);
}

.registry-writeup {
  color: var(--muted) !important;
}

.registry-writeup:hover {
  color: var(--primary) !important;
}

.registry-loading,
.registry-error {
  color: var(--muted);
  padding: 0.75rem 0;
}

.log-viewer-body {
  margin: 0;
  max-height: 40vh;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

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

  .diag-panel--log {
    grid-column: auto;
  }
}

/* =====================
   OPERATOR'S LAB (HOME)
   ===================== */
.home-scroll {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 5vh, 3.5rem);
  overflow-x: hidden;
}

/* Hero */
.home-hero {
  padding-bottom: 0.5rem;
}

.home-hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 1rem;
}

.home-hero-name {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.05;
  margin-bottom: 0.65rem;
}

.home-hero-title {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
}

.home-hero-role {
  color: var(--accent);
}

.home-hero-dot {
  color: var(--muted);
  margin: 0 0.15rem;
}

.home-hero-main {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
  max-width: 38ch;
  margin-bottom: 0.85rem;
}

.home-hero-sub {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 44ch;
  margin-bottom: 1.5rem;
}

.home-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.75rem 1rem;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.home-status-item {
  display: inline-flex;
  gap: 0.35rem;
  align-items: baseline;
}

.home-status-item--dim .home-status-val {
  color: var(--muted);
}

.home-status-key {
  color: var(--muted);
}

.home-status-key::after {
  content: ':';
}

.home-status-val {
  color: var(--text);
}

.home-status-loading,
.home-status-error {
  color: var(--muted);
}

.home-status-error {
  color: var(--danger);
}

/* Section headers */
.home-section {
  overflow-x: hidden;
}

.home-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
}

.home-section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  width: 100%;
}

.home-section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
}

.home-section-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-left: auto;
}

.home-section-lede {
  font-size: 0.88rem;
  color: var(--muted);
  margin: -0.5rem 0 1.25rem;
}

/* Glass card base */
.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-panel);
}

/* Mission card */
.mission-card {
  border-left: 2px solid var(--accent);
}

.mission-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.mission-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.mission-status {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.mission-summary {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.mission-focus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.mission-focus-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.mission-focus-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}

.mission-updated {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.mission-loading,
.mission-error {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.mission-error {
  color: var(--danger);
}

/* Arsenal grid (home) */
.home-arsenal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.home-arsenal-card {
  transform: none;
  cursor: default;
}

.page-home .home-arsenal-card:hover,
.page-home .tool-card.home-arsenal-card:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 4%, transparent);
}

.page-home .home-arsenal-card:hover::before,
.page-home .home-arsenal-card:hover::after {
  opacity: 0;
}

.home-arsenal-card .tool-card-index {
  color: var(--accent);
}

.home-arsenal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.home-arsenal-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.home-arsenal-link:hover {
  color: var(--text);
}

.home-arsenal-link--muted {
  color: var(--muted);
}

.home-arsenal-link--muted:hover {
  color: var(--primary);
}

.arsenal-loading,
.arsenal-error {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  grid-column: 1 / -1;
}

.arsenal-error {
  color: var(--danger);
}

/* Lab grid */
.home-lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
}

.lab-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-left: 2px solid var(--primary);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.lab-card--link:hover {
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
  background: color-mix(in srgb, var(--primary) 3%, transparent);
}

.lab-card--toggle {
  cursor: default;
}

.lab-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.lab-card-name {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.lab-card-note {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

.lab-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.lab-card-tags span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
}

.lab-card-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  margin-top: auto;
  padding-top: 0.5rem;
}

.lab-card-action {
  margin-top: 0.25rem;
}

.lab-smoke-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lab-smoke-toggle:hover {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
}

.lab-smoke-toggle[aria-pressed="true"] {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background: var(--primary-dim);
}

.lab-loading,
.lab-error {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.lab-error {
  color: var(--danger);
}

/* Text-aware project cards (Pretext) */
.home-lab-grid .project-card {
  cursor: default;
}

.lab-card-subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  letter-spacing: 0.02em;
  margin: 0;
}

.project-card-status-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.pretext-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-end;
}

.pretext-badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.pretext-badge--active.pretext-badge--safe {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
  background: color-mix(in srgb, var(--success) 8%, transparent);
}

.pretext-badge--active.pretext-badge--overflow {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 40%, transparent);
  background: color-mix(in srgb, var(--warning) 8%, transparent);
}

.pretext-badge--active.pretext-badge--measured {
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 35%, transparent);
}

.pretext-badge--active.pretext-badge--responsive {
  color: var(--secondary);
  border-color: color-mix(in srgb, var(--secondary) 35%, transparent);
}

.project-card-concept {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.project-card-concept-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-card-apis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.project-card-apis code {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
}

.pretext-reading {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}

.project-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.project-card-action {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.project-card-action:hover {
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

.project-card-action--primary {
  background: var(--primary-dim);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

.project-card-action--ghost {
  color: var(--muted);
  background: transparent;
}

.project-card-proof {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  font-size: 0.82rem;
  line-height: 1.55;
}

.project-card-proof-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0.75rem 0 0.35rem;
}

.project-card-proof-label:first-child {
  margin-top: 0;
}

.project-card-proof-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.project-card-proof-meta {
  margin: 0.5rem 0 0;
  display: grid;
  gap: 0.5rem;
}

.project-card-proof-meta dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.project-card-proof-meta dd {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.project-card-proof-meta-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0.5rem 0 0;
  padding-left: 0.5rem;
  border-left: 2px solid var(--primary);
}

@media (max-width: 480px) {
  .project-card-status-wrap {
    align-items: flex-start;
    width: 100%;
  }

  .pretext-badges {
    justify-content: flex-start;
  }

  .project-card-actions {
    flex-direction: column;
  }

  .project-card-action {
    text-align: center;
  }
}

/* Field notes */
.home-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}

.field-note-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-left: 2px solid var(--accent);
  transition: border-color 0.15s ease;
}

.field-note-card:hover {
  border-left-color: var(--accent-hover);
}

.field-note-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.field-note-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.field-note-summary {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.field-note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.field-note-tags span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.12rem 0.4rem;
}

.field-note-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  text-decoration: none;
  margin-top: 0.25rem;
  transition: color 0.15s ease;
}

.field-note-link:hover {
  color: var(--text);
}

.home-notes-footer {
  margin-top: 1rem;
}

.home-notes-raw {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.home-notes-raw:hover {
  color: var(--primary);
}

.notes-loading,
.notes-error {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.notes-error {
  color: var(--danger);
}

/* Transmission */
.transmission-card {
  max-width: 480px;
}

.transmission-lede {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

.transmission-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.transmission-links a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.transmission-links a:hover {
  border-bottom-color: color-mix(in srgb, var(--primary) 20%, transparent);
}

.transmission-links li:last-child a {
  border-bottom: none;
}

.transmission-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
}

.transmission-target {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
}

.transmission-links a:hover .transmission-target {
  color: var(--text);
}

/* Theme switcher */
.theme-control {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
}

.theme-control-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--muted);
}

.theme-control-select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.theme-control-select:hover {
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
}

.theme-control-select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.theme-control-vibe {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
  line-height: 1.4;
}

.theme-control--sidebar {
  margin-top: 0;
}

.theme-control--sidebar .theme-control-label {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  margin-bottom: -0.15rem;
}

.theme-control--sidebar .theme-control-select {
  font-size: 0.65rem;
  padding: 0.3rem 0.45rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--panel) 50%, transparent);
}

.theme-control--sidebar .theme-control-vibe {
  display: none;
}

.theme-control--sidebar .theme-control {
  gap: 0.3rem;
}

.lab-theme-panel {
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-left: 2px solid var(--secondary);
  border-radius: var(--radius-card);
}

.badge--verified {
  color: var(--success);
  background: transparent;
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
}

.badge--verified::before {
  background: var(--success);
}

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

  .home-section-meta {
    margin-left: 0;
    width: 100%;
  }

  .home-status-strip {
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (max-width: 900px) {
  .home-arsenal-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================
   MOBILE (< 768px)
   ===================== */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    z-index: 200;
  }

  .sidebar-top {
    margin-bottom: 0;
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0;
    border-bottom: none;
  }

  .sidebar-nav::before {
    display: none;
  }

  .sidebar-name {
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .badge,
  .sidebar-link {
    display: none;
  }

  .smoke-toggle {
    width: 1.85rem;
    height: 1.85rem;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 0.25rem;
    flex: unset;
  }

  .nav-link {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
  }

  .nav-link.active {
    border-left-color: transparent;
    border-bottom-color: var(--primary);
  }

  .sidebar-bottom {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    margin-left: 0.5rem;
  }

  .theme-control--sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding-top: 56px;
  }

  .section {
    padding: 2.5rem 1.25rem 4.5rem;
  }

  .section--hero {
    padding-top: 2.75rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-panel {
    order: -1;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .featured-card {
    min-height: 12rem;
  }

  body::after {
    left: 5%;
  }

  .site-footer {
    left: 1.25rem;
    bottom: 1rem;
  }

  .main-content--smoke-playground {
    padding: 1rem 1.25rem 3.5rem;
  }

  .smoke-playground-layout {
    flex-direction: column;
  }

  .smoke-playground-panel {
    width: 100%;
    max-height: none;
  }

  .smoke-playground-viewport-wrap {
    min-height: 45vh;
  }
}

@media (max-width: 420px) {
  .sidebar {
    padding-inline: 0.85rem;
  }

  .sidebar-name {
    display: none;
  }

  .nav-link {
    padding-inline: 0.42rem;
  }
}
