/* ============================================================
   01 · BASE
   Reset, technical baseline, typography hierarchy, and focus rings.
   AutoCAD & RJ McLeod Industrial Spec.
   ============================================================ */

/* Add theme-adaptive interactive tokens */
:root {
  --link-hover:        var(--rjm-yellow);
  --focus-ring:        var(--rjm-yellow);
}

[data-theme="light"] {
  --link-hover:        #B28200; /* Deep industrial amber - legible against white/grey */
  --focus-ring:        #000000; /* Crisp CAD dark focus bounding */
}

/* ============================================================
   VIEWPORT & SHELL BASELINE
   ============================================================ */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background-color: var(--cad-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden; /* Strict app-shell: layout containers handle sub-scrolling */
}

/* ============================================================
   AUTOCAD / DRAWING SHEET HEADINGS
   Blocky, uppercase, technical title block styling
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

h1 { font-size: 1.75rem; letter-spacing: 0.08em; }  /* 28px - Drawing Sheet Title */
h2 { font-size: 1.35rem; letter-spacing: 0.07em; }  /* ~22px - Section Header */
h3 { font-size: 1.15rem; letter-spacing: 0.06em; }  /* ~18px - Panel Header */
h4 { font-size: 1.00rem; letter-spacing: 0.05em; }  /* 14px - Sub-panel Title */
h5 { font-size: 0.85rem; letter-spacing: 0.05em; }  /* ~12px - Minor Title */
h6 { font-size: 0.75rem; letter-spacing: 0.06em; color: var(--text-muted); }

/* Paragraphs & Data Labels */
p {
  margin: 0;
  color: inherit;
}

small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Technical Monospace Elements (Coordinates, Sheet IDs, Reference Codes) */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: -0.02em;
}

/* ============================================================
   INTERACTIVE ELEMENTS
   ============================================================ */
a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.12s ease-in-out;
}

a:hover {
  color: var(--link-hover);
}

button {
  font-family: var(--font-body);
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  text-decoration: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input, select, textarea {
  font-family: var(--font-body);
  font-size: inherit;
  color: inherit;
  background-color: transparent;
}

img, svg, canvas {
  display: block;
  max-width: 100%;
  flex-shrink: 0;
}

/* ============================================================
   TECHNICAL SELECTION & FOCUS STATES
   ============================================================ */
/* AutoCAD / High-Vis Yellow Selection */
::selection {
  background-color: var(--rjm-yellow);
  color: #000000;
}

/* Solid Box Bounding Focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ============================================================
   AUTOCAD COMPACT INDUSTRIAL SCROLLBARS
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--cad-border);
  border: 1px solid var(--cad-bg);
  border-radius: var(--radius-none);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cad-border-bold);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--cad-border) var(--cad-bg);
}