/* ==========================================================================
   Base CSS — Reset, Custom Properties, Typography
   ICE Out PWA
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */

:root {
  /* Primary theme */
  --color-primary: #e94560;
  --color-primary-dark: #c63350;
  --color-primary-light: #f06e83;

  /* Background & surface */
  --color-bg: #1a1a2e;
  --color-bg-light: #16213e;
  --color-surface: #0f3460;
  --color-surface-light: #1a4a7a;

  /* Text */
  --color-text: #eaeaea;
  --color-text-muted: #a0a0b0;
  --color-text-inverse: #1a1a2e;

  /* Semantic */
  --color-success: #4caf50;
  --color-warning: #ff9800;
  --color-danger: #f44336;
  --color-info: #2196f3;

  /* Marker recency */
  --color-recent: #f44336;
  --color-moderate: #ff9800;
  --color-stale: #9e9e9e;

  /* Spacing scale (4px base) */
  --space-xs: 0.25rem;   /*  4px */
  --space-sm: 0.5rem;    /*  8px */
  --space-md: 1rem;       /* 16px */
  --space-lg: 1.5rem;     /* 24px */
  --space-xl: 2rem;       /* 32px */
  --space-2xl: 3rem;      /* 48px */

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono',
    'Courier New', monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.5rem;    /* 24px */
  --font-size-2xl: 2rem;     /* 32px */

  --line-height-tight: 1.25;
  --line-height-base: 1.5;
  --line-height-loose: 1.75;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  /* Z-index layers */
  --z-map: 1;
  --z-nav: 100;
  --z-banner: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* ---------- CSS Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Ensure [hidden] always wins over display rules */
[hidden] {
  display: none !important;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }

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

a {
  color: var(--color-primary-light);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--color-primary);
  text-decoration: underline;
}

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

/* ---------- Interactive Elements ---------- */

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

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

/* ---------- Focus Styles (Accessibility) ---------- */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ---------- Media ---------- */

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

/* ---------- Lists ---------- */

ul,
ol {
  list-style: none;
}

/* ---------- 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-width: 0;
}

.visually-hidden {
  composes: sr-only;
}
