/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Roboto', 'Noto Sans SC', system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: #1A1A1A;
  background-color: #FFFFFF;
}
:focus-visible { outline: 3px solid #FF6B35; outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { border: none; background: none; cursor: pointer; font: inherit; }

:root {
  --color-bg: #FFFFFF;
  --color-bg-secondary: #F0F2F5;
  --color-bg-dark: #1A1A1A;
  --color-brand: #FF6B35;
  --color-blue: #004E8C;
  --color-green: #00CC66;
  --color-text: #1A1A1A;
  --color-text-secondary: #666666;
  --color-border: #333333;
  --shadow-strong: 8px 8px 0 rgba(0,0,0,0.15);
  --shadow-hover: 12px 12px 0 rgba(0,0,0,0.2);
  --border-thick: 3px solid var(--color-border);
  --font-heading: 800 1.8rem/1.1 'Inter','Roboto','Noto Sans SC',sans-serif;
  --font-mono: 'JetBrains Mono','SF Mono',monospace;
  --spacing-sm: 0.75rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 3rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 0;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: #FF6B35;
  color: #fff;
  font-weight: 600;
}
.skip-link:focus {
  top: 0;
}

/* Header */
.site-header {
  position: relative;
  background: var(--color-bg);
  border-bottom: var(--border-thick);
  box-shadow: var(--shadow-strong);
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--spacing-sm) var(--spacing-md);
  min-height: 60px;
}
.search-wrapper {
  display: flex;
  align-items: center;
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  padding: 0.25rem 0.75rem;
  border-radius: 0;
  max-width: 300px;
  flex: 1;
  margin-right: var(--spacing-md);
}
.search-icon { margin-right: 0.5rem; font-size: 1rem; }
.search-input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
  color: var(--color-text);
}
.search-input:focus { outline: none; }
.header-brand {
  font: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-brand);
  white-space: nowrap;
  margin-right: auto;
}
.nav-toggle {
  display: none; /* hidden on desktop */
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem;
  background: var(--color-brand);
  border: 2px solid var(--color-border);
}
.hamburger-line {
  display: block;
  width: 24px;
  height: 3px;
  background: #fff;
  transition: transform 0.2s;
}
/* Desktop side nav */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: var(--color-bg-dark);
  color: #fff;
  padding: 2rem 1.5rem;
  z-index: 1000;
  transform: translateX(0);
  transition: transform 0.3s ease;
  border-right: var(--border-thick);
  box-shadow: 4px 0 12px rgba(0,0,0,0.3);
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 3rem;
}
.nav-list a {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: #ccc;
  border: 2px solid transparent;
  transition: all 0.15s;
}
.nav-list a:hover,
.nav-list a:focus-visible {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-color: var(--color-brand);
}
.nav-list a[aria-current="page"] {
  color: var(--color-brand);
  border-left: 4px solid var(--color-brand);
  background: rgba(255,107,53,0.15);
  font-weight: 700;
}
/* Mobile bottom nav */
.mobile-bottom-nav {
  display: none; /* hidden on desktop */
}
/* Responsive */
@media (max-width: 1023px) {
  .site-header {
    border-bottom: none;
    box-shadow: none;
  }
  .site-nav {
    transform: translateX(-100%);
    width: 280px;
    z-index: 999;
  }
  .site-nav[data-open] {
    transform: translateX(0);
  }
  .nav-toggle {
    display: flex;
    margin-left: auto;
  }
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-top: 3px solid var(--color-brand);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    z-index: 900;
    justify-content: space-around;
    padding: 0.5rem 0;
  }
  .bottom-nav-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    border: none;
    background: transparent;
    transition: color 0.15s;
  }
  .bottom-nav-item.active,
  .bottom-nav-item[aria-current="page"] {
    color: var(--color-brand);
  }
  .bottom-nav-item:hover { color: var(--color-text); }
  .more-btn { cursor: pointer; }
  /* adjust header inner padding for mobile */
  .header-inner {
    padding: 0.5rem 1rem;
    min-height: 48px;
  }
  .search-wrapper {
    max-width: 180px;
  }
  .header-brand {
    font-size: 1.2rem;
    margin-right: 0;
  }
  body { padding-bottom: 60px; } /* avoid bottom nav overlap */
}
@media (min-width: 1024px) {
  .site-header {
    padding-left: 270px; /* make room for side nav */
  }
}
/* Footer */
.site-footer {
  background: var(--color-bg-dark);
  color: #fff;
  border-top: var(--border-thick);
  padding: var(--spacing-lg) var(--spacing-md);
  margin-top: var(--spacing-lg);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.footer-brand {
  font: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-brand);
}
.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: 0.95rem;
  color: #aaa;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: #fff;
  border-bottom-color: var(--color-brand);
}
.footer-copy {
  font-size: 0.85rem;
  color: #999;
  line-height: 1.6;
}
.footer-copy a {
  color: var(--color-green);
  text-decoration: underline;
}
.scroll-top {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: var(--color-brand);
  color: #fff;
  border: 2px solid var(--color-border);
  padding: 0.75rem 1rem;
  font-weight: 700;
  box-shadow: var(--shadow-strong);
  transition: opacity 0.3s;
  z-index: 500;
}
.scroll-top:not([hidden]) { opacity: 1; }
.scroll-top[hidden] { display: none; }
.scroll-top:hover { box-shadow: var(--shadow-hover); }

/* Common utility classes */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--spacing-md); }
.mono-index { font-family: var(--font-mono); font-weight: 400; color: var(--color-brand); }
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  font-size: 0.8rem;
  font-weight: 600;
}
.card {
  background: var(--color-bg);
  border: var(--border-thick);
  box-shadow: var(--shadow-strong);
  padding: var(--spacing-md);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-hover); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
}
.breadcrumb {
  display: flex;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  padding: 0.5rem 0;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span::before { content: '/'; margin-right: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* Print */
@media print {
  .site-nav, .mobile-bottom-nav, .scroll-top, .nav-toggle { display: none; }
  .site-header { padding-left: 0; }
}
