/* css/base.css — Reset, box-sizing, root variables, skip-link, focus, reduced motion */

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

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
}

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

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─── Root variables ─────────────────────────────────────────────────────────── */
:root {
  /* Colors from brand kit 04-portal-hub */
  --color-neon-cyan: #00e5ff;
  --color-midnight-blue: #0a0f1f;
  --color-white: #fff;
  --color-deep-navy: #08101c;
  --color-soft-cyan: #7ff6ff;
  --color-magenta-pulse: #ff00c8;

  /* Semantic tokens */
  --color-bg-primary: var(--color-midnight-blue);
  --color-bg-secondary: var(--color-deep-navy);
  --color-text-primary: var(--color-white);
  --color-text-secondary: var(--color-soft-cyan);
  --color-accent: var(--color-neon-cyan);
  --color-accent-alt: var(--color-magenta-pulse);

  /* Fonts from brand kit */
  --font-headline: 'Poppins SemiBold', 'Poppins', sans-serif;
  --font-body: 'Inter Light', 'Inter', sans-serif;
  --font-ui: 'SF Pro Rounded', system-ui, sans-serif;
  --font-code: 'IBM Plex Mono', monospace;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgb(0, 229, 255, 0.1);
  --shadow-md: 0 4px 16px rgb(0, 229, 255, 0.15);
  --shadow-lg: 0 8px 32px rgb(0, 229, 255, 0.2);
  --shadow-glow: 0 0 20px rgb(0, 229, 255, 0.4);
  --shadow-glow-alt: 0 0 20px rgb(255, 0, 200, 0.4);
}

/* ─── Skip link ────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: var(--color-midnight-blue);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

/* ─── Focus styles ─────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ─── 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;
  }
}

/* ─── Base typography ──────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-headline);
  font-weight: 600;
  line-height: 1.2;
}

code,
pre,
kbd,
samp {
  font-family: var(--font-code);
}

/* ─── Scrollbar styling ───────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-neon-cyan);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-soft-cyan);
}

/* ─── Selection ─────────────────────────────────────────────────────────────── */
::selection {
  background: var(--color-magenta-pulse);
  color: var(--color-white);
}
