@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --ink: #f2f4e9;
  --muted: #8f9a90;
  --muted-2: #647168;
  --bg: #07110d;
  --panel: #0b1812;
  --panel-2: #101f18;
  --line: rgba(224, 240, 226, 0.12);
  --lime: #d4ff42;
  --lime-soft: rgba(212, 255, 66, 0.12);
  --orange: #ff7448;
  --blue: #7ad7ff;
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 84% 12%, rgba(53, 94, 67, 0.13), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.topbar {
  height: 72px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand > span:last-child span { color: var(--lime); }
.brand-mark {
  width: 31px;
  height: 31px;
  border: 1px solid var(--lime);
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.brand-mark span {
  width: 13px;
  height: 13px;
  border: 2px dotted var(--lime);
  border-radius: 50%;
}

.top-status {
  font: 11px var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  width: 6px;
  height: 6px;
  background: var(--lime);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--lime);
}

main, footer { width: min(1500px, 100%); margin: 0 auto; }

.hero {
  padding: clamp(54px, 8vw, 118px) clamp(20px, 4vw, 64px) clamp(48px, 7vw, 98px);
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.6fr);
  align-items: end;
  gap: 48px;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--lime);
  font: 500 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  font-size: clamp(46px, 7.3vw, 112px);
  line-height: 0.93;
  letter-spacing: -0.075em;
  font-weight: 500;
}
h1 em {
  color: var(--lime);
  font-style: normal;
  font-weight: 400;
}
.hero-copy {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.65;
  max-width: 410px;
}

.workspace {
  margin: 0 clamp(12px, 2vw, 32px);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(320px, 0.34fr) minmax(0, 1fr);
  min-height: 780px;
  background: rgba(8, 20, 14, 0.78);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.28);
}

.control-panel {
  padding: 30px;
  border-right: 1px solid var(--line);
  background: rgba(7, 17, 13, 0.94);
}
.panel-heading, .visual-toolbar, .section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.panel-heading h2, .visual-toolbar h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}
.ghost-button {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 4px 0;
  font: 10px var(--mono);
  text-transform: uppercase;
  cursor: pointer;
}
.ghost-button:hover { color: var(--lime); }

.selection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 28px;
}
.select-field {
  display: block;
  border: 1px solid var(--line);
  padding: 12px 13px 9px;
}
.select-field > span {
  display: block;
  color: var(--muted-2);
  font: 9px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
select {
  width: 100%;
  border: 0;
  padding: 5px 20px 0 0;
  color: var(--ink);
  background: transparent;
  outline: none;
  font-size: 13px;
}

.segmented, .view-switcher {
  display: flex;
  border: 1px solid var(--line);
}
.segmented { margin-top: 10px; }
.segmented button, .view-switcher button {
  flex: 1;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 10px;
  cursor: pointer;
  font: 10px var(--mono);
  text-transform: uppercase;
}
.segmented button:last-child, .view-switcher button:last-child { border-right: 0; }
.segmented button.active, .view-switcher button.active {
  background: var(--lime-soft);
  color: var(--lime);
}

.parameter-group { margin-top: 28px; }
.group-title {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  color: var(--muted-2);
  border-bottom: 1px solid var(--line);
  font: 9px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.range-control { padding: 15px 0 13px; border-bottom: 1px solid var(--line); }
.range-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 11px;
}
.range-heading label { font-size: 12px; color: #c7cec7; }
.range-value {
  display: flex;
  align-items: baseline;
  color: var(--lime);
  font: 500 16px var(--mono);
}
.range-value input {
  width: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: right;
  outline: none;
  font: inherit;
}
.range-value small { font-size: 9px; color: var(--muted); margin-left: 3px; }
.range-track { display: flex; align-items: center; gap: 10px; }
.range-track span { color: var(--muted-2); font: 8px var(--mono); min-width: 24px; }
.range-track span:last-child { text-align: right; }
input[type="range"] {
  width: 100%;
  height: 2px;
  appearance: none;
  background: linear-gradient(to right, var(--lime) var(--fill, 50%), rgba(255,255,255,.12) var(--fill, 50%));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lime);
  border: 3px solid #17241b;
  box-shadow: 0 0 0 1px var(--lime);
  cursor: grab;
}

.advanced { border-bottom: 1px solid var(--line); }
.advanced summary {
  list-style: none;
  padding: 17px 0;
  display: flex;
  justify-content: space-between;
  color: #bec7bf;
  font-size: 12px;
  cursor: pointer;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced[open] .summary-icon { transform: rotate(45deg); }
.summary-icon { color: var(--lime); transition: transform .2s ease; }

.strike-button {
  width: 100%;
  margin-top: 25px;
  padding: 18px 21px;
  border: 1px solid var(--lime);
  background: var(--lime);
  color: #07110d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 700 12px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.strike-button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(212,255,66,.14); }
.strike-button:active { transform: translateY(0); }
.strike-button:disabled { opacity: .55; cursor: wait; transform: none; }
.strike-icon { font-size: 20px; }
.shortcut { color: var(--muted-2); text-align: center; font: 9px var(--mono); margin: 11px 0 0; }
kbd { border: 1px solid var(--line); padding: 2px 5px; color: var(--muted); font: inherit; }

.visual-panel { min-width: 0; display: grid; grid-template-rows: auto minmax(450px, 1fr) 154px; }
.visual-toolbar { padding: 27px 30px 21px; border-bottom: 1px solid var(--line); }
.shot-title-row { display: flex; align-items: center; gap: 12px; }
.shot-badge {
  padding: 4px 7px;
  color: var(--muted);
  border: 1px solid var(--line);
  font: 8px var(--mono);
  letter-spacing: 0.08em;
}
.shot-badge.live { color: var(--lime); border-color: rgba(212,255,66,.45); }
.view-switcher { width: 190px; }

.canvas-wrap {
  position: relative;
  min-height: 450px;
  overflow: hidden;
  background: linear-gradient(180deg, #0d1b16 0%, #0a1a12 100%);
}
#flightCanvas { width: 100%; height: 100%; display: block; }
.canvas-readout {
  position: absolute;
  top: 24px;
  right: 26px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  pointer-events: none;
}
.canvas-readout span { font: 500 clamp(34px, 4vw, 58px) var(--mono); letter-spacing: -0.08em; }
.canvas-readout small { color: var(--lime); font: 9px var(--mono); }
.impact-callout {
  position: absolute;
  opacity: 0;
  left: 50%;
  bottom: 15%;
  transform: translate(-50%, 10px);
  display: grid;
  text-align: center;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.impact-callout.show { opacity: 1; transform: translate(-50%, 0); }
.impact-callout span { color: var(--orange); font: 9px var(--mono); letter-spacing: .1em; }
.impact-callout strong { font: 500 23px var(--mono); }
.impact-callout small { color: var(--muted); font: 8px var(--mono); }

.swing-strip {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  background: #08140f;
}
.swing-copy { min-width: 0; }
.swing-copy strong { display: block; font-size: 14px; margin-bottom: 4px; }
.swing-copy > span { color: var(--muted); font-size: 10px; }
#swingCanvas { width: 100%; height: 110px; display: block; }
.impact-data { display: grid; gap: 8px; font: 9px var(--mono); color: var(--muted); }
.impact-data span { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.impact-data strong { color: var(--ink); font-weight: 500; }

.results { padding: clamp(80px, 10vw, 145px) clamp(20px, 4vw, 64px); }
.section-heading { align-items: end; margin-bottom: 42px; }
.section-heading h2, .method h2 {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 64px);
  line-height: 1;
  letter-spacing: -0.06em;
  font-weight: 500;
}
.section-heading > p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
}
.metric {
  min-height: 138px;
  padding: 21px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric:nth-child(4n) { border-right: 0; }
.metric:nth-last-child(-n+4) { border-bottom: 0; }
.metric-label { display: flex; justify-content: space-between; color: var(--muted); font: 9px var(--mono); text-transform: uppercase; }
.metric-value { margin-top: 24px; font: 500 clamp(25px, 2.6vw, 39px) var(--mono); letter-spacing: -0.06em; }
.metric-value small { color: var(--lime); font-size: 9px; letter-spacing: 0; }
.metric-delta { margin-top: 5px; color: var(--muted-2); font: 8px var(--mono); }

.analysis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 28px; }
.insight-card { position: relative; background: var(--bg); padding: 29px; min-height: 220px; }
.card-index { position: absolute; right: 20px; top: 20px; color: var(--muted-2); font: 9px var(--mono); }
.insight-card h3 { margin: 34px 0 12px; font-size: 24px; letter-spacing: -0.045em; font-weight: 500; }
.insight-card > p:last-child { color: var(--muted); font-size: 12px; line-height: 1.65; margin: 0; max-width: 340px; }

.method {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 clamp(20px, 4vw, 64px);
  padding: clamp(62px, 8vw, 110px) 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10vw;
}
.method-copy > p { color: var(--muted); line-height: 1.75; font-size: 13px; }
.source-links { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 28px; }
.source-links a { color: var(--lime); text-decoration: none; border-bottom: 1px solid rgba(212,255,66,.25); font: 9px var(--mono); text-transform: uppercase; padding-bottom: 4px; }

footer {
  padding: 35px clamp(20px, 4vw, 64px) 55px;
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font: 9px var(--mono);
  text-transform: uppercase;
}

@media (max-width: 1000px) {
  .workspace { grid-template-columns: 330px minmax(0, 1fr); }
  .swing-strip { grid-template-columns: 125px 1fr; }
  .impact-data { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(4n) { border-right: 1px solid var(--line); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  .metric:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 760px) {
  .topbar { height: 62px; }
  .top-status span:last-child { display: none; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 52px; }
  h1 { font-size: clamp(48px, 15vw, 78px); }
  .workspace { display: block; margin: 0 8px; }
  .control-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 18px; }
  .visual-panel { grid-template-rows: auto 450px 140px; }
  .visual-toolbar { padding: 20px 18px 16px; align-items: end; }
  .view-switcher { width: 150px; }
  .swing-strip { padding: 14px 17px; grid-template-columns: 102px 1fr; gap: 5px; }
  .section-heading, .method { grid-template-columns: 1fr; display: grid; gap: 28px; }
  .section-heading { align-items: start; }
  .analysis-grid { grid-template-columns: 1fr; }
  .method { gap: 34px; }
}

@media (max-width: 480px) {
  .selection-grid { grid-template-columns: 1fr; }
  .visual-panel { grid-template-rows: auto 390px 130px; }
  .visual-toolbar { display: block; }
  .view-switcher { width: 100%; margin-top: 15px; }
  .canvas-readout { top: 18px; right: 17px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric, .metric:nth-child(4n), .metric:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
  .results { padding-left: 18px; padding-right: 18px; }
}

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