/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg:        #070a0d;
  --bg-panel:  #0d1216;
  --bg-raised: #11171c;
  --line:      #232b30;
  --line-soft: #1a2125;
  --ink:       #e8e4d9;
  --ink-dim:   #9aa3a8;
  --ink-faint: #5e686d;
  --accent:    #ff5a1f;
  --accent-dim:#c2461a;
  --cool:      #5fb8d6;
  --cool-dim:  #3d7e93;

  --display: 'Oswald', sans-serif;
  --body:    'Inter', sans-serif;
  --mono:    'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

::selection { background: var(--accent); color: #0a0a0a; }

/* subtle grain overlay for an instrument-panel feel */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: 0.025; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ============================================================
   NAV
   ============================================================ */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(7,10,13,0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topnav-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
}
.brand {
  font-family: var(--display); font-weight: 600; letter-spacing: 0.08em;
  font-size: 0.92rem; color: var(--ink);
}
.brand-dot { color: var(--accent); margin: 0 2px; }
.navlinks { display: flex; align-items: center; gap: 28px; }
.navlinks a {
  text-decoration: none; color: var(--ink-dim); font-size: 0.85rem;
  font-weight: 500; letter-spacing: 0.01em;
  transition: color 0.2s ease;
}
.navlinks a:hover { color: var(--ink); }
.navlinks-cta {
  color: var(--accent) !important;
  border: 1px solid var(--accent-dim);
  padding: 7px 14px; border-radius: 3px;
}
.navlinks-cta:hover { background: var(--accent); color: #0a0a0a !important; }

@media (max-width: 760px) {
  .navlinks { gap: 14px; }
  .navlinks a:not(.navlinks-cta) { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 140px 32px 100px;
  overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0; z-index: 0;
}
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: 38% 50%;
  filter: saturate(1.1) brightness(0.62);
  transform: scale(1.04);
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(100deg, rgba(7,10,13,0.97) 0%, rgba(7,10,13,0.86) 32%, rgba(7,10,13,0.45) 62%, rgba(7,10,13,0.78) 100%),
    linear-gradient(to top, rgba(7,10,13,1) 0%, rgba(7,10,13,0.2) 38%, rgba(7,10,13,0.55) 100%);
}

.hero-content { position: relative; z-index: 2; max-width: 640px; }

.hud-readout {
  display: inline-flex; flex-direction: column; gap: 6px;
  border: 1px solid rgba(95,184,214,0.35);
  background: rgba(13,18,22,0.55);
  backdrop-filter: blur(6px);
  padding: 14px 18px;
  border-radius: 2px;
  margin-bottom: 28px;
}
.hud-row { display: flex; gap: 18px; align-items: baseline; justify-content: space-between; }
.hud-label {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em;
  color: var(--cool); opacity: 0.8;
}
.hud-value {
  font-family: var(--mono); font-size: 0.82rem; color: var(--ink);
  letter-spacing: 0.02em;
}

.eyebrow {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
  margin: 0 0 14px;
}
.eyebrow-light { color: var(--accent); }

.hero h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.04; letter-spacing: -0.01em;
  margin: 0 0 24px;
  color: var(--ink);
  text-wrap: balance;
}
.hero h1 .accent { color: var(--accent); }

.hero-sub {
  font-size: 1.05rem; color: var(--ink-dim);
  max-width: 540px; margin: 0 0 36px;
}

.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--body); font-weight: 600; font-size: 0.92rem;
  padding: 13px 24px; border-radius: 3px;
  text-decoration: none; transition: all 0.18s ease;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #0a0a0a; }
.btn-primary:hover { background: #ff7440; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-dim); background: rgba(255,255,255,0.03); }
.btn-wide { width: 100%; justify-content: center; margin-top: 22px; }

.scroll-cue {
  position: absolute; bottom: 36px; left: 32px; z-index: 2;
  display: flex; align-items: center; gap: 10px;
}
.scroll-cue span {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em;
  color: var(--ink-faint);
}
.scroll-line { width: 1px; height: 32px; background: var(--ink-faint); position: relative; overflow: hidden; }
.scroll-line::after {
  content: ''; position: absolute; top: -100%; left: 0; width: 100%; height: 100%;
  background: var(--accent);
  animation: scrolldrop 1.8s ease-in-out infinite;
}
@keyframes scrolldrop {
  0% { top: -100%; } 60% { top: 100%; } 100% { top: 100%; }
}

/* ============================================================
   FACT STRIP
   ============================================================ */
.factstrip {
  display: flex; flex-wrap: wrap;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  background: var(--bg-panel);
}
.fact {
  flex: 1 1 180px;
  padding: 28px 24px;
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; align-items: flex-start;
}
.fact:last-child { border-right: none; }
.fact-num {
  font-family: var(--mono); font-size: 1.9rem; font-weight: 600; color: var(--ink);
  line-height: 1;
}
.fact-unit { font-family: var(--mono); font-size: 0.95rem; color: var(--accent); margin-left: 2px;}
.fact-label {
  font-size: 0.78rem; color: var(--ink-faint); margin-top: 8px;
  letter-spacing: 0.02em;
}

/* ============================================================
   SECTIONS (general)
   ============================================================ */
.section { padding: 110px 32px; max-width: 1240px; margin: 0 auto; }
.section-dark { background: var(--bg-panel); max-width: none; }
.section-dark > * { max-width: 1240px; margin-left: auto; margin-right: auto; }

.section-head { max-width: 680px; margin-bottom: 56px; }
.section-head h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.12; margin: 0 0 18px; color: var(--ink);
}
.section-head h2 em { color: var(--accent); font-style: normal; }
.section-sub { color: var(--ink-dim); font-size: 1rem; max-width: 580px; }

/* ============================================================
   VEHICLE SECTION
   ============================================================ */
.vehicle-grid {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start;
}
@media (max-width: 860px) { .vehicle-grid { grid-template-columns: 1fr; } }

.vehicle-image { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.vehicle-image img { width: 100%; }
.img-caption {
  display: block; padding: 12px 16px; font-size: 0.78rem;
  color: var(--ink-faint); background: var(--bg-panel);
  font-family: var(--mono); border-top: 1px solid var(--line-soft);
}

.spec-table { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.spec-row {
  display: flex; justify-content: space-between; padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.88rem;
}
.spec-row:last-child { border-bottom: none; }
.spec-k { color: var(--ink-faint); }
.spec-v { font-family: var(--mono); color: var(--ink); text-align: right; }

/* ============================================================
   SHOCK PHYSICS (signature section)
   ============================================================ */
.shock-toggle {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 4px; margin-bottom: 36px;
}
.toggle-btn {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em;
  background: transparent; border: none; color: var(--ink-dim);
  padding: 10px 18px; border-radius: 3px; cursor: pointer;
  transition: all 0.18s ease;
}
.toggle-btn.active { background: var(--accent); color: #0a0a0a; }
.toggle-btn:not(.active):hover { color: var(--ink); }

.shock-stage {
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, #0a0e12, #0d1318);
  padding: 8px 8px 0;
  margin-bottom: 8px;
}
#shock-svg { width: 100%; height: auto; display: block; }

#ramp-body { fill: #181f24; stroke: var(--line); stroke-width: 1.5; }
.flow-line {
  stroke: var(--cool); stroke-width: 1.4; opacity: 0.55;
  stroke-dasharray: 6 5;
  animation: flowdash 1.4s linear infinite;
}
@keyframes flowdash { to { stroke-dashoffset: -22; } }

.shock-line {
  stroke: var(--accent); stroke-width: 2; fill: none;
  filter: drop-shadow(0 0 4px rgba(255,90,31,0.5));
}
.ramp-label {
  font-family: var(--mono); font-size: 13px; fill: var(--ink);
}
.ramp-label-deg { fill: var(--accent); font-weight: 700; }
.station-label {
  font-family: var(--mono); font-size: 12px; fill: var(--ink-dim);
}
.station-mach {
  font-family: var(--mono); font-size: 15px; fill: var(--ink); font-weight: 700;
}

.shock-readout-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  margin-bottom: 64px; border-radius: 4px; overflow: hidden;
}
@media (max-width: 760px) { .shock-readout-grid { grid-template-columns: repeat(2, 1fr); } }
.readout-cell {
  background: var(--bg-raised); padding: 18px 16px;
}
.readout-cell-label {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  color: var(--ink-faint); text-transform: uppercase; display: block; margin-bottom: 8px;
}
.readout-cell-value {
  font-family: var(--mono); font-size: 1.3rem; color: var(--ink); font-weight: 600;
}
.readout-cell-value .unit { font-size: 0.85rem; color: var(--ink-faint); margin-left: 3px; }

.charts-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
@media (max-width: 860px) { .charts-row { grid-template-columns: 1fr; } }

.chart-card {
  margin: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  background: var(--bg-raised);
}
.chart-card img { width: 100%; }
.chart-card figcaption {
  padding: 12px 16px; font-size: 0.78rem; color: var(--ink-faint);
  font-family: var(--mono); border-top: 1px solid var(--line-soft);
}
.chart-card-data { display: flex; align-items: center; padding: 28px; }
.data-callout-label {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--cool); display: block; margin-bottom: 20px;
}
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bar-tag { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-dim); width: 28px; }
.bar-track { flex: 1; height: 10px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 2px; animation: barfill 1.4s ease-out forwards; animation-delay: 0.3s; }
.bar-fill-m7 { background: var(--cool); }
.bar-fill-m10 { background: var(--accent); }
@keyframes barfill { to { width: var(--pct); } }
.bar-val { font-family: var(--mono); font-size: 0.82rem; color: var(--ink); width: 100px; text-align: right; }
.data-callout-note { font-size: 0.86rem; color: var(--ink-dim); margin-top: 18px; line-height: 1.55; }

/* ============================================================
   NOZZLE SECTION
   ============================================================ */
.nozzle-panel {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  border: 1px solid var(--line); border-radius: 6px; padding: 48px;
  background: linear-gradient(160deg, var(--bg-raised), var(--bg-panel));
}
@media (max-width: 860px) { .nozzle-panel { grid-template-columns: 1fr; padding: 32px 24px; } }

.nozzle-visual { position: relative; }
#nozzle-svg { width: 100%; height: auto; }
#nozzle-top, #nozzle-bottom {
  fill: none; stroke: var(--ink-faint); stroke-width: 2;
}
.nozzle-flow-line {
  stroke: var(--accent); stroke-width: 1.6; fill: none; opacity: 0.8;
  stroke-dasharray: 5 5;
  animation: flowdash 1s linear infinite;
}
.nozzle-tags {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.nozzle-text p { color: var(--ink-dim); font-size: 0.98rem; margin: 0; }

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-grid {
  display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: auto auto; gap: 20px;
}
.gallery-wide { grid-column: 1; grid-row: 1 / span 2; }
@media (max-width: 860px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-wide { grid-column: 1; grid-row: auto; }
}
.gallery-item {
  margin: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  background: var(--bg-raised);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-wide img { aspect-ratio: 16/10.2; }
.gallery-item:not(.gallery-wide) img { aspect-ratio: 16/10; }
.gallery-item figcaption {
  padding: 12px 16px; font-size: 0.78rem; color: var(--ink-faint);
  font-family: var(--mono); border-top: 1px solid var(--line-soft);
}

/* ============================================================
   NOTEBOOKS CTA
   ============================================================ */
.notebooks-cta {
  padding: 110px 32px; text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,90,31,0.08), transparent 60%), var(--bg);
  border-top: 1px solid var(--line-soft);
}
.notebooks-inner { max-width: 880px; margin: 0 auto; }
.notebooks-cta h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 14px; color: var(--ink);
}
.notebooks-sub { color: var(--ink-dim); margin-bottom: 48px; }
.notebooks-sub code {
  font-family: var(--mono); background: var(--bg-raised); padding: 2px 8px;
  border-radius: 3px; color: var(--cool); font-size: 0.88em;
}

.notebook-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px; text-align: left;
}
@media (max-width: 760px) { .notebook-cards { grid-template-columns: 1fr; } }

.notebook-card {
  display: block; text-decoration: none;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 30px; background: var(--bg-raised);
  transition: all 0.22s ease; position: relative; overflow: hidden;
}
.notebook-card:hover {
  border-color: var(--accent-dim); transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(255,90,31,0.12);
}
.notebook-card-tag {
  font-family: var(--mono); font-size: 0.74rem; color: var(--accent);
  letter-spacing: 0.1em; display: block; margin-bottom: 14px;
}
.notebook-card h3 {
  font-family: var(--display); font-weight: 500; font-size: 1.25rem;
  margin: 0 0 10px; color: var(--ink);
}
.notebook-card p { color: var(--ink-dim); font-size: 0.88rem; margin: 0 0 20px; line-height: 1.55; }
.notebook-card-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink);
  letter-spacing: 0.02em;
}
.notebook-card:hover .notebook-card-cta { color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 32px; text-align: center;
  font-family: var(--mono); font-size: 0.74rem; color: var(--ink-faint);
  border-top: 1px solid var(--line-soft);
}
