/* ==========================================================================
   BEMS Labs LLC - Bespoke Corporate Design System
   High-Assurance Systems & Applied Machine Intelligence
   ========================================================================== */

:root {
  /* Editorial Dark Palette (Default) */
  --bg: #090b0e;
  --bg-surface: #0f1217;
  --bg-surface-elevated: #151921;
  --bg-subtle: #1b202a;
  
  --line-hairline: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-active: #e2e8f0;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Accents - Restrained, Architectural, Cold Titanium */
  --accent-titanium: #e2e8f0;
  --accent-blue: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-emerald: #34d399;
  
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing */
  --max-width: 1200px;
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;

  --transition: 180ms ease;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f4f4f5;
  --bg-subtle: #e4e4e7;

  --line-hairline: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --line-active: #090b0e;

  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-dim: #a1a1aa;

  --accent-titanium: #18181b;
  --accent-blue: #0284c7;
  --accent-indigo: #4f46e5;
  --accent-emerald: #059669;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition), color var(--transition);
}

/* Subtle Grid Background Texture */
.grid-bg-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, var(--line-hairline) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-hairline) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  opacity: 0.35;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  position: relative;
  z-index: 1;
}

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

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

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

.mono {
  font-family: var(--font-mono);
}

/* Top Registry Ribbon */
.registry-ribbon {
  border-bottom: 1px solid var(--line-hairline);
  background: var(--bg-surface);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 8px 0;
  position: relative;
  z-index: 100;
}

.registry-ribbon-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.registry-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-weight: 500;
}

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

/* Navigation */
.site-nav {
  position: sticky;
  top: 0;
  background: rgba(9, 11, 14, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-hairline);
  z-index: 99;
  height: 68px;
  display: flex;
  align-items: center;
}

[data-theme="light"] .site-nav {
  background: rgba(250, 250, 250, 0.88);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-symbol {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-name .sub {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

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

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

/* Minimalist Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 0.86rem;
  font-weight: 500;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
  font-weight: 600;
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--line-strong);
}

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

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-hairline);
  color: var(--text-muted);
  border-radius: var(--radius-xs);
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--line-strong);
}

.mobile-trigger {
  display: none;
}

/* Hero Section */
.hero-wrapper {
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--line-hairline);
}

.hero-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  font-size: 0.76rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  margin-bottom: 28px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-headline {
  font-size: 3.4rem;
  line-height: 1.1;
  font-weight: 600;
  max-width: 900px;
  margin-bottom: 24px;
}

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

.hero-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 64px;
}

/* Key Metrics Ledger */
.metrics-ledger {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--line-hairline);
}

.metric-block {
  display: flex;
  flex-direction: column;
}

.metric-number {
  font-size: 1.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Section Shells */
.section-wrapper {
  padding: 88px 0;
  border-bottom: 1px solid var(--line-hairline);
}

.section-head {
  margin-bottom: 48px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
}

.section-caption {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.section-title {
  font-size: 2.1rem;
  max-width: 680px;
}

/* Capability Cards (Disciplines) */
.disciplines-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-hairline);
  border: 1px solid var(--line-hairline);
}

.discipline-cell {
  background: var(--bg);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  transition: background var(--transition);
}

.discipline-cell:hover {
  background: var(--bg-surface);
}

.discipline-index {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 20px;
}

.discipline-cell h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.discipline-cell p {
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 24px;
  flex-grow: 1;
}

.discipline-specs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  border-top: 1px solid var(--line-hairline);
  padding-top: 16px;
}

.discipline-specs li::before {
  content: "— ";
  color: var(--text-dim);
}

/* Architectural Architecture & Engineering Workbench */
.workbench-panel {
  border: 1px solid var(--line-hairline);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.workbench-tabs {
  display: flex;
  border-bottom: 1px solid var(--line-hairline);
  background: var(--bg-surface-elevated);
  overflow-x: auto;
}

.workbench-tab {
  padding: 12px 24px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-right: 1px solid var(--line-hairline);
  cursor: pointer;
  white-space: nowrap;
}

.workbench-tab.active {
  color: var(--text-primary);
  background: var(--bg-surface);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--text-primary);
}

.workbench-content {
  padding: 32px;
}

.spec-sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.spec-sheet-col h4 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.spec-sheet-col p {
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 20px;
}

.kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.kv-table tr {
  border-bottom: 1px solid var(--line-hairline);
}

.kv-table td {
  padding: 10px 0;
}

.kv-table td.key {
  color: var(--text-muted);
  width: 45%;
}

.kv-table td.val {
  color: var(--text-primary);
}

/* Corporate Ledger / Wyoming Entity Card */
.entity-manifest {
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  padding: 40px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
}

.entity-manifest h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.entity-manifest-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.entity-registry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.entity-registry-table tr {
  border-bottom: 1px solid var(--line-hairline);
}

.entity-registry-table td {
  padding: 10px 0;
}

.entity-registry-table td.label {
  color: var(--text-muted);
  width: 38%;
}

.entity-registry-table td.value {
  color: var(--text-primary);
  font-weight: 500;
}

.entity-badge-box {
  border: 1px solid var(--line-hairline);
  background: var(--bg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.entity-badge-box .seal-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

/* Contact / Inquiries */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}

.contact-meta h2 {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

.contact-meta p {
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

.contact-direct-link {
  display: inline-block;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--text-primary);
  padding-bottom: 4px;
  margin-bottom: 24px;
}

.contact-direct-link:hover {
  opacity: 0.75;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.text-input,
.select-input,
.textarea-input {
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: border-color var(--transition);
}

.text-input:focus,
.select-input:focus,
.textarea-input:focus {
  outline: none;
  border-color: var(--text-primary);
}

.textarea-input {
  min-height: 120px;
  resize: vertical;
}

.form-feedback {
  padding: 12px;
  border: 1px solid var(--line-strong);
  font-size: 0.86rem;
  display: none;
}

.form-feedback.show {
  display: block;
}

/* Footer */
.site-footer {
  padding: 64px 0 32px;
  background: var(--bg-surface);
  font-size: 0.85rem;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-col h5 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav a {
  color: var(--text-secondary);
}

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

.footer-baseline {
  border-top: 1px solid var(--line-hairline);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 16px;
}

/* Mobile Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-aside {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--line-hairline);
  z-index: 151;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  transition: right var(--transition);
}

.drawer-aside.active {
  right: 0;
}

.drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 40px;
}

.drawer-links a {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .hero-headline {
    font-size: 2.8rem;
  }
  .disciplines-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .metrics-ledger {
    grid-template-columns: repeat(2, 1fr);
  }
  .entity-manifest {
    grid-template-columns: 1fr;
  }
  .spec-sheet-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu, .nav-actions .btn-primary {
    display: none;
  }
  .mobile-trigger {
    display: inline-flex;
  }
  .hero-headline {
    font-size: 2.2rem;
  }
  .disciplines-grid {
    grid-template-columns: 1fr;
  }
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .footer-columns {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .metrics-ledger {
    grid-template-columns: 1fr;
  }
  .footer-columns {
    grid-template-columns: 1fr;
  }
}
