/* ==========================================================================
   Variables
   ========================================================================== */

:root {
  /* Colors */
  --color-background: #05070b; /* deep near-black charcoal */
  --color-surface: #0f121a; /* elevated surface */
  --color-surface-alt: #171b25; /* alternate surface */
  --color-text: #f5f7ff; /* primary text */
  --color-text-muted: #a3adc2;
  --color-border-subtle: #232938;

  --color-primary: #1f7bff; /* electric blue */
  --color-primary-soft: rgba(31, 123, 255, 0.16);
  --color-primary-strong: #4ea2ff;

  --color-success: #15c26b;
  --color-warning: #ffb020;
  --color-danger: #ff4f5e;

  /* Neutral grays (cool / techy) */
  --gray-50: #f8fafc;
  --gray-100: #e2e8f0;
  --gray-200: #cbd5f5;
  --gray-300: #a0aec0;
  --gray-400: #718096;
  --gray-500: #4a5568;
  --gray-600: #2d3748;
  --gray-700: #1a202c;
  --gray-800: #111827;
  --gray-900: #05070b;

  /* Metallic accents (subtle) */
  --color-metal-light: #c0c5d2;
  --color-metal-dark: #3b414f;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: "JetBrains Mono", "Fira Code", SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem;  /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-md: 1rem;     /* 16px base */
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.25rem;  /* 20px */
  --font-size-2xl: 1.5rem;  /* 24px */
  --font-size-3xl: 1.875rem;/* 30px */
  --font-size-4xl: 2.25rem; /* 36px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* Shadows (subtle, tech-inspired) */
  --shadow-xs: 0 0 0 1px rgba(15, 23, 42, 0.8);
  --shadow-sm: 0 8px 18px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.6);
  --shadow-focus: 0 0 0 1px rgba(226, 232, 240, 0.2),
    0 0 0 3px rgba(31, 123, 255, 0.6);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 200ms ease;
  --transition-slow: 320ms ease;

  /* Layout */
  --container-max-width: 1200px;
  --container-padding-x: var(--space-4);
}

/* Larger screens: adjust container padding */
@media (min-width: 1024px) {
  :root {
    --container-padding-x: var(--space-6);
  }
}

/* ==========================================================================
   Reset / Normalize
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding-left: 1.25rem;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: none;
  border-radius: 0;
}

button {
  padding: 0;
  border: none;
  cursor: pointer;
}

textarea {
  resize: vertical;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 100vh;
}

h1,
 h2,
 h3,
 h4,
 h5,
 h6 {
  font-weight: 600;
  line-height: var(--line-height-tight);
  letter-spacing: 0.02em;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2rem, 3.5vw, var(--font-size-4xl));
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.75rem, 3vw, var(--font-size-3xl));
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.5rem, 2.5vw, var(--font-size-2xl));
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--font-size-md);
  margin-bottom: var(--space-1);
}

p {
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
}

strong,
 b {
  font-weight: 600;
}

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

pre {
  padding: var(--space-3);
  background-color: #05070f;
  border-radius: var(--radius-md);
  overflow-x: auto;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast),
    text-shadow var(--transition-fast);
}

a:hover {
  color: var(--color-primary-strong);
  text-shadow: 0 0 12px rgba(31, 123, 255, 0.6);
}

a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border-subtle);
  margin: var(--space-6) 0;
}

/* ==========================================================================
   Accessibility & Motion
   ========================================================================== */

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

/* Layout */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding-x);
  padding-right: var(--container-padding-x);
}

.section {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.section--tight {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

/* Flex utilities */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-row {
  flex-direction: row;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

/* Grid utilities */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

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

/* Spacing helpers (minimal core set) */
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }

.p-0 { padding: 0 !important; }
.p-2 { padding: var(--space-2) !important; }
.p-4 { padding: var(--space-4) !important; }

.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-muted { color: var(--color-text-muted) !important; }

/* Tech accent utility (for subtle borders / outlines) */
.accent-border {
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #1f7bff, #4ea2ff);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 123, 255, 0.45);
  transition: background var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(31, 123, 255, 0.65);
  background: linear-gradient(135deg, #4ea2ff, #7cc3ff);
}

.button:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(31, 123, 255, 0.5);
}

.button:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.button--ghost {
  background: rgba(15, 23, 42, 0.85);
  color: var(--color-text);
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: var(--shadow-xs);
}

.button--ghost:hover {
  background: rgba(31, 41, 55, 0.95);
  border-color: var(--color-primary);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.9);
}

.button--secondary {
  background: linear-gradient(135deg, #111827, #1f2933);
  border-color: rgba(148, 163, 184, 0.45);
  color: var(--color-text);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.9);
}

.button--secondary:hover {
  background: linear-gradient(135deg, #1f2933, #374151);
  border-color: var(--color-metal-light);
}

.button--danger {
  background: linear-gradient(135deg, #ff4f5e, #ff7280);
  box-shadow: 0 10px 24px rgba(248, 113, 113, 0.45);
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

/* Inputs */
.input,
.select,
.textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(13, 18, 28, 0.96);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.85);
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9),
    0 0 0 2px rgba(31, 123, 255, 0.7);
}

.input[aria-invalid="true"],
.input--error {
  border-color: rgba(248, 113, 113, 0.8);
}

.input--sm {
  padding: 0.4rem 0.6rem;
  font-size: var(--font-size-xs);
}

.input--lg {
  padding: 0.75rem 0.9rem;
  font-size: var(--font-size-md);
}

/* Card */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background:
    radial-gradient(circle at top left, rgba(31, 123, 255, 0.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.9), #05070b);
  border: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(148, 163, 184, 0.15),
    transparent,
    rgba(37, 99, 235, 0.12)
  );
  mix-blend-mode: soft-light;
  opacity: 0.3;
  pointer-events: none;
}

.card__header,
.card__body,
.card__footer {
  position: relative;
}

.card__header {
  margin-bottom: var(--space-3);
}

.card__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-1);
}

.card__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card--interactive {
  cursor: pointer;
  transition: transform var(--transition-normal),
    box-shadow var(--transition-normal),
    border-color var(--transition-fast);
}

.card--interactive:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 130, 246, 0.65);
}

.card--compact {
  padding: var(--space-3);
}

/* Tag / Pill (useful for specs, compatibility badges) */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: var(--font-size-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.badge--primary {
  background: rgba(31, 123, 255, 0.18);
  border-color: rgba(59, 130, 246, 0.7);
  color: var(--color-primary-strong);
}

.badge--success {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.7);
  color: var(--color-success);
}

.badge--danger {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.7);
  color: var(--color-danger);
}

/* Form field wrapper (for labels, errors) */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: var(--space-4);
}

.field__label {
  font-size: var(--font-size-sm);
  color: var(--gray-100);
}

.field__hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.field__error {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
}

/* Simple chip-style toggle (e.g. for filters) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  background-color: rgba(15, 23, 42, 0.9);
  cursor: pointer;
  transition: border-color var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.chip--active {
  border-color: var(--color-primary);
  color: var(--color-primary-strong);
  background-color: rgba(31, 123, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.chip:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* Minimal table styling (for technical specs / comparison) */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table th,
.table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border-subtle);
}

.table th {
  font-weight: 500;
  text-align: left;
  color: var(--gray-100);
  background: rgba(15, 23, 42, 0.98);
}

.table tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.7);
}

.table--compact th,
.table--compact td {
  padding: 0.4rem 0.55rem;
}

/* End of base.css */
