/* Design Tokens: The Matrix Core Configuration */
:root {
  --bg-dark: #050806; /* Raw terminal void */
  --bg-card: rgba(10, 20, 12, 0.85); /* Phosphor black */
  --bg-card-hover: rgba(15, 30, 18, 0.95);
  
  --color-primary: #00ff41; /* The Classic Matrix Green */
  --color-primary-glow: rgba(0, 255, 65, 0.25);
  
  --color-red: #ff3b30; /* System Warning / Veto Red */
  --color-red-glow: rgba(255, 59, 48, 0.25);
  
  --color-cyan: #00f0ff; /* Intercept Blue */
  --color-cyan-glow: rgba(0, 240, 255, 0.25);
  
  --text-main: #dcfce7; /* Light green tint text */
  --text-muted: #86efac; /* Muted phosphor */
  --text-dim: #166534; /* Dark shadow green */
  
  --font-sans: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace; /* Monospace is primary for terminal */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  
  --border-radius: 4px; /* Harder corners for retro computing */
  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Elements */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
}

body {
  overflow-x: hidden;
  position: relative;
}

/* CRT Scanlines Overlay */
body::before {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 999;
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
}

/* Screen Flicker Effect */
@keyframes flicker {
  0% { opacity: 0.97; }
  50% { opacity: 1; }
  100% { opacity: 0.98; }
}

body {
  animation: flicker 0.15s infinite;
}

/* Matrix Canvas Background */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  opacity: 0.15; /* Subdued rain background */
  pointer-events: none;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Layout Grids */
.grid {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
}

.grid-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--bg-dark);
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.6);
  background-color: #ffffff;
  border-color: #ffffff;
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid rgba(0, 255, 65, 0.4);
}

.btn-secondary:hover {
  background-color: rgba(0, 255, 65, 0.1);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px var(--color-primary-glow);
  transform: translateY(-2px);
}

/* Top Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background-color: rgba(5, 8, 6, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 255, 65, 0.2);
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
  color: var(--color-primary);
  text-shadow: 0 0 8px var(--color-primary-glow);
}

.nav-logo {
  height: 32px;
  width: 32px;
  filter: drop-shadow(0 0 5px var(--color-primary));
}

.nav-links {
  display: none;
  gap: 2rem;
}

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

.nav-links a {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.nav-links a:hover {
  color: var(--color-primary);
  text-shadow: 0 0 5px var(--color-primary-glow);
}

.nav-btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 180px 0 100px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 90vh;
}

.hero-glow {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 255, 65, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero-logo-container {
  margin-bottom: 2rem;
}

.hero-logo {
  height: 140px;
  width: 140px;
  filter: drop-shadow(0 0 15px var(--color-primary));
  animation: float 5s ease-in-out infinite;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2), 0 0 20px var(--color-primary-glow);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 4.5rem;
  }
}

.gradient-text {
  color: var(--color-primary);
  text-shadow: 0 0 15px var(--color-primary);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 2.5rem auto;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.1);
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.25rem;
  }
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

/* Sections & Headers */
section {
  padding: 100px 0;
  border-bottom: 1px solid rgba(0, 255, 65, 0.1);
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem auto;
}

.section-tag {
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 0.75rem;
  display: inline-block;
  text-shadow: 0 0 5px var(--color-primary-glow);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  color: #ffffff;
  text-shadow: 0 0 8px var(--color-primary-glow);
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Cards & Styling */
.card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid rgba(0, 255, 65, 0.2);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: 0 0 25px var(--color-primary-glow);
}

.card-dark {
  background-color: #030704;
  border: 1px solid rgba(0, 255, 65, 0.15);
}

.card-glass {
  background-color: rgba(5, 12, 7, 0.75);
  backdrop-filter: blur(12px);
}

.card-border-green {
  border-color: rgba(0, 255, 65, 0.4);
}

.card-border-green:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 25px var(--color-primary-glow);
}

.card-border-red {
  border-color: rgba(255, 59, 48, 0.4);
}

.card-border-red:hover {
  border-color: var(--color-red);
  box-shadow: 0 0 25px var(--color-red-glow);
}

.card-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 0px; /* Monospace square look */
  text-transform: uppercase;
}

.badge-red {
  background-color: rgba(255, 59, 48, 0.15);
  color: var(--color-red);
  border: 1px solid var(--color-red);
}

.badge-green {
  background-color: rgba(0, 255, 65, 0.15);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: #ffffff;
  text-shadow: 0 0 5px var(--color-primary-glow);
  text-transform: uppercase;
}

.no-padding {
  padding: 0 !important;
}

/* Comparison Lists */
.comparison-list {
  list-style: none;
}

.comparison-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.comparison-list li span {
  font-size: 1rem;
}

/* Steps (Architecture) */
.steps-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 3rem;
  border-color: rgba(0, 255, 65, 0.2);
}

@media (min-width: 992px) {
  .steps-container {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
  }
}

.step-item {
  position: relative;
  text-align: center;
}

.step-num {
  width: 48px;
  height: 48px;
  border-radius: 0px; /* Hard square edges */
  background-color: rgba(0, 255, 65, 0.05);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 10px var(--color-primary-glow);
}

.step-item h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.step-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Schema Config Code View */
.card-header-tab {
  background-color: #030604;
  height: 40px;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(0, 255, 65, 0.2);
}

.tab-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background-color: #ff3b30; }
.dot-yellow { background-color: #ffcc00; }
.dot-green { background-color: #00ff41; }

.tab-title {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-left: 0.75rem;
}

.code-block {
  padding: 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #a7f3d0;
  background-color: #010402;
}

/* Schema Features */
.schema-features {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
}

.feature-item {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.feature-icon {
  background-color: rgba(0, 255, 65, 0.03);
  border: 1px solid rgba(0, 255, 65, 0.2);
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.1);
}

.feature-item h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #ffffff;
}

.feature-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Terminal Simulator styling */
.terminal-wrapper {
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.15);
}

.terminal-header {
  background-color: #030604;
  height: 40px;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  position: relative;
  border-bottom: 1px solid rgba(0, 255, 65, 0.2);
}

.terminal-buttons {
  display: flex;
  gap: 0.5rem;
}

.t-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.btn-close { background-color: #ff3b30; }
.btn-min { background-color: #ffcc00; }
.btn-max { background-color: #00ff41; }

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 1.5rem;
  font-size: 0.85rem;
  min-height: 270px;
  line-height: 1.7;
  background-color: #010402;
}

.font-mono {
  font-family: var(--font-mono);
}

.t-prompt::before {
  content: "";
  color: var(--color-primary);
}

.t-typing {
  color: var(--text-main);
  border-right: 2px solid var(--color-primary);
  animation: blink 1s step-end infinite;
}

.t-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: var(--color-primary);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
}

.text-green { color: var(--color-primary); }
.text-cyan { color: var(--color-cyan); }
.text-dim { color: var(--text-dim); }

/* Footer */
.footer {
  border-top: 1px solid rgba(0, 255, 65, 0.25);
  background-color: #020403;
  padding: 4rem 0;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
  }
}

.footer-left {
  max-width: 350px;
}

.footer-logo {
  height: 48px;
  width: 48px;
  filter: drop-shadow(0 0 10px var(--color-primary));
  margin-bottom: 1rem;
}

.footer-left p {
  font-size: 0.85rem;
}

.footer-right {
  display: flex;
  gap: 4rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col h5 {
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.footer-col a {
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

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

/* Animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes blink {
  from, to { background-color: transparent; border-color: transparent; }
  50% { background-color: var(--color-primary); border-color: var(--color-primary); }
}
