/* ===== BASE ===== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', Arial, sans-serif;
}

body {
  overflow-x: hidden;
  background: #fff;
  color: #111;
}

/* shared container */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* section headers with enhanced animation */
main section h2 {
  position: relative;
}

main section:not(.subsystem-hero) h2::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  background: linear-gradient(90deg, #b60002, #e60004);
  margin-top: 12px;
  animation: expandUnderline 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(182, 0, 2, 0.3);
}

@keyframes expandUnderline {
  from {
    width: 0;
    opacity: 0;
  }

  to {
    width: 42px;
    opacity: 1;
  }
}

/* ===== SUBSYSTEM HERO ===== */

.subsystem-hero {
  position: relative;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #fff;
  padding: clamp(100px, 12vw, 140px) 6%;
  overflow: hidden;
}

/* animated vertical engineering anchor */
.subsystem-hero::before {
  content: "";
  position: absolute;
  left: 6%;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 160px;
  background: linear-gradient(180deg, transparent, #b60002, #e60004, transparent);
  box-shadow: 0 0 20px rgba(182, 0, 2, 0.6);
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 0.7;
    box-shadow: 0 0 20px rgba(182, 0, 2, 0.6);
  }

  50% {
    opacity: 1;
    box-shadow: 0 0 30px rgba(230, 0, 4, 0.8);
  }
}

/* enhanced technical grid with racing stripe accent */
.subsystem-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  opacity: 0.5;
}

/* inner content */
.subsystem-hero-inner {
  max-width: 1100px;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* eyebrow with racing accent */
.subsystem-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b60002;
  margin-bottom: 14px;
  font-weight: 600;
  position: relative;
  display: inline-block;
  padding-left: 20px;
}

.subsystem-eyebrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 2px;
  background: #b60002;
}

/* title with gradient */
.subsystem-hero h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* description */
.subsystem-tagline {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 640px;
  color: rgba(255, 255, 255, 0.88);
}

/* enhanced metrics display */
.subsystem-metric {
  margin-top: 32px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  display: inline-block;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #b60002;
  backdrop-filter: blur(10px);
}

.subsystem-metric span {
  font-weight: 700;
  color: #fff;
  font-size: 1.1em;
}

/* ===== HERO RESPONSIVE ===== */

@media (max-width: 768px) {
  .subsystem-hero {
    padding: 90px 20px;
  }

  .subsystem-hero::before {
    display: none;
  }

  .subsystem-hero-inner {
    max-width: 100%;
  }

  .subsystem-hero h1 {
    background: #ffffff;
    -webkit-text-fill-color: #ffffff;
  }
}

/* ===== SECTION BASE ===== */

main section {
  padding: clamp(70px, 8vw, 100px) 6%;
  position: relative;
  transition: background 0.3s ease;
}

main section:nth-of-type(even) {
  background: #fafafa;
}

main h2 {
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  margin-bottom: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

main p {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #444;
  max-width: 740px;
}

/* ===== RESPONSIBILITY / SCOPE ===== */

.scope-note {
  margin-top: 20px;
  font-size: 0.88rem;
  color: #666;
  max-width: 720px;
  border-left: 3px solid #e0e0e0;
  padding-left: 18px;
}

.scope-list {
  margin-top: 28px;
  list-style: none;
  padding-left: 0;
}

.scope-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  color: #333;
  transition: transform 0.2s ease, color 0.2s ease;
}

.scope-list li:hover {
  transform: translateX(4px);
  color: #b60002;
}

.scope-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 10px;
  height: 2px;
  background: linear-gradient(90deg, #b60002, #e60004);
  transition: width 0.2s ease;
}

.scope-list li:hover::before {
  width: 14px;
}

/* ===== ARCHITECTURE ===== */

.subsystem-architecture p {
  margin-bottom: 16px;
}

/* ===== TESTING ===== */

.testing-stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 42px;
}

.testing-stage {
  background: #fff;
  border: 2px solid #000;
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.testing-stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #b60002, #e60004);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.testing-stage:hover {
  transform: translateY(-8px);
  background: #000;
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.testing-stage:hover::before {
  transform: translateX(0);
}

.testing-stage h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
  font-weight: 700;
}

.testing-stage p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: inherit;
  opacity: 0.9;
}

.testing-stage:hover p {
  opacity: 0.95;
}

/* ===== TOOLS ===== */

.tools-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 70px;
  align-items: center;
}

.tools-list {
  list-style: none;
  padding-left: 0;
  margin-top: 26px;
}

.tools-list li {
  font-size: 0.92rem;
  margin-bottom: 14px;
  color: #333;
  padding-left: 20px;
  position: relative;
  transition: all 0.2s ease;
}

.tools-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #b60002;
  font-size: 0.85em;
  transition: transform 0.2s ease;
}

.tools-list li:hover {
  color: #b60002;
  transform: translateX(4px);
}

.tools-list li:hover::before {
  transform: translateX(3px);
}

/* ===== TOOLS VISUAL ===== */

.tools-visual {
  position: relative;
  height: 280px;
  perspective: 1400px;
}

.tool-card {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  transform: rotateY(-32deg) scale(0.94);

  transition:
    opacity 0.7s ease,
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.tool-card.active {
  opacity: 1;
  transform: rotateY(-32deg) scale(1);
}

.tool-card img {
  max-height: 320px;
  max-width: 540px;
  object-fit: contain;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.35));
  transition: filter 0.3s ease;
}

.tool-card:hover img {
  filter: drop-shadow(0 35px 60px rgba(182, 0, 2, 0.25));
}

/* ===== OUTCOMES ===== */

.subsystem-outcomes {
  background: linear-gradient(135deg, #b60002 0%, #8b0001 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.subsystem-outcomes::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.subsystem-outcomes h2 {
  color: #111;
}

.subsystem-outcomes h2::after {
  background: rgba(0, 0, 0, 0.9);
  box-shadow: 0 2px 12px rgba(255, 255, 255, 0.4);
}

.subsystem-outcomes p {
  color: rgba(0, 0, 0, 0.92);
}

.outcomes-list {
  list-style: none;
  padding-left: 0;
  margin-top: 28px;
}

.outcomes-list li {
  font-size: 0.92rem;
  margin-bottom: 14px;
  color: rgba(0, 0, 0, 0.95);
  padding-left: 24px;
  position: relative;
  transition: all 0.2s ease;
}

.outcomes-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.9);
  transition: transform 0.2s ease;
}

.outcomes-list li:hover {
  transform: translateX(4px);
  color: #b60002;
}

.outcomes-list li:hover::before {
  transform: scale(1.2);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1100px) {
  .testing-stages {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  main section {
    padding: 64px 20px;
  }

  .testing-stages {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .testing-stage {
    padding: 24px;
  }
}

/* ===== TOOLS RESPONSIVE ===== */

@media (max-width: 900px) {
  .tools-layout {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .tools-visual {
    height: 220px;
    margin: 0 auto;
  }

  .tool-card,
  .tool-card.active {
    transform: none;
  }

  .tool-card img {
    max-width: 340px;
    max-height: 200px;
  }
}

/* ===== ADDITIONAL PROFESSIONAL TOUCHES ===== */

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Selection color matching brand */
::selection {
  background: #b60002;
  color: #fff;
}

::-moz-selection {
  background: #b60002;
  color: #fff;
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid #b60002;
  outline-offset: 3px;
}

/* Subtle fade-in for sections on scroll */
@media (prefers-reduced-motion: no-preference) {
  main section {
    animation: fadeIn 0.6s ease-out;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}