/* css/base.css — Portal Hub V3 Neural Network Theme */

/* Brand kit fonts */
@font-face {
  font-family: Poppins;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src:
    local('Poppins SemiBold'),
    local('Poppins-SemiBold'),
    url('./fonts/poppins-semibold.woff2') format('woff2');
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src:
    local('Inter Light'),
    local('Inter-Light'),
    url('./fonts/inter-light.woff2') format('woff2');
}

/* ─── 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 — Brand Kit 04-portal-hub-3 ──────────────────────────── */
:root {
  /* Brand kit colors */
  --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);

  /* Aliases for compatibility */
  --color-secondary: var(--color-deep-navy);
  --color-muted: var(--color-soft-cyan);
  --color-primary: var(--color-white);
  --color-text: var(--color-bg-primary);

  /* Brand kit fonts */
  --font-headline: poppins, 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter Light', inter, system-ui, sans-serif;
  --font-ui: 'SF Pro Rounded', inter, system-ui, sans-serif;
  --font-code: 'IBM Plex Mono', 'SF Mono', consolas, 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: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 100ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 400ms ease;

  /* CRT Glows */
  --glow-accent: 0 0 8px var(--color-accent), 0 0 16px var(--color-accent);
  --glow-text: 0 0 4px var(--color-text);
}

/* ─── 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-primary);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: top var(--transition-fast);
  font-family: var(--font-ui);
}

.skip-link:focus {
  top: var(--space-4);
  outline: 2px solid var(--color-text);
  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: 400;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

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

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

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

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

/* ─── Selection ─────────────────────────────────────────────────────────────── */
::selection {
  background: var(--color-accent);
  color: var(--color-primary);
}
