/* ============================================
   FieldOps Guide — Base CSS
   Design tokens, reset, typography
   ============================================ */

:root {
  /* Backgrounds — match FieldOps app exactly */
  --bg: #0a0e13;
  --surface: #111820;
  --surface2: #192030;
  --surface3: #1e2d40;
  --border: #1e2d40;
  --border-hover: #2a3d55;

  /* Text */
  --text: #e0eaf5;
  --text-dim: #8aa4b8;
  --text-hint: #5a7a90;

  /* Accents — match fieldops.app site */
  --accent: #0077cc;           /* blue */
  --accent-hover: #0088e6;
  --accent2: #ff6b00;          /* orange — primary CTA */
  --accent2-hover: #ff8020;
  --success: #22c55e;
  --danger: #cc0000;
  --warning: #fbbf24;

  /* Callout system */
  --callout-bg: #0077cc;
  --callout-text: #ffffff;
  --callout-number: #ff6b00;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

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

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(255, 107, 0, 0.15);

  /* Layout */
  --header-height: 64px;
  --max-width: 1280px;
  --content-width: 768px;

  /* Fonts — matching FieldOps app */
  --font-display: 'Rajdhani', 'Oswald', sans-serif;
  --font-body: 'Rajdhani', system-ui, sans-serif;
  --font-mono: 'Share Tech Mono', 'Courier New', monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;

  /* subtle grid texture matching fieldops.app */
  background-image:
    linear-gradient(rgba(30, 45, 64, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 45, 64, 0.15) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

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

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

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: var(--space-md);
  margin-top: var(--space-2xl);
}

h3 {
  font-size: 1.375rem;
  margin-bottom: var(--space-sm);
  margin-top: var(--space-xl);
  color: var(--text);
}

h4 {
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
  margin-top: var(--space-lg);
  color: var(--text);
}

p {
  margin-bottom: var(--space-md);
  color: var(--text);
}

p + p {
  margin-top: -0.25rem;
}

strong {
  color: var(--text);
  font-weight: 700;
}

em {
  color: var(--accent2);
  font-style: normal;
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface2);
  color: var(--accent2);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

ul, ol {
  margin-bottom: var(--space-md);
  padding-left: 1.5rem;
}

li {
  margin-bottom: var(--space-xs);
  color: var(--text);
}

li::marker {
  color: var(--accent2);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-2xl) 0;
}

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

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

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

/* Utility */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.content {
  max-width: var(--content-width);
  margin: 0 auto;
}

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

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

.hint {
  color: var(--text-hint);
  font-size: 0.9em;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.badge.active {
  color: var(--accent2);
  border-color: var(--accent2);
}

.badge.soon {
  color: var(--text-hint);
  opacity: 0.6;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent2);
  color: #ffffff;
  border-color: var(--accent2);
}

.btn-primary:hover {
  background: var(--accent2-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface3);
  border-color: var(--border-hover);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface);
}

/* Responsive helpers */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 var(--space-md);
  }
}
