/*
 * Ferrox-RC Aerospace Landing & Documentation System
 * Custom aerodynamic product presentation with clean dark engineering foundations.
 * 
 * Fonts:
 * - Display / Serif Headlines: Playfair Display
 * - Modern Tech Sans: Space Grotesk / Inter
 * - Telemetry Monospace: JetBrains Mono
 */

:root {
  /* Aerospace Dark Canvas & Tones */
  --bg: #090B10;
  --bg-card: #0E1219;
  --bg-subtle: #141A24;
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-hover: rgba(0, 229, 255, 0.35);
  
  --text: #F3F4F6;
  --text-muted: #8E9BAE;
  --text-dim: #5A6677;

  /* Accents */
  --accent-rust: #E05A47;       /* Ferrox signature brand */
  --accent-rust-glow: rgba(224, 90, 71, 0.28);
  --accent-cyan: #00E5FF;       /* Telemetry & RF data stream */
  --accent-cyan-glow: rgba(0, 229, 255, 0.22);
  --accent-green: #00E676;      /* Deterministic status / 45% flash free */
  --accent-amber: #FFAB00;      /* Warning */

  --shadow-card: 0 20px 45px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 35px rgba(0, 229, 255, 0.12);
}

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

img, svg, canvas {
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Code & Telemetry Monospace Elements */
code, kbd, samp, pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-variant-numeric: tabular-nums;
}

/* Inline Code Element */
code {
  background: rgba(0, 229, 255, 0.08);
  color: #7ce3ff;
  border: 1px solid rgba(0, 229, 255, 0.22);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.88em;
  letter-spacing: -0.01em;
  word-break: break-word;
}

/* Rust Attribute Highlight Code Pill */
code.rust-attr {
  background: rgba(224, 90, 71, 0.12);
  color: #FFA08F;
  border: 1px solid rgba(224, 90, 71, 0.3);
  font-weight: 500;
  box-shadow: 0 0 10px rgba(224, 90, 71, 0.1);
}

/* Subtle aerospace ambient lighting */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 60vh;
  background: radial-gradient(circle at 50% 10%, rgba(0, 229, 255, 0.07), rgba(224, 90, 71, 0.04) 40%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

/* Container */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px);
  position: relative;
  z-index: 1;
}

/* Aerospace Navigation Bar */
.ferrox-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 11, 16, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-text span {
  color: var(--accent-rust);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.accent {
  color: var(--accent-cyan);
}

.nav-link.accent:hover {
  color: #FFFFFF;
  text-shadow: 0 0 12px var(--accent-cyan);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Mobile Hamburger Toggle */
.nav-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}

.nav-mobile-drawer {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 16px clamp(16px, 4vw, 24px) 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 11, 16, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  max-height: calc(100vh - 68px);
  overflow-y: auto;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
}

.nav-mobile-drawer.is-open {
  display: flex;
  animation: navSlideDown 0.2s ease forwards;
}

@keyframes navSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-mobile-drawer .nav-link {
  padding: 8px 0;
  font-size: 0.95rem;
}

/* Pill Buttons */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-pill.primary {
  background: #F3F4F6;
  color: #090B10;
}

.btn-pill.primary:hover {
  background: #FFFFFF;
  transform: scale(1.02);
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.18);
}

.btn-pill.rust {
  background: linear-gradient(135deg, #FF6F5B, var(--accent-rust));
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 18px var(--accent-rust-glow);
}

.btn-pill.rust:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(224, 90, 71, 0.45);
}

.btn-pill.outline {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-pill.outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-pill.cyan-glow {
  background: rgba(0, 229, 255, 0.06);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.btn-pill.cyan-glow:hover {
  background: rgba(0, 229, 255, 0.12);
  box-shadow: 0 0 20px var(--accent-cyan-glow);
  transform: translateY(-1px);
}

/* Typography Headings */
.eyebrow-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.editorial-headline {
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 6vw, 4.4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--text);
  word-break: break-word;
}

.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.65rem, 4.5vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  word-break: break-word;
}

.section-sub {
  color: var(--text-muted);
  font-size: clamp(0.95rem, 2.5vw, 1.08rem);
  max-width: 620px;
  margin: 0 auto 40px;
  line-height: 1.65;
}

/* Hero Section */
.hero-section {
  padding: clamp(36px, 6vw, 60px) 0 clamp(48px, 8vw, 80px);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(28px, 5vw, 48px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.hero-lead {
  font-size: clamp(0.98rem, 2.5vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 580px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 3vw, 32px);
  padding-top: 24px;
  border-top: 1px solid var(--border);
  width: 100%;
}

.metric-item .metric-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}

.metric-item .metric-num.cyan { color: var(--accent-cyan); }
.metric-item .metric-num.green { color: var(--accent-green); }
.metric-item .metric-num.rust { color: var(--accent-rust); }

.metric-item .metric-label {
  font-size: clamp(0.68rem, 1.8vw, 0.82rem);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
  line-height: 1.3;
}

/* Hero Visual / Telemetry Card */
.hero-visual-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: clamp(16px, 3vw, 24px);
  padding: clamp(16px, 3.5vw, 24px);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.hero-visual-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.4), transparent);
}

.hero-visual-card svg {
  width: 100%;
  height: auto;
  max-height: 150px;
}

/* Ferrox Avionics Card */
.ferrox-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: clamp(16px, 3vw, 24px);
  padding: clamp(18px, 4vw, 32px);
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  min-width: 0;
}

.ferrox-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.7), var(--shadow-glow);
}

/* Quote Callout */
.ferrox-quote {
  border-left: 2px solid var(--accent-rust);
  padding-left: 20px;
  margin: 24px 0;
}

.ferrox-quote p {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}

/* Technical Specification Rows */
.specs-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-top: 32px;
}

.spec-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}

.spec-row-item:last-child {
  border-bottom: none;
}

.spec-row-item:hover {
  background: rgba(255, 255, 255, 0.015);
}

.spec-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.spec-val-group {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

.spec-primary-val {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}

.spec-secondary-val {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Terminal & Code Snippet Box */
.terminal-clean {
  background: #06080C;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 14px;
}

.terminal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.terminal-body {
  padding: 12px 14px;
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.75rem, 2.2vw, 0.88rem);
  color: #E2E8F0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.terminal-body code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}

.btn-copy-clean {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 9999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-copy-clean:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Memory Progress Track */
.mem-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid var(--border-subtle);
}

.mem-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.8s ease;
}

/* Memory Comparison Box */
.mem-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: clamp(14px, 3.5vw, 18px);
  margin-bottom: 20px;
  min-width: 0;
}

.mem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.mem-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 4px;
}

.mem-row-primary {
  font-size: clamp(0.72rem, 2vw, 0.78rem);
}

.mem-row-secondary {
  font-size: clamp(0.68rem, 1.8vw, 0.75rem);
  color: var(--text-dim);
}

/* Canvas Curve Box */
.curve-box {
  background: #06080C;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  margin-top: 14px;
  overflow: hidden;
}

.curve-box canvas {
  width: 100%;
  max-width: 440px;
  height: auto;
  aspect-ratio: 440 / 180;
  display: block;
  margin: 0 auto;
  touch-action: none;
}

.spline-btn-group {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Responsive Grid Utilities */
.grid-2-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(18px, 3.5vw, 28px);
}

.grid-3-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: clamp(14px, 2.5vw, 18px);
}

/* Card Header Flex Helper */
.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

/* Methodology & Pair-Programming Disclaimer */
.method-disclaimer {
  padding: clamp(16px, 3.5vw, 22px) clamp(16px, 4vw, 24px);
  border-radius: 14px;
  background: rgba(0, 229, 255, 0.025);
  border: 1px solid rgba(0, 229, 255, 0.15);
  margin-top: 12px;
}

/* HUD Real-Time Telemetry Tickers */
.hud-ticker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.hud-ticker-item {
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  min-width: 0;
}

.hud-ticker-label {
  font-size: clamp(0.62rem, 1.8vw, 0.72rem);
  color: var(--text-dim);
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-ticker-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer */
.ferrox-footer {
  margin-top: clamp(60px, 10vw, 100px);
  padding: clamp(40px, 6vw, 60px) 0 40px;
  border-top: 1px solid var(--border);
  background: #06080C;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(24px, 4vw, 40px);
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s ease;
}

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

/* Responsive & Breakpoints */
@media (max-width: 1140px) {
  .nav-menu {
    gap: 16px;
  }
  .nav-link {
    font-size: 0.82rem;
  }
  .btn-pill {
    padding: 7px 14px;
    font-size: 0.8rem;
  }
}

@media (max-width: 980px) {
  .nav-menu, .nav-actions {
    display: none;
  }
  .nav-mobile-toggle {
    display: block;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

@media (max-width: 640px) {
  section {
    padding: clamp(44px, 8vw, 60px) 0 !important;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .spec-row-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 4px;
  }
  .spec-val-group {
    text-align: left;
  }
  .hero-buttons {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }
  .hero-buttons .btn-pill {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .spline-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .spline-btn-group .btn-pill {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.72rem;
  }
}

@media (max-width: 380px) {
  .hero-metrics {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hud-ticker-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
