/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #111;
  background: #F5F5F5;
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* Variables */
:root {
  --primary: #D32F2F;
  --secondary: #2C2C2C;
  --accent: #FFD700;
  --bg-light: #F5F5F5;
  --bg-dark: #1A1A1A;
  --text-primary: #111;
  --text-secondary: #666;
  --border: #E0E0E0;
  --success: #4CAF50;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --container-max: 1200px;
  --header-height: 80px;
  --transition: 300ms ease-out;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
  transition: top 0.3s;
}
.skip-link:focus {
  top: 0;
}

/* Container */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--bg-dark);
  color: #fff;
  position: relative;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}
.site-brand {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--primary);
  text-transform: uppercase;
}
.site-brand .mono {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 400;
}
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  position: relative;
}
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: var(--transition);
}
.nav-toggle-icon {
  top: 50%;
  transform: translate(-50%, -50%);
}
.nav-toggle-icon::before {
  top: -8px;
}
.nav-toggle-icon::after {
  top: 8px;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0;
  transform: translate(-50%, -50%) rotate(-45deg);
}
.site-nav {
  display: flex;
  align-items: center;
}
.nav-list {
  display: flex;
  gap: 4px;
}
.nav-link {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ccc;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--accent);
}
.nav-link[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
@media (max-width: 768px) {
  .site-header {
    position: sticky;
    top: 0;
  }
  .nav-toggle {
    display: block;
  }
  .site-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-dark);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    flex-direction: column;
  }
  .site-nav[data-open] {
    max-height: 500px;
  }
  .nav-list {
    flex-direction: column;
    width: 100%;
    padding: 10px 0;
  }
  .nav-link {
    text-align: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
}

/* Progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  z-index: 999;
  width: 0%;
  transition: width 0.1s linear;
  will-change: width;
}
/* For no-js fallback, progress-bar will have 0 width */

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
  border: 1px solid var(--accent);
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--accent);
  color: var(--text-primary);
  transform: translateY(-3px);
}

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: #aaa;
  padding: 40px 0 20px;
  margin-top: 80px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
}
.footer-brand .footer-logo {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
}
.footer-tagline {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-link {
  color: #ccc;
  transition: color 0.3s;
}
.footer-link:hover {
  color: var(--accent);
}
.footer-contact p {
  margin-bottom: 6px;
}
.footer-contact a {
  color: var(--accent);
}
.footer-icp {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 13px;
  display: flex;
  justify-content: center;
  gap: 20px;
}
@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-links {
    align-items: center;
  }
  .footer-icp {
    flex-direction: column;
    gap: 5px;
  }
}

/* Utility */
.mono {
  font-family: var(--font-mono);
}
.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--accent);
  transition: var(--transition);
  font-size: 14px;
}
.btn:hover {
  background: var(--accent);
  color: var(--text-primary);
}
.section-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--secondary);
  margin-bottom: 20px;
  border-bottom: 3px solid var(--primary);
  padding-bottom: 10px;
  display: inline-block;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 24px;
  transition: var(--transition);
}
.card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-4px);
  border-color: var(--primary);
}
@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}
