:root {
  --color-bg: #0d0b18;
  --color-indigo: #16122c;
  --color-surface: rgba(26, 21, 52, 0.68);
  --color-surface-hover: rgba(36, 29, 72, 0.82);
  --color-border: rgba(138, 126, 204, 0.22);
  --color-border-glow: rgba(0, 229, 255, 0.45);
  --color-aqua: #00e5ff;
  --color-aurora: #00e699;
  --color-periwinkle: #a5b4fc;
  --color-amber: #f59e0b;
  --color-text-frost: #f1f5f9;
  --color-text-graphite: #94a3b8;
  --color-text-muted: #64748b;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --blur-glass: 16px;
  --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px var(--color-border);
  --shadow-glow: 0 0 25px -5px rgba(0, 229, 255, 0.25);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
}

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

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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 229, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(0, 230, 153, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(165, 180, 252, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  overflow-wrap: anywhere;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

a {
  color: var(--color-aqua);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-aurora);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-aqua);
  outline-offset: 3px;
}

/* Typography Utility */
h1, h2, h3, h4 {
  color: var(--color-text-frost);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

h1 { font-size: clamp(2rem, 3.8vw, 3.25rem); margin-bottom: var(--space-3); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.25rem); margin-bottom: var(--space-3); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.45rem); margin-bottom: var(--space-2); }
p { margin-bottom: var(--space-3); color: var(--color-text-graphite); font-size: 1.05rem; }
p.lead { font-size: 1.2rem; color: var(--color-text-frost); line-height: 1.55; }

/* Structural Container with enhanced breathing room */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.75rem, 5vw, 3.5rem);
  padding-right: clamp(1.75rem, 5vw, 3.5rem);
}

.section {
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.section-header {
  max-width: 780px;
  margin-bottom: var(--space-5);
  padding-left: clamp(0.5rem, 1.5vw, 1.25rem);
}

.section-header p {
  max-width: 68ch;
}

/* Glassmorphic Panel Component */
.glass-panel {
  background: var(--color-surface);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.glass-panel:hover {
  border-color: var(--color-border-glow);
  box-shadow: var(--shadow-glow);
}

/* Badge / Label */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  border-radius: 9999px;
  background: rgba(0, 229, 255, 0.12);
  color: var(--color-aqua);
  border: 1px solid rgba(0, 229, 255, 0.25);
  margin-bottom: var(--space-3);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-amber);
  border-color: rgba(245, 158, 11, 0.35);
}

.badge-aurora {
  background: rgba(0, 230, 153, 0.12);
  color: var(--color-aurora);
  border-color: rgba(0, 230, 153, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  min-height: 48px;
  text-decoration: none;
  min-width: 0;
}

.btn-primary {
  background: linear-gradient(135deg, #00e5ff 0%, #0088ff 100%);
  color: #0d0b18;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #33ebff 0%, #1a94ff 100%);
  color: #0d0b18;
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-frost);
  border-color: var(--color-border);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-periwinkle);
  color: #ffffff;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  min-height: 38px;
}

/* Header */
.site-header {
  height: 68px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(13, 11, 24, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  z-index: 100;
}

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

.brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-frost);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-link:hover {
  color: var(--color-aqua);
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--color-aqua);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

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

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--color-text-frost);
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-aqua);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-frost);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

/* Mobile Nav Drawer */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-indigo);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4);
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.6);
}

.mobile-nav.is-open {
  display: flex;
}

.mobile-nav .nav-link {
  font-size: 1.05rem;
  padding: var(--space-2) 0;
}

/* Hero Section & Deck */
.hero-section {
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.hero-deck {
  position: relative;
  background: linear-gradient(135deg, rgba(26, 21, 52, 0.8) 0%, rgba(14, 11, 28, 0.92) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 4.5vw, 3.75rem);
  box-shadow: var(--shadow-soft), 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.hero-deck::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -100px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-wrapper {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: clamp(2rem, 4.5vw, 3.5rem);
  align-items: center;
}

.hero-content {
  max-width: 640px;
  padding-left: clamp(0.5rem, 1.5vw, 1.25rem);
  display: flex;
  flex-direction: column;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.telemetry-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  border-radius: 9999px;
  background: rgba(0, 230, 153, 0.08);
  color: var(--color-aurora);
  border: 1px solid rgba(0, 230, 153, 0.25);
  margin-bottom: var(--space-3);
}

.hero-content p {
  max-width: 58ch;
}

.hero-description {
  margin-bottom: var(--space-4);
  line-height: 1.65;
  color: var(--color-text-graphite);
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(138, 126, 204, 0.2);
}

.hero-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 700;
  color: var(--color-aqua);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.hero-visual {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: rgba(22, 18, 44, 0.7);
  position: relative;
  box-shadow: var(--shadow-soft);
  display: flex;
  aspect-ratio: 4 / 3;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.hero-overlay-tag {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  right: var(--space-3);
  background: rgba(13, 11, 24, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border-glow);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.82rem;
  color: var(--color-aqua);
  font-weight: 600;
  font-family: var(--font-mono);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-aurora);
  box-shadow: 0 0 10px var(--color-aurora);
  flex-shrink: 0;
}

/* Image + Panel Separation Rules */
.article-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: var(--space-6);
  align-items: start;
}

.image-container {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--color-indigo);
}

.content-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 720px;
}

/* Topic Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.25rem);
  margin-top: var(--space-4);
}

.card-feature {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  border-radius: var(--radius-lg);
}

.card-media {
  width: 100%;
  height: 190px;
  border-radius: calc(var(--radius-lg) - 8px);
  overflow: hidden;
  margin-bottom: var(--space-3);
  position: relative;
  background: var(--color-indigo);
  border: 1px solid var(--color-border);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.35s ease;
}

.card-feature:hover .card-media img {
  transform: scale(1.04);
}

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

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Supply Continuity Split Panel */
.supply-continuity-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
  border-left: 4px solid var(--color-aqua);
  padding: clamp(2rem, 4vw, 3.25rem);
}

.continuity-content {
  padding-left: clamp(0.5rem, 1.5vw, 1rem);
}

.continuity-content p {
  max-width: 65ch;
}

.continuity-media {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-indigo);
  box-shadow: var(--shadow-soft);
  aspect-ratio: 4 / 3;
}

.continuity-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  margin: var(--space-4) 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: rgba(13, 11, 24, 0.5);
}

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

th, td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

th {
  background: rgba(22, 18, 44, 0.8);
  color: var(--color-text-frost);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

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

td {
  color: var(--color-text-graphite);
}

/* Diagram / Process Steps */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.process-step {
  background: rgba(22, 18, 44, 0.5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-aqua);
  margin-bottom: var(--space-1);
}

.step-title {
  font-weight: 600;
  color: var(--color-text-frost);
  margin-bottom: var(--space-2);
}

/* Checklist */
.checklist {
  list-style: none;
  margin: var(--space-3) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--color-text-graphite);
}

.checklist-icon {
  color: var(--color-aurora);
  flex-shrink: 0;
  margin-top: 3px;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-frost);
  margin-bottom: var(--space-2);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(13, 11, 24, 0.7);
  border: 1px solid var(--color-border);
  color: var(--color-text-frost);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--color-aqua);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.form-input.is-invalid,
.form-textarea.is-invalid {
  border-color: #ef4444;
}

.form-error {
  color: #ef4444;
  font-size: 0.8rem;
  margin-top: var(--space-1);
  display: none;
}

.form-error.is-visible {
  display: block;
}

.form-success {
  display: none;
  padding: var(--space-4);
  background: rgba(0, 230, 153, 0.1);
  border: 1px solid rgba(0, 230, 153, 0.3);
  border-radius: var(--radius-md);
  color: var(--color-aurora);
  margin-bottom: var(--space-4);
}

.form-success.is-visible {
  display: block;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  background: #090712;
  padding-top: var(--space-6);
  padding-bottom: var(--space-5);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.footer-col h4 {
  font-size: 0.95rem;
  color: var(--color-text-frost);
  margin-bottom: var(--space-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  color: var(--color-text-graphite);
}

.footer-links a:hover {
  color: var(--color-aqua);
}

.footer-meta {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-bottom {
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

/* Cookie Banner & Dialog */
.cookie-banner {
  position: fixed;
  bottom: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  max-width: 720px;
  margin: 0 auto;
  background: rgba(22, 18, 44, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-aqua);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Modal Preferences */
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 11, 24, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
}

.cookie-modal-backdrop[hidden] {
  display: none;
}

.cookie-modal {
  width: 100%;
  max-width: 520px;
  background: var(--color-indigo);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-soft);
  max-height: 90vh;
  overflow-y: auto;
}

.cookie-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Responsive Styles */
@media (max-width: 960px) {
  .hero-deck {
    padding: clamp(1.75rem, 4vw, 2.5rem);
  }
  .hero-wrapper {
    grid-template-columns: 1fr;
  }
  .hero-content {
    padding-left: 0;
    max-width: 100%;
  }
  .section-header {
    padding-left: 0;
  }
  .continuity-content {
    padding-left: 0;
  }
  .article-grid {
    grid-template-columns: 1fr;
  }
  .supply-continuity-panel {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: 56px;
  }
  .nav-desktop {
    display: none;
  }
  .mobile-toggle {
    display: flex;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .btn {
    width: 100%;
  }
  .cookie-actions {
    flex-direction: column;
  }
  .hero-overlay-tag {
    font-size: 0.75rem;
    padding: 8px 12px;
  }
}

@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;
  }
}