/* ==========================================================================
   THE NEURAL SQUARE — Formal Design System (White / Light Academic Theme)
   "Learn. Build. Experiment. Create."
   "Igniting Innovators for Tomorrow"
   ========================================================================== */

:root {
  /* Clean, Formal Academic Palette */
  --bg-page: #ffffff;
  --bg-surface: #f8fafc;
  --bg-surface-alt: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-nav: rgba(255, 255, 255, 0.95);
  --bg-dark-terminal: #0d1117;

  /* Primary Brand Colors (Derived from Official Logo) */
  --accent-primary: #1d4ed8;       /* Royal Blue */
  --accent-secondary: #4338ca;     /* Deep Indigo */
  --accent-cyan: #0284c7;          /* High-contrast Technical Cyan */
  --accent-cyan-light: #e0f2fe;    /* Subtle Cyan tint */
  --accent-emerald: #059669;       /* Success / Active badge */
  --accent-amber: #d97706;         /* Milestone / Event gold */

  --gradient-brand: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #4338ca 100%);
  --gradient-badge: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%);

  /* High-Legibility Formal Typography */
  --text-primary: #0f172a;         /* Deep Slate Navy */
  --text-secondary: #334155;       /* Charcoal Body */
  --text-muted: #64748b;           /* Slate Muted */
  --text-dim: #94a3b8;
  --text-highlight: #1d4ed8;

  /* Borders & Dividers */
  --border-subtle: #e2e8f0;
  --border-light: #cbd5e1;
  --border-brand: #93c5fd;
  --border-active: #2563eb;

  /* Soft Elevations & Formal Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -3px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 16px 36px -6px rgba(29, 78, 216, 0.12), 0 6px 12px -3px rgba(15, 23, 42, 0.06);

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Layout */
  --max-width: 1260px;
  --max-width-wide: 1380px;
  --nav-height: 76px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg-page);
  color: var(--text-primary);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Subtle Technical Grid Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.025) 1px, transparent 1px);
  z-index: 0;
}

/* Top Accent Line */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-brand);
  z-index: 1100;
}

/* Custom Selection */
::selection {
  background-color: #dbeafe;
  color: #1e3a8a;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-surface);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

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

h1 {
  font-size: clamp(2.2rem, 4.5vw + 1rem, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #091e42;
}

h2 {
  font-size: clamp(1.75rem, 3vw + 0.4rem, 2.5rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: clamp(1.2rem, 1.8vw + 0.2rem, 1.55rem);
}

h4 {
  font-size: 1.12rem;
}

p {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.7;
}

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

ul, ol {
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

/* ==========================================================================
   Layout Primitives
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  position: relative;
  z-index: 1;
}

.container-wide {
  max-width: var(--max-width-wide);
}

.section {
  padding-top: clamp(4rem, 6vw, 6rem);
  padding-bottom: clamp(4rem, 6vw, 6rem);
  position: relative;
  z-index: 1;
}

.section-alt {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-hero {
  padding-top: calc(var(--nav-height) + 2rem);
  padding-bottom: clamp(3rem, 5vw, 5rem);
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  isolation: isolate;
}

.section-hero > .container {
  position: relative;
  z-index: 1;
}

.hero-neural-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.72;
  pointer-events: none;
  z-index: 0;
}

/* Section Header Structure */
.section-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto clamp(2.5rem, 4vw, 4rem);
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}

.section-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-primary);
}

.section-title {
  margin-bottom: 0.85rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* High-Visibility Hallmark Banner */
.hallmark-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-pill);
  padding: 0.45rem 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1d4ed8;
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.08);
}

.hallmark-banner .star-icon {
  color: #d97706;
  font-size: 1.1rem;
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .grid-4, .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Focus States */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* Prefers Reduced Motion */
@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;
  }
}
