/* ==========================================================================
   Flooring Planners - Design Tokens & Core Base Styles
   Target Personality: Practical, Reliable, Clean, Confident, Approachable
   ========================================================================== */

:root {
  /* --------------------------------------------------------------------------
     1. Color Palette: Restrained, Authoritative Architectural Navy & Warm Stone
     -------------------------------------------------------------------------- */
  /* Canvas & Surfaces */
  --color-bg: #f8f9fb;
  --color-surface: #ffffff;
  --color-surface-soft: #f1f4f9;
  --color-surface-subtle: #f1f4f9;
  --color-surface-hover: #f3f6fa;
  --color-surface-card: #ffffff;

  /* Typography */
  --color-text: #0f172a;
  --color-text-primary: #0f172a;
  --color-text-secondary: #334155;
  --color-text-muted: #64748b;
  --color-text-inverse: #ffffff;

  /* Borders & Dividers */
  --color-border: #e2e8f0;
  --color-border-subtle: #cbd5e1;
  --color-border-hover: #94a3b8;
  --color-border-focus: #1b2a4a;

  /* Primary Brand: Deep Architectural Ink Navy */
  --color-primary: #1b2a4a;
  --color-primary-hover: #111d35;
  --color-primary-active: #0c1527;
  --color-primary-light: #edf2f9;
  --color-primary-border: #cbd9ec;
  --color-primary-contrast: #ffffff;

  /* Secondary / Supporting Blue */
  --color-secondary: #2563eb;
  --color-secondary-hover: #1d4ed8;
  --color-secondary-light: #eff6ff;

  /* Practical Accent: Warm Tool Amber / Ochre (Controlled usage) */
  --color-accent: #d96b27;
  --color-accent-hover: #b85514;
  --color-accent-light: #fff8f1;
  --color-accent-border: #fed7aa;
  --color-accent-text: #9a3412;

  /* Semantic Feedback */
  --color-success: #166534;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;

  --color-warning: #92400e;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;

  /* --------------------------------------------------------------------------
     2. Typography System
     -------------------------------------------------------------------------- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* --------------------------------------------------------------------------
     3. Spacing Scale (8pt / 4pt Rhythm)
     -------------------------------------------------------------------------- */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* --------------------------------------------------------------------------
     4. Layout & Containers
     -------------------------------------------------------------------------- */
  --container-wide: 1240px;
  --container-max-width: 1220px;
  --container: 1220px;
  --container-reading: 780px;
  --container-padding: 1.5rem;
  --header-height: 76px;

  /* --------------------------------------------------------------------------
     5. Shadows & Elevation
     -------------------------------------------------------------------------- */
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 10px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.09), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 4px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-card-hover: 0 10px 20px -2px rgba(15, 23, 42, 0.09), 0 4px 8px -2px rgba(15, 23, 42, 0.04);

  /* --------------------------------------------------------------------------
     6. Radius Scale
     -------------------------------------------------------------------------- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* --------------------------------------------------------------------------
     7. Transitions
     -------------------------------------------------------------------------- */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   CSS Reset & Base HTML Elements
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text-secondary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--color-text-secondary);
  background-color: var(--color-bg);
}

main {
  flex: 1;
}

/* Headings: Confident & Clear Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text-primary);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.35rem, 4vw, 3.15rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 2.5vw, 2.15rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.35;
  font-weight: 700;
}

h4 {
  font-size: 1.05rem;
  line-height: 1.4;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
}

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

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* Accessible focus visible */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container-reading {
  max-width: var(--container-reading);
  margin-left: auto;
  margin-right: auto;
}

/* Typography Helpers */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 0.875rem; line-height: 1.5; }
.text-xs { font-size: 0.75rem; line-height: 1.4; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-6);
  z-index: 9999;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* Responsive adjustments */
@media (min-width: 768px) {
  h1 {
    font-size: 2.75rem;
  }
  h2 {
    font-size: 2rem;
  }
  h3 {
    font-size: 1.35rem;
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 3rem;
  }
}
