/* ==============================================================================
 * ROOT ACCESS SOFTWARE — CORE DESIGN SYSTEM
 * Architecture: Technical Minimalism / Dark-Mode Native
 * Transfer Budget: < 15KB uncompressed, zero external CDN dependencies
 * ============================================================================== */

:root {
  --bg-primary: #080c14;
  --bg-secondary: #0d131f;
  --bg-tertiary: #141c2c;
  --bg-card: #0f1624;
  --bg-card-hover: #162034;
  --bg-code: #060910;
  
  --border-subtle: #1c2738;
  --border-strong: #2a3b54;
  --border-accent: rgba(245, 158, 11, 0.4);
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #080c14;
  
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.15);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.12);
  --accent-cyan: #06b6d4;
  --accent-rose: #f43f5e;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", "Cascadia Code", Menlo, Monaco, Consolas, monospace;
  
  --container-max: 1200px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 158, 11, 0.05), transparent),
    linear-gradient(to bottom, transparent, rgba(6, 9, 16, 0.8));
  background-attachment: fixed;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section {
  padding-top: 6rem;
  padding-bottom: 6rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(8, 12, 20, 0.85);
  border-bottom: 1px solid var(--border-subtle);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.brand-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  color: var(--accent-amber);
  font-weight: 800;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
}

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

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-amber);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* Badges & Pills */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background-color: var(--accent-amber-glow);
  border: 1px solid var(--border-accent);
  color: var(--accent-amber);
  text-transform: uppercase;
}

.pill-badge-emerald {
  background-color: var(--accent-emerald-glow);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* Hero Section */
.hero-section {
  padding-top: 6.5rem;
  padding-bottom: 6.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-content {
  max-width: 860px;
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.12;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.hero-highlight {
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--accent-amber);
  color: var(--text-inverse);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
}

.btn-primary:hover {
  background-color: #d97706;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
}

/* Hero Terminal Box */
.terminal-card {
  background-color: var(--bg-code);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.terminal-dots {
  display: flex;
  gap: 0.4rem;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background-color: #ef4444; }
.dot-yellow { background-color: #eab308; }
.dot-green { background-color: #22c55e; }

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
}

.t-prompt { color: var(--accent-amber); }
.t-cmd { color: var(--text-primary); }
.t-comment { color: var(--text-muted); }
.t-success { color: var(--accent-emerald); }
.t-info { color: var(--accent-cyan); }
.t-alert { color: var(--accent-rose); }

/* Section Headers */
.section-header {
  margin-bottom: 3.5rem;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-amber);
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 750px;
  line-height: 1.7;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
}

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

.feature-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

.feature-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.feature-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.feature-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Architecture Spec Flow Box */
.arch-diagram-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-top: 3.5rem;
  overflow-x: auto;
}

.arch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.arch-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.arch-ascii {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--accent-amber);
  white-space: pre;
  background: var(--bg-code);
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* Comparative Matrix Table */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
}

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

.comp-table th,
.comp-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.comp-table th {
  background-color: var(--bg-tertiary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.comp-table th.col-highlight {
  color: var(--accent-amber);
  border-bottom-color: var(--accent-amber);
}

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

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

.metric-title {
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.metric-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cell-substrate {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-emerald);
  background-color: rgba(16, 185, 129, 0.03);
}

.cell-legacy {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.badge-win {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--accent-emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-risk {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Engineering Principles Cards */
.tenet-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.tenet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.tenet-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background-color: var(--accent-amber);
}

.tenet-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.tenet-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.tenet-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Corporate Network / About */
.network-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-tertiary));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.network-content h3 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.network-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.network-boxes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sub-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.sub-box-title {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.sub-box-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  background-color: var(--bg-code);
  border-top: 1px solid var(--border-subtle);
  padding-top: 4rem;
  padding-bottom: 3rem;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand h4 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

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

.footer-link {
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--accent-amber);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive Media Queries */
@media (max-width: 960px) {
  .network-card {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 4.25rem;
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-strong);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    align-items: flex-start;
  }
  
  .nav-menu.open {
    display: flex;
  }
  
  .nav-toggle {
    display: block;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn {
    width: 100%;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}
