/* ==========================================================================
   UMBERTO PANELLA - Executive Tech Editorial Design System
   Pure CSS - Zero runtime dependencies - Ultra fast loading (<0.2s)
   ========================================================================== */

:root {
  /* Dark Theme (Default) - Deep Obsidian & Slate with Warm Gold Accent */
  --bg-primary: #080b11;
  --bg-secondary: #0e131d;
  --bg-card: #131a27;
  --bg-card-hover: #192233;
  --bg-subtle: #172030;
  
  --border-color: #1e293b;
  --border-hover: #334155;
  --border-accent: rgba(245, 158, 11, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-lead: #cbd5e1;
  
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.15);
  --accent-light: #fbbf24;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 0 25px -5px rgba(245, 158, 11, 0.2);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Newsreader', 'Fraunces', Georgia, Cambria, serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;

  --container-max: 1160px;
  --header-height: 72px;
}

[data-theme="light"] {
  --bg-primary: #fafaf9;
  --bg-secondary: #f4f4f2;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-subtle: #eaeae7;
  
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-accent: rgba(217, 119, 6, 0.4);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-lead: #334155;
  
  --accent: #d97706;
  --accent-glow: rgba(217, 119, 6, 0.12);
  --accent-light: #b45309;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.12);
  --shadow-accent: 0 0 25px -5px rgba(217, 119, 6, 0.15);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.container-narrow {
  width: 100%;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(8, 11, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  transition: background-color 0.2s, border-color 0.2s;
}

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

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

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-role {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
  position: relative;
  padding: 6px 0;
}

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

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.lang-switch:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.lang-switch .active-lang {
  color: var(--accent);
  font-weight: 700;
}

.theme-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Mobile Nav Drawer */
.mobile-nav {
  display: none;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 20px 24px;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  list-style: none;
}

.mobile-nav-link {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 6px 0;
}

.mobile-nav-link.active {
  color: var(--accent);
  font-weight: 600;
}

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

.display-title {
  font-size: clamp(2.3rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.editorial-heading {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 14px;
}

.section-tag::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
}

.lead-text {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--text-lead);
}

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #000000;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.45);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge-accent {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--border-accent);
}

/* Hero Section */
.hero-section {
  padding: 70px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero-manifesto-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-manifesto-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--border-color);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-number span {
  color: var(--accent);
}

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

/* Section Containers */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--border-color);
}

.section-header {
  margin-bottom: 48px;
}

.section-lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin-top: 12px;
}

/* Cards & Bento Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-accent);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 22px;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.15s ease;
}

.card-link:hover {
  gap: 10px;
}

/* Architecture & Flow Diagrams (CSS Styled) */
.flow-diagram {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.flow-diagram-title {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.flow-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.flow-node {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 6px;
  white-space: nowrap;
  color: var(--text-primary);
}

.flow-node.highlight {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.flow-arrow {
  color: var(--text-muted);
  font-weight: bold;
}

/* Editorial Article Layout */
.editorial-article {
  max-width: 760px;
  margin: 0 auto;
}

.editorial-article p {
  font-size: 1.12rem;
  line-height: 1.8;
  color: var(--text-lead);
  margin-bottom: 24px;
}

.editorial-article h2 {
  font-size: 1.8rem;
  margin-top: 48px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.editorial-article h3 {
  font-size: 1.35rem;
  margin-top: 36px;
  margin-bottom: 14px;
  color: var(--accent-light);
}

.editorial-callout {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  padding: 24px;
  border-radius: 0 8px 8px 0;
  margin: 36px 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-primary);
}

/* Case Study Deep Dive */
.case-study-hero {
  padding: 48px 0 32px;
}

.case-study-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 10px;
  margin: 32px 0 48px;
}

.meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 4px;
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.challenge-solution-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0;
}

.challenge-box, .solution-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 28px;
}

.challenge-box {
  border-top: 3px solid #ef4444;
}

.solution-box {
  border-top: 3px solid var(--accent-emerald);
}

/* Contact Cards */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 32px;
}

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

.footer-col-title {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

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

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

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

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: none;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.show {
  display: block;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cookie-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 18px;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cookie-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.cookie-btn-accept {
  background: var(--accent);
  color: #000;
}

.cookie-btn-accept:hover {
  background: var(--accent-light);
}

.cookie-btn-reject {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.cookie-btn-reject:hover {
  border-color: var(--border-hover);
}

/* Responsive */
@media (max-width: 900px) {
  .desktop-nav {
    display: none;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .challenge-solution-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
}
