/* =============================================
   THEME — shared dark chrome for the whole site.
   Provides design tokens, base body, navbar, footer,
   and core button/typography utilities.
   Page-specific styles go in inline <style> blocks
   on the page itself.
============================================= */

:root {
  /* Backgrounds */
  --bg-void:       #0a0a0f;
  --bg-deep:       #0d0d14;
  --bg-base:       #12121a;
  --bg-surface:    #1a1a2e;
  --bg-card:       #16162a;
  --bg-card-hover: #1e1e38;
  --bg-glass:      rgba(22, 22, 42, 0.6);

  /* Threat color language */
  --red:           #ef4444;
  --red-bright:    #ff3b30;
  --red-glow:      rgba(239, 68, 68, 0.25);
  --green:         #22c55e;
  --green-bright:  #34d399;
  --green-glow:    rgba(34, 197, 94, 0.25);
  --amber:         #f59e0b;
  --amber-bright:  #fbbf24;
  --amber-glow:    rgba(245, 158, 11, 0.25);
  --cyan:          #06b6d4;
  --cyan-bright:   #22d3ee;
  --cyan-glow:     rgba(6, 182, 212, 0.25);
  --purple:        #a855f7;
  --purple-glow:   rgba(168, 85, 247, 0.25);
  --orange:        #f97316;
  --orange-glow:   rgba(249, 115, 22, 0.25);
  --blue:          #3b82f6;
  --blue-glow:     rgba(59, 130, 246, 0.25);

  /* Text */
  --text-primary:   #f0f0f8;
  --text-secondary: #8888aa;
  --text-muted:     #4a4a6a;
  --text-code:      #22d3ee;

  /* Borders */
  --border-subtle:  rgba(255,255,255,0.06);
  --border-mid:     rgba(255,255,255,0.1);

  /* Fonts */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-void);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* =============================================
   NAVIGATION
============================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition), border-color var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.92);
  border-bottom-color: var(--border-mid);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.nav-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.nav-logo-text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex: 1;
}

.nav-links a {
  display: block;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border-subtle);
  gap: 4px;
}

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

.nav-mobile a {
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all var(--transition);
}

.nav-mobile a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

/* Spacer below fixed navbar so page content isn't hidden under it */
.nav-spacer {
  height: 64px;
}

/* =============================================
   BUTTONS
============================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--red);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary:hover {
  background: #dc2626;
  box-shadow: 0 4px 24px rgba(239,68,68,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

/* =============================================
   SECTION SHARED STYLES
============================================= */
.section-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--cyan-bright);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.section-sub {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* =============================================
   PAGE HEADER (used on secondary pages)
============================================= */
.page-header {
  padding: 80px 24px 40px;
  text-align: center;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-subtle);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.page-header p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.65;
}

/* =============================================
   FOOTER
============================================= */
footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border-subtle);
  padding: 72px 24px 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.footer-brand-text {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-about-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

.footer-github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-github-link:hover {
  color: var(--text-primary);
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-bottom-links a:hover {
  color: var(--text-secondary);
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 40px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header {
    padding: 56px 20px 32px;
  }
}

/* =============================================
   ACCESSIBILITY
============================================= */

/* Visible focus for keyboard navigation */
:focus-visible {
  outline: 2px solid #06b6d4;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Remove focus ring for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

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