/* ═══════════════════════════════════════════════════════════════
   ELECTRIC CONTROL — PUBLIC WEB DESIGN SYSTEM
   Premium corporate landing page for industrial engineering
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Brand */
  --ec-blue: #2563eb;
  --ec-blue-dark: #1d4ed8;
  --ec-blue-light: #3b82f6;
  --ec-blue-50: #eff6ff;
  --ec-blue-100: #dbeafe;
  --ec-blue-700: #1d4ed8;
  --ec-cyan: #06b6d4;
  --ec-green: #059669;
  --ec-green-light: #10b981;
  --ec-orange: #ea580c;
  --ec-red: #dc2626;

  /* Neutrals */
  --ec-white: #ffffff;
  --ec-gray-50: #f8fafc;
  --ec-gray-100: #f1f5f9;
  --ec-gray-200: #e2e8f0;
  --ec-gray-300: #cbd5e1;
  --ec-gray-400: #94a3b8;
  --ec-gray-500: #64748b;
  --ec-gray-600: #475569;
  --ec-gray-700: #334155;
  --ec-gray-800: #1e293b;
  --ec-gray-900: #0f172a;
  --ec-gray-950: #020617;

  /* Surfaces */
  --ec-bg: var(--ec-white);
  --ec-bg-alt: var(--ec-gray-50);
  --ec-bg-card: var(--ec-white);
  --ec-surface: var(--ec-gray-100);
  --ec-surface-dark: var(--ec-gray-800);
  --ec-text: var(--ec-gray-900);
  --ec-text-secondary: var(--ec-gray-500);
  --ec-text-inverse: var(--ec-white);
  --ec-border: var(--ec-gray-200);
  --ec-border-light: var(--ec-gray-100);

  /* Typography */
  --ec-font: 'Inter', system-ui, -apple-system, sans-serif;
  --ec-font-mono: 'SF Mono', 'Fira Code', monospace;

  /* Spacing scale (4px base) */
  --ec-space-1: 4px;
  --ec-space-2: 8px;
  --ec-space-3: 12px;
  --ec-space-4: 16px;
  --ec-space-5: 20px;
  --ec-space-6: 24px;
  --ec-space-8: 32px;
  --ec-space-10: 40px;
  --ec-space-12: 48px;
  --ec-space-16: 64px;
  --ec-space-20: 80px;
  --ec-space-24: 96px;
  --ec-space-32: 128px;

  /* Layout */
  --ec-container: 1200px;
  --ec-container-wide: 1400px;
  --ec-container-narrow: 800px;
  --ec-header-h: 72px;

  /* Radius */
  --ec-radius-sm: 6px;
  --ec-radius: 10px;
  --ec-radius-lg: 16px;
  --ec-radius-xl: 24px;
  --ec-radius-full: 9999px;

  /* Shadows */
  --ec-shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --ec-shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --ec-shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --ec-shadow-md: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --ec-shadow-lg: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
  --ec-shadow-xl: 0 25px 50px -12px rgba(0,0,0,.15);

  /* Transitions */
  --ec-ease: cubic-bezier(.4, 0, .2, 1);
  --ec-ease-out: cubic-bezier(0, 0, .2, 1);
  --ec-ease-in: cubic-bezier(.4, 0, 1, 1);
  --ec-duration: 200ms;
  --ec-duration-slow: 400ms;
  --ec-duration-slower: 600ms;

  /* Z-index */
  --ec-z-dropdown: 100;
  --ec-z-sticky: 200;
  --ec-z-overlay: 300;
  --ec-z-modal: 400;
  --ec-z-toast: 500;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ec-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ec-text);
  background: var(--ec-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
input, textarea, select { font: inherit; }

/* ─── TYPOGRAPHY ─────────────────────────────────────────── */
.ec-heading-xl {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ec-text);
}
.ec-heading-lg {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.ec-heading-md {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.ec-heading-sm {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.ec-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ec-text-secondary);
}
.ec-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ec-blue);
}
.ec-body-lg { font-size: 1.125rem; line-height: 1.7; }
.ec-body { font-size: 1rem; line-height: 1.6; }
.ec-body-sm { font-size: 0.875rem; line-height: 1.5; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.ec-container {
  width: 100%;
  max-width: var(--ec-container);
  margin: 0 auto;
  padding: 0 var(--ec-space-6);
}
.ec-container-wide {
  width: 100%;
  max-width: var(--ec-container-wide);
  margin: 0 auto;
  padding: 0 var(--ec-space-6);
}
.ec-section {
  padding: var(--ec-space-24) 0;
}
.ec-section-lg {
  padding: var(--ec-space-32) 0;
}
.ec-section-alt {
  background: var(--ec-bg-alt);
}

/* ─── GRID ───────────────────────────────────────────────── */
.ec-grid { display: grid; gap: var(--ec-space-8); }
.ec-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ec-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ec-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) {
  .ec-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .ec-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ec-grid-2, .ec-grid-3, .ec-grid-4 { grid-template-columns: 1fr; }
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.ec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ec-space-2);
  padding: 14px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--ec-radius);
  transition: all var(--ec-duration) var(--ec-ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.ec-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.ec-btn-primary {
  background: var(--ec-blue);
  color: var(--ec-white);
  box-shadow: 0 1px 2px rgba(37,99,235,.3);
}
.ec-btn-primary:hover {
  background: var(--ec-blue-dark);
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
  transform: translateY(-1px);
}
.ec-btn-outline {
  background: transparent;
  color: var(--ec-text);
  border: 1.5px solid var(--ec-border);
}
.ec-btn-outline:hover {
  border-color: var(--ec-gray-400);
  background: var(--ec-gray-50);
}
.ec-btn-white {
  background: var(--ec-white);
  color: var(--ec-blue);
  box-shadow: var(--ec-shadow);
}
.ec-btn-white:hover {
  box-shadow: var(--ec-shadow-md);
  transform: translateY(-1px);
}
.ec-btn-ghost {
  background: rgba(255,255,255,.1);
  color: var(--ec-white);
  border: 1.5px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
}
.ec-btn-ghost:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.4);
}
.ec-btn-lg { padding: 16px 32px; font-size: 1rem; }
.ec-btn-sm { padding: 10px 20px; font-size: 0.8125rem; }
.ec-btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--ec-radius);
}
.ec-btn-arrow svg { transition: transform var(--ec-duration) var(--ec-ease); }
.ec-btn-arrow:hover svg { transform: translateX(3px); }

/* ─── CARDS ──────────────────────────────────────────────── */
.ec-card {
  background: var(--ec-bg-card);
  border-radius: var(--ec-radius-lg);
  border: 1px solid var(--ec-border-light);
  overflow: hidden;
  transition: all var(--ec-duration-slow) var(--ec-ease);
}
.ec-card:hover {
  box-shadow: var(--ec-shadow-lg);
  transform: translateY(-4px);
}
.ec-card-body { padding: var(--ec-space-8); }
.ec-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

/* ─── BADGES ─────────────────────────────────────────────── */
.ec-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--ec-radius-full);
  background: var(--ec-blue-50);
  color: var(--ec-blue);
}
.ec-badge-success { background: #ecfdf5; color: var(--ec-green); }
.ec-badge-warning { background: #fffbeb; color: var(--ec-orange); }
.ec-badge-outline { background: transparent; color: var(--ec-text-secondary); border: 1px solid var(--ec-gray-300); }

/* ─── SPINNER ────────────────────────────────────────────── */
.ec-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--ec-gray-200);
  border-top-color: var(--ec-blue);
  border-radius: 50%;
  animation: ec-spin .6s linear infinite;
}
@keyframes ec-spin { to { transform: rotate(360deg); } }

/* ─── DIVIDERS ───────────────────────────────────────────── */
.ec-divider {
  width: 48px;
  height: 3px;
  background: var(--ec-blue);
  border-radius: 2px;
}
.ec-divider-lg { width: 64px; }

/* ─── UTILITIES ──────────────────────────────────────────── */
.ec-link {
  color: var(--ec-blue);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--ec-duration) var(--ec-ease);
}
.ec-link:hover { color: var(--ec-blue-700); text-decoration: underline; }
.ec-text-center { text-align: center; }
.ec-text-balance { text-wrap: balance; }
.ec-mx-auto { margin-left: auto; margin-right: auto; }
.ec-mb-2 { margin-bottom: var(--ec-space-2); }
.ec-mb-3 { margin-bottom: var(--ec-space-3); }
.ec-mb-4 { margin-bottom: var(--ec-space-4); }
.ec-mb-6 { margin-bottom: var(--ec-space-6); }
.ec-mb-8 { margin-bottom: var(--ec-space-8); }
.ec-mb-12 { margin-bottom: var(--ec-space-12); }
.ec-mb-16 { margin-bottom: var(--ec-space-16); }
.ec-mt-4 { margin-top: var(--ec-space-4); }
.ec-mt-8 { margin-top: var(--ec-space-8); }

/* ─── SCROLL ANIMATIONS ─────────────────────────────────── */
.ec-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--ec-duration-slower) var(--ec-ease-out),
              transform var(--ec-duration-slower) var(--ec-ease-out);
}
.ec-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.ec-reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity var(--ec-duration-slower) var(--ec-ease-out),
              transform var(--ec-duration-slower) var(--ec-ease-out);
}
.ec-reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.ec-reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity var(--ec-duration-slower) var(--ec-ease-out),
              transform var(--ec-duration-slower) var(--ec-ease-out);
}
.ec-reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.ec-reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity var(--ec-duration-slower) var(--ec-ease-out),
              transform var(--ec-duration-slower) var(--ec-ease-out);
}
.ec-reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children */
.ec-stagger > .ec-reveal:nth-child(1) { transition-delay: 0ms; }
.ec-stagger > .ec-reveal:nth-child(2) { transition-delay: 80ms; }
.ec-stagger > .ec-reveal:nth-child(3) { transition-delay: 160ms; }
.ec-stagger > .ec-reveal:nth-child(4) { transition-delay: 240ms; }
.ec-stagger > .ec-reveal:nth-child(5) { transition-delay: 320ms; }
.ec-stagger > .ec-reveal:nth-child(6) { transition-delay: 400ms; }

/* ─── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ec-reveal, .ec-reveal-left, .ec-reveal-right, .ec-reveal-scale {
    opacity: 1;
    transform: none;
  }
}

/* ─── SELECTION ──────────────────────────────────────────── */
::selection { background: var(--ec-blue-100); color: var(--ec-blue-dark); }

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--ec-gray-100); }
::-webkit-scrollbar-thumb { background: var(--ec-gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ec-gray-400); }

/* ─── FOCUS ──────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--ec-blue);
  outline-offset: 2px;
}

/* ─── SKIP LINK ──────────────────────────────────────────── */
.ec-skip {
  position: absolute;
  top: -100%;
  left: var(--ec-space-4);
  padding: var(--ec-space-3) var(--ec-space-6);
  background: var(--ec-blue);
  color: var(--ec-white);
  border-radius: 0 0 var(--ec-radius) var(--ec-radius);
  z-index: 9999;
  font-weight: 600;
  transition: top var(--ec-duration) var(--ec-ease);
}
.ec-skip:focus { top: 0; }

/* ─── DYNAMIC YEAR ─────────────────────────────────────────── */
.ec-year { display: inline; }
