/*  ============================================================
    TrueLine Surgical — Design Tokens
    Single source of truth for colors, typography, spacing,
    shadows, radii, and state styles across all pages.
    ============================================================ */

:root {
  /* ── Color: Backgrounds ── */
  --bg:           #0a0c0f;
  --bg2:          #0f1318;
  --bg3:          #141920;
  --bg-hover:     #1a2030;

  /* ── Color: Borders ── */
  --border:       rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.12);
  --border-focus: rgba(200,169,110,0.35);

  /* ── Color: Brand ── */
  --accent:       #c8a96e;
  --accent-hover: #d4b87a;
  --accent-dim:   rgba(200,169,110,0.15);
  --accent2:      #7eb8b0;
  --accent2-dim:  rgba(126,184,176,0.15);

  /* ── Color: Text ── */
  --text:         #e8e4dc;
  --text-muted:   #9a9da2;      /* was #7a7d82 — bumped for readability */
  --text-dim:     #8c9096;      /* was #5a5e64 — bumped to meet WCAG AA 4.5:1 contrast */

  /* ── Color: Semantic / State ── */
  --success:      #6ec89a;
  --success-dim:  rgba(110,200,154,0.12);
  --error:        #e06c6c;
  --error-dim:    rgba(224,108,108,0.12);
  --warning:      #d4956a;
  --warning-dim:  rgba(212,149,106,0.12);
  --info:         #6aaed4;
  --info-dim:     rgba(106,174,212,0.12);

  /* ── Typography: Families ── */
  --font-display: 'Cormorant Garamond', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --font-body:    'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'DM Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;

  /* ── Typography: Sizes (refined for readability) ── */
  --text-2xs:     10px;   /* was 8px  — timestamps, meta badges */
  --text-xs:      11px;   /* was 9px  — labels, uppercase tags */
  --text-sm:      12px;   /* was 10px — small UI elements */
  --text-base:    14px;   /* was 12px — body text, inputs */
  --text-md:      15px;   /* was 13px — descriptions, paragraphs */
  --text-lg:      17px;   /* was 15px — lead text, hero desc */
  --text-xl:      20px;   /* was 18px — section sub-headings */
  --text-2xl:     24px;   /* was 22px — card headings */
  --text-3xl:     32px;   /* was 28px — stat numbers */
  --text-4xl:     40px;   /* was 36px — large display */

  /* ── Typography: Line Heights ── */
  --leading-tight:    1.2;
  --leading-normal:   1.6;
  --leading-relaxed:  1.8;

  /* ── Typography: Letter Spacing ── */
  --tracking-tight:   -0.01em;
  --tracking-normal:  0;
  --tracking-wide:    0.08em;
  --tracking-wider:   0.12em;

  /* ── Spacing Scale (4px base) ── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  32px;
  --space-8:  40px;
  --space-9:  48px;
  --space-10: 64px;
  --space-11: 80px;
  --space-12: 120px;

  /* ── Border Radius ── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(200,169,110,0.08);

  /* ── Transitions ── */
  --ease-default: 0.25s ease;
  --ease-slow:    0.4s ease;

  /* ── Z-index Scale ── */
  --z-base:    1;
  --z-sticky:  50;
  --z-nav:     100;
  --z-modal:   200;
  --z-overlay: 1000;
}

/* ── Shared Resets & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: var(--leading-normal);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Noise overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: var(--z-overlay);
  opacity: 0.4;
}

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

/* ── Selection ── */
::selection {
  background: var(--accent-dim);
  color: var(--text);
}

/* ── Scrollbar (WebKit) ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
