/* ========================================================================
   Variables
   ======================================================================== */
:root {
  /* Color Palette */
  --color-background: #050b16; /* deep navy backdrop for hero/sections */
  --color-surface: #0f1624; /* elevated surface cards/nav */
  --color-surface-alt: #151b2b;
  --color-text: #f5f7fb; /* primary text on dark background */
  --color-text-muted: #9ea4b8;
  --color-border-subtle: #283048;

  --color-primary: #1b63ff; /* core brand blue */
  --color-primary-soft: rgba(27, 99, 255, 0.12);
  --color-primary-strong: #1250d1;

  --color-success: #18b57e;
  --color-success-soft: rgba(24, 181, 126, 0.1);

  --color-warning: #f5a623;
  --color-warning-soft: rgba(245, 166, 35, 0.12);

  --color-danger: #e55353;
  --color-danger-soft: rgba(229, 83, 83, 0.12);

  --gray-50: #f9fafb;
  --gray-100: #edf0f7;
  --gray-200: #d6dae7;
  --gray-300: #b7bed1;
  --gray-400: #9ea4b8;
  --gray-500: #7a8197;
  --gray-600: #575d74;
  --gray-700: #3a4054;
  --gray-800: #222838;
  --gray-900: #0c101a;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", 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 */
  --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 */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --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: 18px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.28);
  --shadow-subtle: 0 4px 18px rgba(0, 0, 0, 0.24);
  --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.45);

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

/* ========================================================================
   Reset / Normalize
   ======================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
}

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

ul[class], ol[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

img {
  height: auto;
}

button,
input,
select,
textarea {
  margin: 0;
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
}

textarea {
  resize: vertical;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ========================================================================
   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);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 100vh;
}

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

h1 {
  font-size: clamp(var(--font-size-3xl), 2.5vw + 1.5rem, var(--font-size-5xl));
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(var(--font-size-2xl), 1.8vw + 1.2rem, var(--font-size-4xl));
}

h3 {
  font-size: clamp(var(--font-size-xl), 1.3vw + 1rem, var(--font-size-3xl));
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

p {
  margin-top: 0;
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
}

strong, b {
  font-weight: 600;
}

small {
  font-size: var(--font-size-sm);
}

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

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

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-normal),
              opacity var(--transition-fast),
              text-shadow var(--transition-fast);
}

a:hover {
  color: var(--color-primary-strong);
}

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

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

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

@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }
}

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

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

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

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

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

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

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

.gap-lg {
  gap: var(--space-6);
}

/* Grid helpers */
.grid {
  display: grid;
  gap: var(--space-6);
}

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

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

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

/* Width helpers */
.w-full { width: 100%; }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

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

/* Elevation helpers */
.surface {
  background: radial-gradient(circle at top left, rgba(27, 99, 255, 0.16), transparent 55%),
              var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.surface--subtle {
  background-color: var(--color-surface-alt);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(27, 99, 255, 0.35);
  transition: background-color var(--transition-fast),
              box-shadow var(--transition-fast),
              transform var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast);
}

.btn:hover {
  background-color: var(--color-primary-strong);
  box-shadow: 0 18px 40px rgba(27, 99, 255, 0.45);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

.btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.btn--ghost {
  background-color: transparent;
  border-color: rgba(245, 247, 251, 0.26);
  color: var(--color-text);
  box-shadow: none;
}

.btn--ghost:hover {
  background-color: rgba(255, 255, 255, 0.02);
  border-color: rgba(245, 247, 251, 0.45);
}

.btn--subtle {
  background-color: rgba(27, 99, 255, 0.08);
  color: var(--color-primary);
  box-shadow: none;
}

.btn--subtle:hover {
  background-color: rgba(27, 99, 255, 0.16);
}

.btn--secondary {
  background-color: var(--color-surface-alt);
  border-color: rgba(158, 164, 184, 0.45);
  color: var(--color-text);
  box-shadow: var(--shadow-subtle);
}

.btn--secondary:hover {
  background-color: #1b2133;
}

.btn--danger {
  background-color: var(--color-danger);
}

.btn[disabled],
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Inputs */
.input,
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(10, 15, 30, 0.95);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              background-color var(--transition-fast);
}

.input::placeholder,
textarea::placeholder {
  color: var(--gray-500);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(27, 99, 255, 0.6);
}

.input[disabled],
select[disabled],
textarea[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

label {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--gray-200);
}

.form-row {
  margin-bottom: var(--space-4);
}

/* Card */
.card {
  position: relative;
  padding: var(--space-6);
  background: radial-gradient(circle at top right, rgba(27, 99, 255, 0.14), transparent 55%),
              var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.card--subtle {
  background: var(--color-surface-alt);
  box-shadow: var(--shadow-subtle);
}

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

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

.card__meta {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-400);
}

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

/* Tag / Pill for SIC codes, statuses, etc. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(158, 164, 184, 0.4);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-100);
  background-color: rgba(7, 12, 24, 0.9);
}

.tag--primary {
  border-color: rgba(27, 99, 255, 0.6);
  background-color: rgba(27, 99, 255, 0.1);
  color: var(--color-primary);
}

.tag--success {
  border-color: rgba(24, 181, 126, 0.7);
  background-color: var(--color-success-soft);
  color: var(--color-success);
}

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

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

:focus:not(:focus-visible) {
  outline: 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;
  }
}

/* ========================================================================
   Typography Helpers for Data-Driven Look
   ======================================================================== */

.kpi-heading {
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-tight);
  letter-spacing: 0.03em;
}

.kpi-subtitle {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gray-400);
}

.muted {
  color: var(--color-text-muted);
}

.overline {
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gray-400);
}

/* ========================================================================
   End
   ======================================================================== */
