:root {
  --bg-canvas: #0b0b0d;
  --bg-surface: #17171c;
  --bg-surface-hover: #22222a;
  --text-primary: #f0f2f5;
  --text-muted: #c0c4cc;
  --accent-primary: #dc2626;
  --accent-secondary: #f59e0b;
  --border-subtle: #2d2d35;
  --border-line: #3f3f4a;
  --shadow-offset: 4px 4px 0px #dc2626;
  --shadow-dark: 4px 4px 0px #000000;
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --max-w: 1200px;
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  font-family: var(--font-base);
  background-color: var(--bg-canvas);
  color: var(--text-muted);
  line-height: 1.6;
  scroll-behavior: smooth;
}

body {
  overflow-wrap: anywhere;
  hyphens: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-canvas);
}

/* Base Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 4vw + 1rem, 3.25rem); }
h2 { font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.2rem); margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.2rem, 1.5vw + 0.3rem, 1.5rem); margin-bottom: 0.5rem; }
p { margin-bottom: 1.25rem; font-size: 1rem; }

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Matrix Overlay */
.matrix-bg {
  background-image: radial-gradient(var(--border-subtle) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Header & Nav */
.site-header {
  position: static;
  width: 100%;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  padding: 1.2rem 1.5rem;
}

.nav-container {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-insignia {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.4rem 0.2rem;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-primary);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.3rem;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  cursor: pointer;
}

/* Buttons */
.btn-crimson {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent-primary);
  color: #ffffff !important;
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--accent-primary);
  border-radius: 4px;
  box-shadow: var(--shadow-dark);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-crimson:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px #000000;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  box-shadow: 2px 2px 0 #000;
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
}

/* Container & Sections */
.main-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
  flex: 1;
}

.section-block {
  margin-bottom: 4.5rem;
}

.reading-wrap {
  max-width: 72ch;
  margin: 0 auto 3rem;
}

/* Hero Section */
.hero-frame {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 4rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: 4px;
  padding: 2.5rem;
  position: relative;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-meta-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin-bottom: 1rem;
  padding: 0.2rem 0.6rem;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid var(--accent-primary);
  border-radius: 4px;
}

.hero-image-wrap {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  aspect-ratio: 16/10;
}

.hero-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-stat-overlay {
  position: absolute;
  bottom: -15px;
  left: -15px;
  background: var(--bg-canvas);
  border: 1px solid var(--accent-primary);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-dark);
}

.hero-stat-overlay .stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-primary);
  line-height: 1;
}

.hero-stat-overlay .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Vertical Chapter Flow Layout */
.chapter-pathway {
  position: relative;
  padding-left: 2.5rem;
}

.chapter-pathway::before {
  content: "";
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: 14px;
  width: 2px;
  background: var(--border-line);
}

.chapter-node {
  position: relative;
  margin-bottom: 3.5rem;
}

.chapter-index {
  position: absolute;
  left: -2.5rem;
  top: 0;
  width: 30px;
  height: 30px;
  background: var(--bg-surface);
  border: 2px solid var(--accent-primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}

.chapter-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1.8rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  box-shadow: 4px 4px 0 #000;
}

.chapter-media {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  aspect-ratio: 4/3;
}

.chapter-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}

/* Spec Tables */
.table-scroll {
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-surface);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.spec-table th,
.spec-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.spec-table th {
  background: #111115;
  color: var(--text-primary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--accent-primary);
}

.spec-table tr:last-child td {
  border-bottom: none;
}

.spec-table tr:hover td {
  background: var(--bg-surface-hover);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.optical-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1.5rem;
  position: relative;
  box-shadow: 3px 3px 0 #000;
  display: flex;
  flex-direction: column;
}

.optical-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.card-img-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 1.2rem;
  border: 1px solid var(--border-subtle);
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spec-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0;
}

.spec-pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: #111115;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

/* Form Styles */
.form-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2rem;
  border-radius: 4px;
  box-shadow: var(--shadow-dark);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: #0f0f13;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: 4px;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

.form-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* Accordion FAQ */
.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-surface);
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-header {
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  color: var(--text-primary);
  user-select: none;
}

.faq-header:hover {
  background: var(--bg-surface-hover);
}

.faq-toggle {
  font-size: 1.2rem;
  color: var(--accent-primary);
}

.faq-body {
  padding: 0 1.5rem 1.2rem;
  display: none;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.faq-item.open .faq-body {
  display: block;
}

/* Footer */
.site-footer {
  background: #08080a;
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 1.5rem 2rem;
  font-size: 0.88rem;
  color: #8c9099;
}

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

.footer-brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
}

.footer-title {
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.2rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #8c9099;
}

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

.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
}

/* Responsive Rules */
@media (max-width: 900px) {
  .hero-frame {
    grid-template-columns: 1fr;
    padding: 1.8rem;
  }
  .chapter-card {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 65px;
    left: 0;
    right: 0;
    background: #111115;
    flex-direction: column;
    padding: 1.5rem;
    border-bottom: 2px solid var(--accent-primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    z-index: 100;
    align-items: flex-start;
  }
  .nav-links.open {
    display: flex;
  }
  .chapter-pathway {
    padding-left: 2rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

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