/* ==========================================================================
   base.css — CSS reset, custom properties, typography
   MPP Fitment Studio
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Brand colours */
  --color-accent:        #0078c8;
  --color-accent-dim:    #005a9e;
  --color-accent-glow:   rgba(0, 120, 200, 0.15);

  /* Backgrounds — light theme */
  --color-bg:            #f0f0f2;
  --color-surface:       #f0f0f2;
  --color-surface-1:     #ffffff;
  --color-surface-2:     #f4f4f6;
  --color-surface-3:     #e8e8ec;

  /* Borders */
  --color-border-subtle: #e0e0e4;
  --color-border:        #d0d0d6;
  --color-border-strong: #b0b0b8;

  /* Text */
  --color-text-primary:  #111111;
  --color-text-secondary:#444444;
  --color-text-muted:    #888888;

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

  /* Geometry overlays */
  --color-uca:           #0078c8;
  --color-lca:           #16a34a;
  --color-upright:       #d97706;
  --color-pickup:        #dc2626;

  /* Layout */
  --panel-width:         360px;   /* 300px * 1.2 */
  --header-height:       52px;

  /* Typography */
  --font-ui:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing scale */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   20px;
  --space-6:   24px;

  /* Border radius */
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 8px;

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

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */

/* Section label — small all-caps category heading */
.label-caps {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Numeric readout — tabular figures */
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Monospaced value */
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Scrollbar — thin, dark
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

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

/* --------------------------------------------------------------------------
   Focus ring — keyboard navigation
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

.text-accent   { color: var(--color-accent); }
.text-muted    { color: var(--color-text-muted); }
.text-secondary{ color: var(--color-text-secondary); }
.text-danger   { color: var(--color-danger); }
.text-success  { color: var(--color-success); }
.text-warning  { color: var(--color-warning); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }