/* ==========================================================================
   DS-G4RGO Environment Inspection — Global Styles
   Reset, custom properties, typography, base elements
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Dark theme defaults)
   -------------------------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg: #0b0f14;
  --panel: #0f1620;
  --panel-hover: #151d2a;

  /* Borders */
  --border: #1e2a3a;

  /* Text */
  --text: #e8eef7;
  --muted: #9fb0c3;

  /* Accent */
  --accent: #4da3ff;
  --accent-hover: #3a8de0;

  /* Semantic */
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;

  /* Layout tokens */
  --radius: 2px;

  /* Typography stacks */
  --font: 'Roboto', 'Helvetica Neue', Lato, sans-serif;
  --font-mono: 'Roboto Mono', monospace;

  /* Spacing scale (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Transition defaults */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;

  /* Z-index layers */
  --z-sidebar: 100;
  --z-header: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-tooltip: 500;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.5);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Remove default list styles */
ul,
ol {
  list-style: none;
}

/* Remove default link styles */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus-visible {
  color: var(--accent-hover);
}

/* Images */
img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* Remove button defaults */
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Form elements inherit font */
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Remove fieldset styling */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* Remove default summary marker */
summary {
  cursor: pointer;
}

/* Focus-visible outline for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

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

/* Scrollbar styling (Webkit) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

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

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

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

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
}

h2 {
  font-size: 1.375rem;
  font-weight: 600;
}

h3 {
  font-size: 1.125rem;
}

h4 {
  font-size: 1rem;
}

h5 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

h6 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

p {
  margin-bottom: var(--sp-4);
  color: var(--muted);
}

p:last-child {
  margin-bottom: 0;
}

small,
.text-sm {
  font-size: 0.75rem;
}

.text-xs {
  font-size: 0.6875rem;
}

.text-lg {
  font-size: 1rem;
}

strong,
.text-bold {
  font-weight: 600;
}

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

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

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

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

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

.text-mono {
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   Code & preformatted text
   -------------------------------------------------------------------------- */
code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

code {
  background: var(--panel-hover);
  padding: 2px 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  overflow-x: auto;
  white-space: pre;
}

pre code {
  background: none;
  padding: 0;
  border: none;
}

kbd {
  background: var(--panel-hover);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  padding: 2px 6px;
  font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Horizontal rule
   -------------------------------------------------------------------------- */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-6) 0;
}

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

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}
