/* ============================================================
   AFSPECWAR Training — Base CSS
   Variables, reset, typography
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Barlow:wght@400;500;600&display=swap');

:root {
  /* Colors — Steel + Ice Blue */
  --navy:         #101418;
  --navy-mid:     #161b22;
  --navy-light:   #1e242c;
  --navy-border:  #2d3640;
  --gold:         #4a9eda;
  --gold-light:   #6db3e8;
  --gold-dim:     #2a6a9a;
  --silver:       #8896a4;
  --silver-light: #b4c2d0;
  --white:        #e8edf2;
  --white-dim:    #a0adb8;
  --danger:       #a83226;
  --danger-light: #d44233;
  --success:      #1a6e3a;
  --success-light:#25a05a;
  --warning:      #b06208;
  --warning-light:#d4821e;
  --critical:     #7a0000;

  /* Domain colors */
  --color-run:    #2e86de;
  --color-swim:   #0aabcf;
  --color-strength: #4a9eda;
  --color-ruck:   #8e5e3d;
  --color-metcon: #8e44ad;
  --color-wc:     #148f77;

  /* Typography */
  --font-base:    'Barlow', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Sizing */
  --nav-height:   64px;
  --sidebar-w:    240px;
  --content-max:  1100px;
  --radius-sm:    2px;
  --radius:       4px;
  --radius-lg:    6px;
  --radius-pill:  999px;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.5);
  --shadow:       0 2px 10px rgba(0,0,0,0.6);
  --shadow-lg:    0 6px 24px rgba(0,0,0,0.7);

  /* Transitions */
  --t-fast:       0.12s ease;
  --t:            0.2s ease;
  --t-slow:       0.3s ease;

  /* Z-index scale */
  --z-nav:        100;
  --z-modal:      200;
  --z-toast:      300;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--white);
  background-color: var(--navy);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--gold-light);
  text-decoration: none;
  transition: color var(--t-fast);
}

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

ul, ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

hr {
  border: none;
  border-top: 1px solid var(--navy-border);
  margin: 1.5rem 0;
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--white);
  text-transform: uppercase;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.625rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 0.9375rem; }
h6 { font-size: 0.875rem; }

p {
  margin-bottom: 0.75rem;
  color: var(--silver-light);
  font-family: var(--font-base);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.6;
}

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

small {
  font-size: 0.8125rem;
  color: var(--silver);
}

strong { font-weight: 600; color: var(--white); }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--navy-light);
  border-radius: var(--radius-sm);
}

code { padding: 0.1em 0.35em; }

/* ── Utility classes ────────────────────────────────────── */
.text-gold    { color: var(--gold); }
.text-silver  { color: var(--silver); }
.text-white   { color: var(--white); }
.text-danger  { color: var(--danger-light); }
.text-success { color: var(--success-light); }
.text-warning { color: var(--warning-light); }
.text-muted   { color: var(--white-dim); }

.text-sm  { font-size: 0.8125rem; }
.text-xs  { font-size: 0.75rem; }
.text-lg  { font-size: 1.0625rem; }
.text-xl  { font-size: 1.25rem; }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-upper  { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 600; }

.fw-400 { font-weight: 400; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-wrap   { flex-wrap: wrap; }
.flex-1      { flex: 1; }

.grid        { display: grid; }
.hidden      { display: none !important; }
.sr-only     {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--navy-mid); }
::-webkit-scrollbar-thumb  { background: var(--navy-border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--silver); }

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

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

/* ── Reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
  body { background: white; color: black; }
  .no-print { display: none !important; }
}
