/* ============================================
   DESIGN SYSTEM - Foundation First
   Built to match actual HTML structure
   ============================================ */

:root {
    /* === CORE COLORS - Black/White with Navy & Gold === */
    --primary: #1e3a8a;        /* Navy blue */
    --primary-dark: #1e40af;   /* Lighter navy */
    --secondary: #1e3a8a;      /* Navy */
    --accent: #d97706;         /* Gold */
    --gold: #f59e0b;           /* Bright gold */

    /* Factory Theme Colors */
    --factory-dark: #000000;   /* Pure black */
    --factory-electric: #f59e0b; /* Gold */
    --factory-violet: #1e3a8a; /* Navy */

    /* Backgrounds */
    --bg: #ffffff;             /* Pure white */
    --bg-alt: #fafafa;         /* Off-white */
    --bg-dark: #000000;        /* Pure black */

    /* Text - High Contrast Only */
    --text: #000000;           /* Pure black */
    --text-muted: #ffffff;     /* White (for dark bg) */
    --text-light: #000000;     /* Black (for light bg) */

    /* Borders */
    --border: #e5e5e5;

    /* === SPACING === */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-12: 3rem;    /* 48px */
    --space-16: 4rem;    /* 64px */
    --space-20: 5rem;    /* 80px */

    /* === TYPOGRAPHY === */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;

    /* === DESIGN TOKENS === */
    --radius: 0.5rem;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: 200ms ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.5;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    font-weight: 700;
    line-height: 1.2;
}

p {
    margin: 0 0 1rem;
}

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

/* ============================================
   LAYOUT - Container System
   ============================================ */
.site-container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

@media (min-width: 768px) {
    .site-container {
        padding-left: var(--space-6);
        padding-right: var(--space-6);
    }
}

/* ============================================
   NAVIGATION - Dark with Soft Contrast
   ============================================ */
.site-navbar {
    background: #0a0a0a;
    border-bottom: 1px solid #1a1a1a;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: var(--space-4);
}

/* Brand */
.site-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    flex-shrink: 0;
}

.site-brand__mark {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    display: block;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.site-brand__stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-brand__text {
    font-weight: 700;
    font-size: 1.125rem;
    color: #ffffff;
    line-height: 1;
}

.site-brand__sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
}

/* Menu */
.nav-right {
    display: flex;
    align-items: center;
}

.site-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--space-2);
}

@media (min-width: 992px) {
    .site-menu {
        display: flex;
    }
}

.site-menu__link {
    display: block;
    padding: var(--space-2) var(--space-4);
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.site-menu__link:hover {
    color: #ffffff;
    background: rgba(245, 158, 11, 0.1);
}

/* Mobile Toggle */
.site-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

@media (min-width: 992px) {
    .site-toggle {
        display: none;
    }
}

.site-toggle__icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.site-toggle__line {
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* Mobile Menu */
@media (max-width: 991px) {
    .site-menu {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: white;
        border-bottom: 1px solid var(--border);
        padding: var(--space-4);
        box-shadow: var(--shadow-lg);
        display: none;
    }

    .site-menu.is-open {
        display: flex;
    }

    .site-menu__link {
        padding: var(--space-3) var(--space-4);
    }
}

/* ============================================
   HERO SECTION
   ============================================ */
.factory-hero {
    background: #000000;
    color: #ffffff;
    padding: var(--space-20) 0;
    position: relative;
    overflow: hidden;
}

.factory-hero__bg {
    position: absolute;
    inset: 0;
    opacity: 0.1;
}

.factory-hero__content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.factory-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-6);
    padding: var(--space-2) var(--space-4);
    background: rgba(30, 58, 138, 0.2);
    border: 1px solid var(--primary);
    border-radius: 999px;
    color: #ffffff;
}

.factory-hero__eyebrow i {
    color: var(--gold);
}

.factory-hero__title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-6);
    color: #ffffff;
}

.factory-hero__title .highlight {
    color: var(--gold);
}

.factory-hero__subtitle {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #ffffff;
    margin-bottom: var(--space-8);
}

.factory-hero__cta {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-12);
    flex-wrap: wrap;
}

.factory-hero__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-4);
    max-width: 600px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-brutal {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    border: 2px solid currentColor;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-brutal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-brutal-primary {
    background: var(--gold);
    color: #000000;
    border-color: var(--gold);
}

.btn-brutal-primary:hover {
    background: #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.btn-brutal-dark {
    background: transparent;
    color: #ffffff;
    border-color: var(--primary);
}

.btn-brutal-dark:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-brutal-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-brutal-outline:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   METRIC CARDS
   ============================================ */
.metric-card {
    background: rgba(30, 58, 138, 0.1);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: var(--space-6);
    text-align: center;
}

.metric-card__value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--space-2);
    color: var(--gold);
}

.metric-card__label {
    display: block;
    font-size: 0.875rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: var(--space-16) 0;
}

.py-5 {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
}

.section-dark {
    background: var(--factory-dark);
    color: white;
}

.section-process {
    background: var(--factory-dark);
    color: white;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-12);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-header__eyebrow {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: var(--space-4);
}

.section-dark .section-header__eyebrow {
    color: var(--gold);
}

.section-header__title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: var(--space-4);
    color: #000000;
}

.section-dark .section-header__title {
    color: #ffffff;
}

.section-header__subtitle {
    font-size: 1.125rem;
    color: #000000;
}

.section-dark .section-header__subtitle {
    color: #ffffff;
}

/* ============================================
   GRID SYSTEM - Natural Content Flow
   ============================================ */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
    margin: 0;
}

.row > * {
    flex: 1 1 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    .col-md-6 {
        flex: 1 1 calc(50% - var(--space-6));
        max-width: calc(50% - var(--space-6));
    }
}

@media (min-width: 1024px) {
    .col-lg-3 {
        flex: 1 1 calc(25% - var(--space-6));
        max-width: calc(25% - var(--space-6));
        min-width: 280px;
    }

    .col-lg-4 {
        flex: 1 1 calc(33.333% - var(--space-6));
        max-width: calc(33.333% - var(--space-6));
        min-width: 300px;
    }
}

.g-4 {
    gap: var(--space-6);
}

/* ============================================
   CAPABILITY CARDS
   ============================================ */
.capability-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-8);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.capability-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.capability-card__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--gold);
    border-radius: var(--radius);
    font-size: 1.5rem;
    margin-bottom: var(--space-4);
}

.capability-card__title {
    font-size: 1.25rem;
    margin-bottom: var(--space-3);
    color: #000000;
}

.capability-card__desc {
    color: #000000;
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   PROCESS STEPS
   ============================================ */
.process-timeline {
    display: grid;
    gap: var(--space-8);
}

.process-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-6);
    align-items: start;
}

.process-step__number {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    color: #000000;
    font-size: 1.5rem;
    font-weight: 800;
    border-radius: var(--radius);
    flex-shrink: 0;
    border: 2px solid var(--primary);
}

.process-step__content h4 {
    margin-bottom: var(--space-2);
    color: #ffffff;
}

.process-step__content p {
    margin: 0;
    color: #ffffff;
}

/* ============================================
   PROJECT CARDS
   ============================================ */
.project-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-8);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-card__tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: var(--primary);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
}

.project-card__title {
    font-size: 1.25rem;
    margin-bottom: var(--space-3);
    color: #000000;
}

.project-card__desc {
    color: #000000;
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   STATS
   ============================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-12);
    text-align: center;
}

.stat-big__value {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
    margin-bottom: var(--space-3);
}

.stat-big__label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
}

/* ============================================
   CTA SECTION
   ============================================ */
.section-cta {
    background: #000000;
    color: #ffffff;
    padding: var(--space-20) 0;
    text-align: center;
    border-top: 2px solid var(--primary);
}

.section-cta__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--space-6);
    color: #ffffff;
}

.section-cta__subtitle {
    font-size: 1.25rem;
    color: #ffffff;
    max-width: 600px;
    margin: 0 auto var(--space-8);
}

/* ============================================
   BLOG CARDS
   ============================================ */
.ui-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-6);
    transition: all var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.ui-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-card {
    /* Inherits from ui-card */
}

.card-link-overlay {
    position: absolute;
    inset: 0;
}

.card-head {
    font-size: 0.875rem;
    color: #000000;
    margin-bottom: var(--space-2);
}

.card-body {
    color: #000000;
}

.card-text {
    color: #000000 !important;
}

.card-title {
    color: #000000 !important;
}

.card-title a {
    color: #000000 !important;
}

.card-title a:hover {
    color: var(--primary) !important;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.chip,
.chip-soft {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--space-1) var(--space-3);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #000000;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.text-muted {
    color: #000000 !important;
}

.section-dark .text-muted {
    color: #ffffff !important;
}

.mt-4 {
    margin-top: var(--space-8);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-3 {
    margin-bottom: var(--space-3);
}

/* Removed .h-100 utility - was causing vertical stretching */

.h5 {
    font-size: 1.125rem;
    font-weight: 600;
}

.small {
    font-size: 0.875rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
}

.section-head h2 {
    margin: 0;
}

.text-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

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

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: var(--space-12) 0;
    text-align: center;
    color: var(--text-muted);
}

/* ============================================
   RESPONSIVE - Mobile First
   ============================================ */
@media (max-width: 767px) {
    .factory-hero {
        padding: var(--space-12) 0;
    }

    .factory-hero__cta {
        flex-direction: column;
    }

    .factory-hero__cta .btn-brutal {
        width: 100%;
        justify-content: center;
    }

    .factory-hero__metrics {
        grid-template-columns: 1fr;
    }

    .process-step {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .process-step__number {
        margin: 0 auto;
    }

    .section {
        padding: var(--space-12) 0;
    }
}

/* ============================================
   CODE COMPARISON COMPONENT
   ============================================ */

.code-comparison-container {
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.code-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

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

.code-comparison-column {
  display: flex;
  flex-direction: column;
  background: #f9fafb;
  border-right: 1px solid #e5e7eb;
}

.code-comparison-column:last-child {
  border-right: none;
}

@media (max-width: 768px) {
  .code-comparison-column {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .code-comparison-column:last-child {
    border-bottom: none;
  }
}

.code-comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #1f2937;
  color: #f9fafb;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
}

.code-comparison-label {
  flex: 1;
}

.code-comparison-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-heavy {
  background: #fecaca;
  color: #991b1b;
}

.badge-light {
  background: #bbf7d0;
  color: #166534;
}

.badge-neutral {
  background: #e5e7eb;
  color: #374151;
}

.code-comparison-content {
  flex: 1;
  padding: 1rem;
  background: #ffffff;
}

.code-comparison-content pre {
  margin: 0;
  background: #f9fafb;
  border-radius: 4px;
  font-size: 0.875rem;
  overflow-x: auto;
}

.code-comparison-content code {
  display: block;
  padding: 1rem;
  line-height: 1.5;
}

.code-comparison-footer {
  grid-column: 1 / -1;
  padding: 1rem;
  background: #eff6ff;
  border-top: 1px solid #dbeafe;
  text-align: center;
  color: #1e40af;
  font-size: 0.875rem;
}

/* Ensure syntax highlighting works inside comparison */
.code-comparison-content .hljs {
  background: transparent;
  padding: 0;
}
