/* ==========================================================================
   ProofOps · Design System & Styling Framework (styles.css)
   Aesthetics: Apple Tactile Polish + Vercel Minimalism + Linear Pipeline + OpenAI Tech
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & CSS Variables (--signal color system included)
   -------------------------------------------------------------------------- */
:root {
  /* Brand Core Palette */
  --bg-dark: #070706;
  --bg-dark-rgb: 7, 7, 6;
  --bg-surface: #0e0e0d;
  --bg-card: rgba(18, 18, 17, 0.75);
  --bg-card-hover: rgba(28, 28, 26, 0.85);
  --bg-panel: rgba(14, 14, 13, 0.65);
  --bg-input: rgba(255, 255, 255, 0.04);
  --bg-input-focus: rgba(255, 255, 255, 0.08);

  /* Primary Accent: Orange Glow (#ff6a3d) */
  --accent-orange: #ff6a3d;
  --accent-orange-rgb: 255, 106, 61;
  --accent-orange-glow: rgba(255, 106, 61, 0.25);
  --accent-orange-subtle: rgba(255, 106, 61, 0.12);

  /* Supporting Accents & States */
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.25);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.25);
  --accent-crimson: #ef4444;
  --accent-crimson-glow: rgba(239, 68, 68, 0.25);

  /* Tactical --signal Variable System for Dynamic States */
  --signal-idle: #6b7280;
  --signal-active: var(--accent-orange);
  --signal-success: var(--accent-emerald);
  --signal-warning: var(--accent-amber);
  --signal-danger: var(--accent-crimson);
  --signal-info: var(--accent-cyan);
  --signal: var(--signal-idle);

  /* Borders & Glass Effects */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.25);
  --border-glow: rgba(255, 106, 61, 0.35);

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #7a828e;
  --text-mono: #ffd8cc;

  /* Border Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Elevation & Tactile Shadows */
  --shadow-tactile: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px var(--accent-orange-glow);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Accessibility: Skip Link & Announcer */
.skip-link {
  position: absolute;
  top: -60px;
  left: 1.5rem;
  background: var(--accent-orange);
  color: #070706;
  padding: 0.6rem 1.2rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  z-index: 10000;
  transition: top var(--transition-fast);
  text-decoration: none;
}
.skip-link:focus-visible {
  top: 1.5rem;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Ambient Background Aesthetics */
.ambient-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(7, 7, 6, 0) 0%, var(--bg-dark) 100%);
  background-size: 28px 28px, 100% 100%;
  z-index: 0;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.ambient-glow-a {
  top: -10vw;
  right: -5vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--accent-orange-glow) 0%, transparent 70%);
}

.ambient-glow-b {
  bottom: 5vw;
  left: -10vw;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
}

/* --------------------------------------------------------------------------
   3. Universal Layout & Container Boundaries
   -------------------------------------------------------------------------- */
.section-shell {
  max-width: 1440px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.25rem, 3vw, 2.5rem);
  padding-right: clamp(1.25rem, 3vw, 2.5rem);
  position: relative;
  z-index: 1;
}

#product,
#loop,
#workspace,
#incident-board {
  scroll-margin-top: 5.5rem;
}

/* Base Headings & Typography Elements */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-orange);
  margin-bottom: 0.75rem;
}
.eyebrow span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-orange);
  box-shadow: 0 0 8px var(--accent-orange);
}

.fine-print {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.mono-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-orange);
  background: var(--accent-orange-subtle);
  border: 1px solid rgba(255, 106, 61, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}

.code-block {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Interactive Buttons Base */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  user-select: none;
}

button:active, .button:active {
  transform: scale(0.98);
}

.button-primary, .action-primary {
  background: var(--accent-orange);
  color: #070706;
  border-color: var(--accent-orange);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 4px 14px var(--accent-orange-glow);
}
.button-primary:hover, .action-primary:hover {
  background: #ff7c52;
  border-color: #ff7c52;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 6px 20px rgba(255, 106, 61, 0.4);
}

.button-quiet {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-medium);
}
.button-quiet:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.action-run {
  background: var(--accent-emerald);
  color: #070706;
  border-color: var(--accent-emerald);
  box-shadow: 0 4px 14px var(--accent-emerald-glow);
}
.action-run:hover:not(:disabled) {
  background: #34d399;
  border-color: #34d399;
}

.action-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: var(--border-medium);
}
.action-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-strong);
}

.action-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}
.action-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--accent-crimson);
  color: #fff;
}

.icon-button {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.icon-button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

button:disabled, .button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Accessible Focus States */
:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   4. Site Navigation & Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(7, 7, 6, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-nav {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem clamp(1.25rem, 3vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  display: flex;
  gap: 3px;
  align-items: center;
}
.brand-mark i {
  display: block;
  width: 10px;
  height: 20px;
  background: var(--accent-orange);
  border-radius: 2px;
  transform: skewX(-12deg);
}
.brand-mark i:last-child {
  opacity: 0.4;
  height: 14px;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}
.nav-links a:hover {
  color: var(--accent-orange);
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.connection-pill[data-state="connecting"] .pulse-dot {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.connection-pill[data-state="connected"],
.connection-pill[data-state="online"] {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
  color: #a7f3d0;
}
.connection-pill[data-state="connected"] .pulse-dot,
.connection-pill[data-state="online"] .pulse-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.connection-pill[data-state="offline"] {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
}

.connection-pill[data-state="offline"] .pulse-dot {
  background: var(--accent-crimson);
  box-shadow: 0 0 8px var(--accent-crimson);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: pulse-ring 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* --------------------------------------------------------------------------
   5. Marketing Sections (Hero, Trust Strip, Principles, Capability)
   -------------------------------------------------------------------------- */
/* Hero Section */
.hero {
  padding-top: clamp(3rem, 7vw, 6rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 3rem;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(3.2rem, 5vw, 5rem);
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .hero-copy h1,
  .hero-copy h1 em {
    white-space: nowrap;
  }
}
.hero-copy h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lede {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero-notes {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.hero-notes li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hero-notes li::before {
  content: "✓";
  color: var(--accent-orange);
  font-weight: bold;
}

/* Hero Orbit Visual */
.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.loop-shell {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loop-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed var(--border-medium);
  animation: rotate-orbit 40s linear infinite;
}
.loop-orbit-a { width: 100%; height: 100%; }
.loop-orbit-b { width: 75%; height: 75%; animation-duration: 25s; animation-direction: reverse; }
.loop-orbit-c { width: 50%; height: 50%; animation-duration: 15s; }

@keyframes rotate-orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loop-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 1px solid var(--accent-orange);
  box-shadow: 0 0 30px var(--accent-orange-glow);
  z-index: 2;
  text-align: center;
}
.loop-core span { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.1em; }
.loop-core strong { font-size: 1.1rem; color: var(--accent-orange); font-weight: 800; line-height: 1; }
.loop-core small { font-family: var(--font-mono); font-size: 0.6rem; color: var(--accent-emerald); margin-top: 2px; }

.loop-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(14, 14, 13, 0.9);
  border: 1px solid var(--border-medium);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.loop-node i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-orange); }

.node-agent { top: 4%; left: 50%; transform: translateX(-50%); }
.node-evidence { top: 28%; right: 2%; }
.node-approval { bottom: 12%; right: 10%; }
.node-action { bottom: 12%; left: 10%; }
.node-verify { top: 28%; left: 2%; }

#loop-caption {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-align: center;
}

/* Trust Metric Strip */
.trust-strip {
  display: grid;
  grid-template-columns: auto repeat(6, 1fr);
  gap: 1.5rem;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 5rem;
}

.trust-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-right: 1.5rem;
  border-right: 1px solid var(--border-subtle);
}

.signal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.trust-strip article {
  display: flex;
  flex-direction: column;
}
.trust-strip article span {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.trust-strip article strong {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Principles Section */
.principles {
  margin-bottom: 6rem;
}

.section-heading {
  max-width: 640px;
  margin-bottom: 3rem;
}
.section-heading h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  margin-bottom: 1rem;
}
.section-heading p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

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

.principle-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}
.principle-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-medium);
}

.principle-card.featured {
  background: linear-gradient(145deg, rgba(28, 28, 26, 0.9) 0%, rgba(18, 18, 17, 0.75) 100%);
  border-color: rgba(255, 106, 61, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-index {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-orange);
  margin-bottom: 1.5rem;
  display: block;
}

.principle-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.principle-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.principle-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-evidence {
  align-items: flex-end;
  gap: 3px;
}

.icon-evidence i {
  width: 4px;
  border-radius: var(--radius-pill);
  background: var(--accent-orange);
}

.icon-evidence i:nth-child(1) { height: 9px; opacity: 0.45; }
.icon-evidence i:nth-child(2) { height: 17px; }
.icon-evidence i:nth-child(3) { height: 13px; opacity: 0.7; }

.icon-approval i {
  position: relative;
  width: 15px;
  height: 18px;
  border: 1px solid var(--accent-orange);
  border-radius: 3px;
}

.icon-approval i::before {
  content: "";
  position: absolute;
  width: 7px;
  height: 4px;
  left: 3px;
  top: 5px;
  border-left: 2px solid var(--accent-orange);
  border-bottom: 2px solid var(--accent-orange);
  transform: rotate(-45deg);
}

.icon-verify i {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1px solid var(--accent-emerald);
  border-radius: 50%;
}

.icon-verify i::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 4px;
  left: 4px;
  top: 4px;
  border-left: 2px solid var(--accent-emerald);
  border-bottom: 2px solid var(--accent-emerald);
  transform: rotate(-45deg);
}

/* Capability Section */
.capability-story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  background: rgba(14, 14, 13, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 3rem;
  margin-bottom: 6rem;
}

.capability-copy h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 1rem;
}
.capability-copy p {
  color: var(--text-secondary);
  font-size: 1rem;
}

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

.capability-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}
.capability-stat strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--text-primary);
}
.capability-stat.accent strong {
  color: var(--accent-orange);
}
.capability-stat span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.capability-route {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}
.capability-route i {
  color: var(--accent-orange);
  font-style: normal;
}

/* --------------------------------------------------------------------------
   6. Workspace (Interactive Local Demo Dashboard)
   -------------------------------------------------------------------------- */
.workspace-section {
  padding-bottom: 6rem;
}

.workspace-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}
.workspace-intro h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}
.workspace-intro p {
  color: var(--text-secondary);
  max-width: 420px;
}

.workspace-shell {
  background: #0a0a09;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.workspace-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(20, 20, 18, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.toolbar-brand span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-orange);
}

.toolbar-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-muted);
}

/* Main 3-Column Command Grid Layout */
.command-grid {
  display: grid;
  grid-template-columns: 280px 1fr 300px;
  min-height: 720px;
  min-width: 0;
  background: #070706;
}

.command-grid > *,
.operations-deck,
.left-rail,
.right-rail {
  min-width: 0;
}

/* Common Panel Styling */
.panel {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.panel-heading h3 {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel-code {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-orange);
  background: var(--accent-orange-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
}

/* Left Rail: Controls, Scenarios, Incident Queue, Agents */
.left-rail {
  border-right: 1px solid var(--border-subtle);
  background: rgba(12, 12, 11, 0.6);
  display: flex;
  flex-direction: column;
}

.injection-panel label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.8rem;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
}
select:focus-visible {
  border-color: var(--accent-orange);
  background: var(--bg-input-focus);
}

.injection-panel .action-primary {
  width: 100%;
  margin-top: 0.75rem;
  font-size: 0.82rem;
}

/* Incident Queue */
.incident-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
}

.incident-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}
.incident-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-medium);
}
.incident-item.active, .incident-item[data-selected="true"] {
  border-color: var(--accent-orange);
  background: var(--accent-orange-subtle);
}

.incident-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}
.incident-id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-orange);
  font-weight: 600;
}

.incident-title-text {
  font-size: 0.78rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Agent List */
.agent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
}

.agent-card, .agent-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.agent-card:hover, .agent-item:hover {
  border-color: var(--border-medium);
}
.agent-card.selected, .agent-card[data-selected="true"], .agent-item[data-active="true"] {
  border-color: var(--accent-orange);
  background: rgba(255, 106, 61, 0.08);
}

.agent-item {
  position: relative;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.7rem 0.65rem 1rem;
  cursor: default;
}

.agent-item::before {
  content: "";
  position: absolute;
  inset: 0.65rem auto 0.65rem 0.45rem;
  width: 3px;
  border-radius: var(--radius-pill);
  background: var(--agent-color, var(--accent-orange));
  opacity: 0.75;
}

.agent-item strong {
  font-size: 0.76rem;
  color: var(--text-primary);
}

.agent-item span {
  font-size: 0.66rem;
  color: var(--text-muted);
}

.agent-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-orange);
  flex-shrink: 0;
}

.agent-info {
  flex: 1;
  min-width: 0;
}
.agent-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}
.agent-role {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.agent-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.skill-chip {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  color: var(--text-secondary);
}
.skill-chip:hover {
  color: var(--accent-orange);
  background: var(--accent-orange-subtle);
}

/* Center Column: Operations Deck & Timeline */
.operations-deck {
  display: flex;
  flex-direction: column;
  background: #070706;
}

.incident-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}
.incident-header h2 {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}
#incident-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.incident-flags {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.flag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}
.flag.severity {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Data-status dynamic signal bindings */
.flag.status, [data-status] {
  --signal: var(--signal-idle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.flag.status[data-status="triaging"],
.flag.status[data-status="diagnosing"],
.flag.status[data-status="planning"],
.flag.status[data-status="executing"],
.flag.status[data-status="verifying"],
[data-status="active"],
[data-status="running"] {
  --signal: var(--signal-active);
  background: var(--accent-orange-subtle);
  color: var(--accent-orange);
  border-color: rgba(255, 106, 61, 0.3);
}

.flag.status[data-status="awaiting_approval"], [data-status="warning"] {
  --signal: var(--signal-warning);
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.flag.status[data-status="resolved"], [data-status="complete"], [data-status="verified"] {
  --signal: var(--signal-success);
  background: rgba(16, 185, 129, 0.12);
  color: #a7f3d0;
  border-color: rgba(16, 185, 129, 0.3);
}

.flag.status[data-status="rejected"], .flag.status[data-status="rollback"], [data-status="error"] {
  --signal: var(--signal-danger);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.flag.status[data-status="rolling_back"],
.flag.status[data-status="rolled_back"] {
  --signal: var(--signal-danger);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

/* State Pipeline Machine Bar */
.state-pipeline {
  display: flex;
  list-style: none;
  background: rgba(14, 14, 13, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.state-pipeline li {
  flex: 1;
  min-width: 80px;
  padding: 0.65rem 0.5rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}
.state-pipeline li span {
  font-size: 0.6rem;
  opacity: 0.6;
}

.state-pipeline li.passed {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
}
.state-pipeline li.active, .state-pipeline li[data-current="true"] {
  color: var(--accent-orange);
  background: var(--accent-orange-subtle);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--accent-orange);
}

.state-pipeline li[data-complete="true"] {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.05);
}

.state-pipeline li[data-error="true"] {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  box-shadow: inset 0 -2px 0 var(--accent-crimson);
}

/* Deck Controls Toolbar */
.deck-controls {
  padding: 0.85rem 1.5rem;
  background: rgba(18, 18, 17, 0.5);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.run-state {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
  letter-spacing: 0.05em;
}

/* Timeline Panel */
.timeline-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  overflow: hidden;
}

.section-ruler {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border-subtle);
}

.timeline {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  max-height: 440px;
  padding-right: 0.4rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 220px;
  color: var(--text-muted);
  text-align: center;
}
.empty-cross {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.3;
}
.empty-state small {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  margin-top: 0.2rem;
}

/* Dynamic Component: Timeline Event Card */
.timeline-event, .incident-card {
  display: flex;
  gap: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.timeline-event:hover, .incident-card:hover {
  border-color: var(--border-medium);
}
.timeline-event.selected, .timeline-event[data-selected="true"] {
  border-color: var(--accent-orange);
  background: linear-gradient(145deg, rgba(28, 28, 26, 0.9) 0%, rgba(18, 18, 17, 0.8) 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.incident-card {
  width: 100%;
  min-height: 56px;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  text-align: left;
  color: var(--text-primary);
}

.incident-card strong {
  width: 100%;
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.incident-card span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
}

.incident-card[data-active="true"] {
  border-color: rgba(255, 106, 61, 0.55);
  background: var(--accent-orange-subtle);
  box-shadow: inset 3px 0 0 var(--accent-orange);
}

.timeline-event {
  display: block;
  padding: 0;
  overflow: hidden;
  cursor: default;
}

.event-button {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem 0.75rem;
  padding: 0.85rem 1rem;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: inherit;
  color: var(--text-primary);
}

.event-button:hover {
  background: rgba(255, 255, 255, 0.035);
}

.event-button[data-selected="true"] {
  background: linear-gradient(145deg, rgba(255, 106, 61, 0.12), rgba(18, 18, 17, 0.8));
  box-shadow: inset 3px 0 0 var(--event-color, var(--accent-orange));
}

.event-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.event-meta strong {
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
}

.event-summary {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  line-height: 1.5;
}

.event-outcome {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  padding: 0.12rem 0.42rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.event-outcome[data-outcome="failed"] {
  color: #fca5a5;
}

.event-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-orange);
  flex-shrink: 0;
}

.event-content {
  flex: 1;
  min-width: 0;
}

.event-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}
.event-actor, .event-button {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}
.event-time, .event-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.event-desc, .event-summary {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.event-hash, .event-outcome, .hash-line {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-emerald);
  word-break: break-all;
}

/* Right Rail: Evidence & Audit Details */
.right-rail {
  border-left: 1px solid var(--border-subtle);
  background: rgba(12, 12, 11, 0.6);
  display: flex;
  flex-direction: column;
}

.audit-seal {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.audit-seal[data-valid="verified"],
.audit-seal[data-valid="true"] {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}
.audit-seal[data-valid="verified"] .seal-mark,
.audit-seal[data-valid="true"] .seal-mark {
  color: var(--accent-emerald);
}

.audit-seal[data-valid="false"] {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.audit-seal[data-valid="false"] .seal-mark {
  color: var(--accent-crimson);
}

.audit-seal > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.audit-seal strong {
  font-size: 0.76rem;
}

.audit-seal small {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.seal-mark {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
}

.audit-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.audit-stats div {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  text-align: center;
}
.audit-stats dt {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}
.audit-stats dd {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.evidence-item, .detail-head {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  margin-bottom: 0.5rem;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.detail-head span {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent-orange);
}

.evidence-item strong,
.evidence-item span {
  display: block;
}

.evidence-item strong {
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
}

.evidence-item span,
.skill-detail > p {
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.45;
}

.hash-line {
  padding: 0.55rem 0.65rem;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
}

.contract-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--border-subtle);
  align-items: flex-start;
  gap: 0.75rem;
}

.contract-row > span {
  flex: 0 0 4.6rem;
  color: var(--text-muted);
}

.contract-row p {
  min-width: 0;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   7. Dialog Modal System
   -------------------------------------------------------------------------- */
.approval-dialog {
  margin: auto;
  background: #0e0e0d;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 90%;
  max-width: 480px;
  color: var(--text-primary);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(255, 106, 61, 0.15);
}

.approval-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dialog-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: inline-block;
  margin-bottom: 1rem;
}

.approval-dialog h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

#approval-copy {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.dialog-field {
  margin-bottom: 1.2rem;
}
.dialog-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

input, textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
input:focus-visible, textarea:focus-visible {
  border-color: var(--accent-orange);
  background: var(--bg-input-focus);
}

input[aria-invalid="true"] {
  border-color: #f87171;
}

.form-error {
  margin: -0.45rem 0 0;
  color: #fca5a5;
  font-size: 0.78rem;
  line-height: 1.45;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

/* --------------------------------------------------------------------------
   8. Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding-top: 3rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.footer-brand {
  margin-bottom: 0.4rem;
}

.site-footer p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
}
.footer-links a:hover {
  color: var(--accent-orange);
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   9. Motion Control & Responsive Breakpoints
   Enforcing required breakpoints: 1600/1440/1024/768/430/390/320
   -------------------------------------------------------------------------- */

/* Motion System: hardware accelerated transform/opacity & reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .loop-orbit {
    animation: none !important;
  }
  .ambient-glow {
    display: none !important;
  }
}

/* Breakpoint >= 1440px */
@media (min-width: 1440px) {
  .command-grid {
    grid-template-columns: 300px 1fr 320px;
  }
}

/* Breakpoint 1024px to 1439px */
@media (max-width: 1439px) and (min-width: 1024px) {
  .command-grid {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .hero {
    gap: 2rem;
  }
  .right-rail {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-left: 0;
    border-top: 1px solid var(--border-subtle);
  }
  .right-rail .panel {
    border-right: 1px solid var(--border-subtle);
    border-bottom: 0;
  }
  .right-rail .panel:last-child {
    border-right: 0;
  }
}

/* Breakpoint 768px to 1023px (Sidebars collapse or stack) */
@media (max-width: 1023px) and (min-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-lede, .hero-actions, .hero-notes {
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
  }

  .trust-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .trust-heading {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.5rem;
  }

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

  .capability-story {
    grid-template-columns: 1fr;
  }

  .command-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .left-rail, .right-rail {
    border: none;
  }
}

/* Breakpoint < 768px (Mobile view optimization: 430px / 390px / 320px) */
@media (max-width: 767px) {
  .site-nav {
    flex-wrap: wrap;
  }
  .nav-links {
    display: none; /* Mobile menu hide for clean layout */
  }

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

  .hero-copy h1 {
    font-size: clamp(2.15rem, 8.8vw, 2.7rem);
    line-height: 1.12;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .button {
    width: 100%;
  }

  .trust-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .trust-heading {
    grid-column: 1 / -1;
  }

  .capability-system {
    grid-template-columns: 1fr;
  }

  .principle-grid,
  .capability-story {
    grid-template-columns: 1fr;
  }

  .capability-story {
    padding: 1.5rem;
  }

  .capability-route {
    overflow-x: auto;
    gap: 0.75rem;
    justify-content: flex-start;
  }

  .hero-visual {
    margin-top: 1rem;
  }

  .loop-shell {
    max-width: 340px;
  }

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

  .workspace-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .workspace-toolbar {
    align-items: flex-start;
    gap: 0.65rem;
  }

  .toolbar-meta {
    display: none;
  }

  .incident-header {
    flex-direction: column;
  }

  .incident-flags {
    align-self: stretch;
    flex-wrap: wrap;
  }

  .deck-controls {
    flex-wrap: wrap;
  }

  .deck-controls .action-run,
  .deck-controls .action-secondary {
    width: 100%;
  }

  .deck-controls .run-state {
    width: 100%;
    margin-left: 0;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }
}

/* Extra small devices optimization (320px to 430px) */
@media (max-width: 430px) {
  html {
    font-size: 14px;
  }
  .section-shell {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .hero-notes {
    flex-direction: column;
    align-items: flex-start;
  }
}
