/* 45black.tech — Global Styles
 * Brand: Counsel Green palette
 * Typography: IBM Plex Sans
 * Accessibility: WCAG 2.1 Level AA minimum
 */

/* ============================================
   CSS Variables — Brand Tokens
   ============================================ */

:root {
  /* Counsel Green Palette (blkltr product) */
  --color-counsel-green: #1B4D3E;
  --color-fiduciary-green: #2E7D32;
  --color-trustee-teal: #00695C;

  /* Modern Arbiter Palette (45Black corporate - complementary) */
  --color-slate-navy: #1E293B;
  --color-cool-silver: #94A3B8;

  /* Neutrals */
  --color-white: #FFFFFF;
  --color-black: #000000;
  --color-gray-50: #F9FAFB;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-300: #D1D5DB;
  --color-gray-700: #374151;
  --color-gray-900: #111827;

  /* Semantic Tokens */
  --brand-primary: var(--color-counsel-green);
  --brand-accent: var(--color-trustee-teal);
  --brand-corporate: var(--color-slate-navy);

  --text-primary: var(--color-gray-900);
  --text-secondary: var(--color-gray-700);
  --text-on-dark: var(--color-white);

  --bg-primary: var(--color-white);
  --bg-secondary: var(--color-gray-50);
  --bg-dark: var(--brand-primary);

  --border-default: var(--color-gray-200);
  --focus-ring: var(--brand-primary);

  /* Typography */
  --font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing Scale */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 1rem;      /* 16px */
  --space-md: 1.5rem;    /* 24px */
  --space-lg: 2rem;      /* 32px */
  --space-xl: 3rem;      /* 48px */
  --space-2xl: 4rem;     /* 64px */
  --space-3xl: 6rem;     /* 96px */

  /* Layout */
  --max-width-prose: 65ch;
  --max-width-wide: 1280px;
  --border-radius: 0.25rem;
}

/* ============================================
   Reset & Base Styles
   ============================================ */

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

html {
  font-size: 100%; /* 16px base */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-normal);
  font-size: 1.125rem; /* 18px */
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);

  /* Fix IBM Plex Sans numeral alignment */
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--brand-primary);
}

h1 {
  font-size: 2.5rem; /* 40px */
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem; /* 32px */
  margin-top: var(--space-xl);
}

h3 {
  font-size: 1.5rem; /* 24px */
  margin-top: var(--space-lg);
}

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

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

strong, b {
  font-weight: var(--font-weight-semibold);
}

a {
  color: var(--brand-primary);
  text-decoration: underline;
  text-decoration-thickness: 0.0625em;
  text-underline-offset: 0.125em;
  transition: color 0.2s ease;
}

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

a:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--border-radius);
}

/* ============================================
   Layout Components
   ============================================ */

.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--brand-primary);
  color: var(--text-on-dark);
  text-decoration: none;
  z-index: 9999;
}

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

header[role="banner"] {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-default);
  position: relative;
}

nav[role="navigation"] {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-md);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: background 0.15s ease;
}

.nav-links a:hover {
  background: var(--bg-secondary);
}

.nav-links a[aria-current="page"] {
  font-weight: var(--font-weight-semibold);
  color: var(--brand-primary);
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--brand-primary);
  border-radius: var(--border-radius);
}

.nav-toggle:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.nav-toggle svg {
  display: block;
}

/* Mobile nav */
@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-default);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 100;
    padding: var(--space-xs) 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    min-height: 48px;
    min-width: unset;
    padding: var(--space-xs) var(--space-md);
    border-radius: 0;
    justify-content: flex-start;
    border-bottom: 1px solid var(--border-default);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }
}

main {
  padding: var(--space-2xl) 0;
  min-height: 60vh;
}

footer[role="contentinfo"] {
  margin-top: var(--space-3xl);
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border-default);
  background: var(--bg-secondary);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.container {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  margin-bottom: var(--space-3xl);
}

.section:last-child {
  margin-bottom: 0;
}

/* ============================================
   Hero Component
   ============================================ */

.hero {
  padding: var(--space-3xl) 0;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.hero h1 {
  font-size: 3rem;
  max-width: 20ch;
  margin-bottom: var(--space-lg);
}

.hero p {
  font-size: 1.25rem;
  max-width: 60ch;
}

/* ============================================
   Buttons & Forms
   ============================================ */

button, .button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: var(--font-weight-medium);
  color: var(--text-on-dark);
  background: var(--brand-primary);
  border: none;
  border-radius: var(--border-radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover, .button:hover {
  background: var(--brand-accent);
}

button:focus, .button:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

input, textarea, select {
  font-family: var(--font-family);
  font-size: 1rem;
  padding: var(--space-sm);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius);
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
  border-color: var(--brand-primary);
}

label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: var(--font-weight-medium);
}

/* ============================================
   Cards & Content Blocks
   ============================================ */

.card {
  padding: var(--space-lg);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius);
  background: var(--bg-primary);
}

.card h3 {
  margin-top: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
}

/* ============================================
   Footer Layout
   ============================================ */

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.footer-disclaimer {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-default);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ============================================
   Logo & Brand
   ============================================ */

.logo {
  font-weight: var(--font-weight-semibold);
  font-size: 1.25rem;
  color: var(--brand-primary);
  text-decoration: none;
}

.logo:hover {
  color: var(--brand-accent);
}

/* Ghost vowel treatment for blkltr branding */
.ghost-vowel {
  font-weight: var(--font-weight-normal);
  color: var(--color-cool-silver);
  opacity: 0.75;
}

/* ============================================
   CTA Link Groups (inline CTAs with spacing)
   ============================================ */

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-xl);
}

.cta-group a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-xs) var(--space-sm);
}

/* ============================================
   Accessibility Utilities
   ============================================ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.focus-visible:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  body {
    font-size: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

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

  main {
    padding: var(--space-xl) 0;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  body {
    font-size: 12pt;
    color: #000;
  }

  a {
    text-decoration: underline;
    color: #000;
  }

  nav, .skip-link {
    display: none;
  }
}
