/* ============================================
   DESIGN SYSTEM — leonmagara.com
   Global reset, tokens, typography, layout
   ============================================ */

/* --- Custom Properties (Design Tokens) --- */
:root {
  /* Colors */
  --color-navy: #1B2A4A;
  --color-blue: #2E5A88;
  --color-slate: #4A5568;
  --color-light-gray: #F7F8FA;
  --color-white: #FFFFFF;

  /* Pipeline stage colors */
  --color-warm-sand: #E8D5B7;
  --color-cool-blue: #B7D4E8;
  --color-soft-green: #B7E8C9;
  --color-deep-navy: #1B2A4A;

  /* Badge colors */
  --color-green-badge: #D4EDDA;
  --color-green-text: #155724;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --spacing-section: 6rem;
  --spacing-element: 2rem;
  --max-width: 1200px;
  --nav-height: 72px;

  /* Effects */
  --transition-base: 0.2s ease;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
  --border-radius: 8px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-slate);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

input,
button,
textarea,
select {
  font: inherit;
}

a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color var(--transition-base);
}

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

ul,
ol {
  list-style: none;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-navy);
  font-weight: 700;
}

h1 {
  font-size: 3rem;
  line-height: 1.1;
}

h2 {
  font-size: 2rem;
  line-height: 1.2;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

small,
.text-small {
  font-size: 0.875rem;
}

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

/* --- Layout --- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-section) 1.5rem;
}

.section-alt {
  background-color: var(--color-light-gray);
}

.section-alt > .section,
.section-alt .section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-section) 1.5rem;
}

/* Full-width wrapper with centered content */
.section-full {
  width: 100%;
  padding: var(--spacing-section) 1.5rem;
}

.section-full .section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* --- Navigation --- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.site-nav.scrolled {
  background-color: var(--color-navy);
  backdrop-filter: blur(8px);
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--color-white);
  opacity: 0.9;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: color var(--transition-base);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-white);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-white);
  border-radius: 1px;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1002;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.nav-overlay.visible {
  display: block;
}

/* Mobile menu */
.nav-mobile {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background-color: var(--color-navy);
  padding: 6rem 2rem 2rem;
  z-index: 1001;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.nav-mobile.open {
  right: 0;
}

.nav-mobile a {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.125rem;
  font-weight: 500;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: color var(--transition-base);
}

.nav-mobile a:hover,
.nav-mobile a.active {
  color: var(--color-white);
}

/* --- Scroll Progress Bar --- */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background-color: var(--color-blue);
  z-index: 1001;
  transition: width 0.05s linear;
}

/* --- Footer --- */
.site-footer {
  background-color: var(--color-navy);
  color: rgba(255, 255, 255, 0.85);
  padding: 4rem 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}

.footer-col h4 {
  color: var(--color-white);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-col p {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 0.25rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9375rem;
  transition: color var(--transition-base);
}

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

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  padding-top: 2rem;
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

/* --- Focus States (Accessibility) --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

.nav-links a:focus-visible,
.nav-mobile a:focus-visible,
.nav-logo:focus-visible {
  outline-color: var(--color-white);
}

/* --- Skip to Content --- */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 1100;
  background-color: var(--color-navy);
  color: var(--color-white);
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
  color: var(--color-white);
}

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

/* Spacer to offset fixed nav */
.nav-spacer {
  height: var(--nav-height);
}

/* Prevent horizontal overflow */
html, body {
  overflow-x: hidden;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  :root {
    --spacing-section: 4rem;
  }
}

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

  h2 {
    font-size: 1.5rem;
  }

  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  :root {
    --spacing-section: 3rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.875rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.125rem;
  }

  body {
    font-size: 1rem;
  }

  .section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-footer {
    padding: 3rem 1rem;
  }

  :root {
    --spacing-section: 2.5rem;
  }
}
