/* base.css — AEI Global Reset & Design Tokens */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
ul[role="list"], ol[role="list"] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.15; font-family: var(--font-display, var(--font-body)); }
p, li, figcaption { text-wrap: pretty; max-width: 72ch; }

::selection {
  background: rgba(30, 80, 140, 0.25);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

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

button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }

a, button, [role="button"], [role="link"], input, textarea, select {
  transition: color 180ms cubic-bezier(0.16, 1, 0.3, 1),
              background 180ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

/* ==========================================
   AEI INDUSTRIAL DESIGN TOKENS
   Inspired by Nord Drivesystems — deep blues,
   steel grays, premium industrial aesthetic
   ========================================== */

:root, [data-theme="light"] {
  /* Typography */
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;

  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* AEI Brand Colors — Industrial Blue */
  --color-primary:       #1a4f7a;
  --color-primary-hover:  #143d5e;
  --color-primary-dark:   #0d2b42;
  --color-primary-light:  #2a6fa8;
  --color-accent:         #e8792f;
  --color-accent-hover:   #d06420;

  /* Surfaces */
  --color-bg:             #ffffff;
  --color-surface:        #f8f9fb;
  --color-surface-2:      #f0f2f5;
  --color-surface-dark:   #1a2332;
  --color-border:         #d1d5db;
  --color-divider:        #e5e7eb;

  /* Text */
  --color-text:           #1a1a2e;
  --color-text-muted:     #5a6577;
  --color-text-faint:     #9ca3af;
  --color-text-inverse:   #ffffff;
  --color-text-on-dark:   #e2e8f0;

  /* Semantic */
  --color-success:        #16a34a;
  --color-warning:        #d97706;
  --color-error:          #dc2626;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.16);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-max: 1400px;

  --transition-base: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --header-height: 72px;
}

[data-theme="dark"] {
  --color-bg:             #0d1117;
  --color-surface:        #161b22;
  --color-surface-2:      #1c2230;
  --color-surface-dark:   #0a0e14;
  --color-border:         #30363d;
  --color-divider:        #21262d;
  --color-text:           #e6edf3;
  --color-text-muted:     #8b949e;
  --color-text-faint:     #484f58;
  --color-text-inverse:   #0d1117;
  --color-text-on-dark:   #e6edf3;
  --color-primary:        #4a9fd4;
  --color-primary-hover:  #3a8fc4;
  --color-primary-light:  #5cafde;
  --color-accent:         #f09848;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #0d1117;
    --color-surface:        #161b22;
    --color-surface-2:      #1c2230;
    --color-surface-dark:   #0a0e14;
    --color-border:         #30363d;
    --color-divider:        #21262d;
    --color-text:           #e6edf3;
    --color-text-muted:     #8b949e;
    --color-text-faint:     #484f58;
    --color-text-inverse:   #0d1117;
    --color-text-on-dark:   #e6edf3;
    --color-primary:        #4a9fd4;
    --color-primary-hover:  #3a8fc4;
    --color-primary-light:  #5cafde;
    --color-accent:         #f09848;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  }
}
