@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Roboto:wght@300;400;500;700&display=swap");

:root {
  --bg: #000;
  --fg: #fff;
  --muted: #8d8d8d;
  --faint: #151515;
  --panel: #070707;
  --panel-2: #0d0d0d;
  --line: #242424;
  --accent: #b8ff36;
  --bad: #ff5c5c;
  --font-body: "Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Instrument Serif", "Times New Roman", Georgia, serif;
  color-scheme: dark;
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(184, 255, 54, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 255, 54, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 68%);
}

a {
  color: inherit;
}

.site-header,
main,
footer {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
  position: relative;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.brand,
nav a {
  text-decoration: none;
}

.brand {
  font-weight: 700;
  color: var(--accent);
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--accent);
}

.hero {
  min-height: calc(100vh - 220px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 74px 0 88px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
h1,
h2,
h3,
p {
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0;
  margin-bottom: 14px;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  max-width: 900px;
  font-size: clamp(48px, 9vw, 112px);
  line-height: 1.02;
}

.intro {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  margin-top: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--fg);
  padding: 7px 14px;
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
}

.button:hover,
button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.button.primary,
button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.button.primary:hover {
  color: #000;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.band {
  padding: 62px 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 700px;
  margin-bottom: 28px;
}

h2 {
  font-size: 36px;
  line-height: 1.15;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

article {
  background: var(--bg);
  min-height: 220px;
  padding: 22px;
}

h3 {
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 14px;
}

article p,
.split p {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 32px;
}

.inline-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--accent);
  text-decoration: none;
}

.text-link,
.inline-link:hover,
.text-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 38px;
  color: var(--muted);
  font-size: 12px;
}

.page-title {
  padding: 52px 0 30px;
}

.page-title h1 {
  font-size: clamp(34px, 6vw, 66px);
}

.hint {
  max-width: 820px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 16px;
}

strong {
  color: var(--accent);
}

.product-hero {
  min-height: calc(100vh - 140px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  align-items: center;
  gap: 34px;
  padding: 58px 0 72px;
  border-bottom: 1px solid var(--line);
}

.product-copy h1 {
  font-size: clamp(36px, 5.4vw, 68px);
  max-width: 760px;
}

.product-media {
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center bottom;
  display: block;
  border-radius: 8px;
}

.spec-list {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  margin: 0;
}

.spec-list div {
  display: grid;
  grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1fr);
  gap: 20px;
  min-height: 46px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.spec-list div:last-child {
  border-bottom: 0;
}

.spec-list dt,
.spec-list dd {
  margin: 0;
}

.spec-list dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.spec-list dd {
  color: var(--fg);
  font-size: 13px;
  font-weight: 400;
  text-align: right;
}

.product-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.product-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1.18;
  object-fit: cover;
  object-position: center bottom;
  display: block;
  background: #000;
}

.lab-slideshow {
  display: grid;
  gap: 12px;
}

.lab-viewport {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
  touch-action: pan-y;
}

.lab-track {
  display: flex;
  transform: translateX(calc(var(--slide-index, 0) * -100%));
  transition: transform 280ms ease;
}

.lab-slide {
  position: relative;
  flex: 0 0 100%;
  margin: 0;
  min-width: 0;
}

.lab-slide img {
  width: 100%;
  height: min(62vw, 620px);
  min-height: 340px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.lab-slide figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: min(520px, calc(100% - 28px));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--fg);
  font-size: 12px;
  line-height: 1.45;
  padding: 8px 10px;
}

.slide-button {
  position: absolute;
  top: 50%;
  width: 38px;
  min-height: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 24px;
  line-height: 1;
  padding: 0;
  transform: translateY(-50%);
}

.slide-prev {
  left: 14px;
}

.slide-next {
  right: 14px;
}

.slide-thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.slide-thumbs button {
  min-width: 0;
  height: auto;
  min-height: 0;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: #000;
  opacity: 0.58;
}

.slide-thumbs button.active {
  opacity: 1;
  border-color: var(--accent);
}

.slide-thumbs img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.use-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.download-card {
  display: flex;
  min-height: 270px;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  padding: 18px 20px 20px;
  text-decoration: none;
  min-width: 0;
}

.download-card > a,
.onshape-card {
  text-decoration: none;
}

.download-card > a {
  display: flex;
  min-height: 54px;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.onshape-card {
  justify-content: space-between;
}

.download-card:hover strong,
.download-card > a:hover strong {
  color: var(--accent);
}

.download-card span {
  color: var(--muted);
  font-size: 12px;
}

.download-card strong {
  color: var(--fg);
  font-size: 14px;
  font-weight: 400;
}

.viewer-canvas {
  height: 154px;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.viewer-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.viewer-status {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 1;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  font-size: 12px;
  padding: 3px 7px;
}

.viewer-status[data-ready="true"] {
  opacity: 0;
  color: var(--accent);
}

.onshape-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
}

.onshape-link:hover {
  text-decoration: underline;
}

.tags {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 12px;
}

.panel h2 {
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.row:last-child {
  margin-bottom: 0;
}

.info-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 11px;
}

code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 6px;
  color: var(--fg);
  font-family: inherit;
  font-size: 12px;
}

.status-pill.connected,
.status-pill.dfu {
  border-color: var(--accent);
  color: var(--accent);
}

.status-pill.error {
  border-color: var(--bad);
  color: var(--bad);
}

.stats {
  color: var(--muted);
  font-size: 12px;
}

input[type="number"] {
  width: 100px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--fg);
  font: inherit;
  padding: 5px 8px;
}

input[type="number"]:focus {
  border-color: var(--accent);
  outline: none;
}

input[type="radio"] {
  accent-color: var(--accent);
}

label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.tag-log {
  height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  background: #030303;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--fg);
  font: inherit;
  font-size: 11px;
  margin: 10px 0 0;
  padding: 9px 10px;
}

.flash-progress {
  display: none;
  color: var(--muted);
  font-size: 11px;
  margin-top: 10px;
}

.flash-progress.active {
  display: block;
}

.flash-progress .bar {
  height: 4px;
  position: relative;
  overflow: hidden;
  background: var(--line);
  border-radius: 2px;
  margin-bottom: 5px;
}

.flash-progress .bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--p, 0%);
  background: var(--accent);
}

#chart {
  display: block;
  width: 100%;
  height: 320px;
  background: #030303;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.cal-status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.cal-status.running,
.cal-status.done {
  color: var(--accent);
}

.cal-status.error {
  color: var(--bad);
}

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

@media (max-width: 980px) {
  .product-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 38px 0 58px;
  }

  .product-copy h1 {
    font-size: clamp(34px, 8vw, 58px);
  }

  .product-media {
    height: 330px;
  }

  .product-media img {
    object-position: center bottom;
  }
}

@media (max-width: 820px) {
  .hero {
    min-height: auto;
    padding: 58px 0 68px;
  }

  .grid,
  .split,
  .tags,
  .spec-list,
  .product-gallery,
  .use-grid,
  .download-grid {
    grid-template-columns: 1fr;
  }

  article {
    min-height: 0;
  }

}

@media (max-width: 560px) {
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    flex-wrap: wrap;
    align-items: center;
  }

  .site-header .nav-toggle {
    display: inline-flex;
  }

  .site-header nav {
    display: none;
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
    overflow: hidden;
  }

  .site-header.nav-open nav {
    display: flex;
  }

  .site-header nav a {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }

  .site-header nav a:last-child {
    border-bottom: 0;
  }

  h1 {
    font-size: 40px;
  }

  .intro {
    font-size: 15px;
  }

  .button,
  button {
    width: 100%;
  }

  .viewer-canvas {
    height: 220px;
  }

  .lab-slide img {
    height: 360px;
    min-height: 0;
  }

  .lab-slide figcaption {
    position: static;
    max-width: none;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: #000;
    color: var(--muted);
  }

  .slide-button {
    top: calc(180px - 19px);
  }

  .slide-thumbs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x mandatory;
  }

  .slide-thumbs button {
    flex: 0 0 96px;
    scroll-snap-align: start;
  }

  .spec-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .spec-list dd {
    text-align: left;
  }
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--fg);
  cursor: pointer;
}

.nav-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-toggle-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.nav-toggle-icon::before { top: -5px; }
.nav-toggle-icon::after { top: 5px; }

.site-header.nav-open .nav-toggle-icon { background: transparent; }
.site-header.nav-open .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
.site-header.nav-open .nav-toggle-icon::after { top: 0; transform: rotate(-45deg); }

.viewer-loader {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.viewer-loader.is-done {
  opacity: 0;
}

.viewer-loader-inner {
  width: min(220px, 70%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.viewer-loader-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.viewer-loader-track {
  position: relative;
  height: 4px;
  background: var(--faint);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.viewer-loader-bar {
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--accent);
  transition: width 0.18s ease;
}

.viewer-loader.indeterminate .viewer-loader-bar {
  width: 40%;
  animation: viewer-loader-slide 1.1s ease-in-out infinite;
}

@keyframes viewer-loader-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

.desktop-only { display: flex; }
@media (max-width: 560px) {
  .desktop-only { display: none !important; }
}

.learn-one {
  align-items: center;
}

.learn-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.learn-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ranging-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 720px) {
  .ranging-grid { grid-template-columns: 1fr; }
}

.ranging-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ranging-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.ranging-card figcaption strong {
  font-size: 13px;
  color: var(--accent);
}

.ranging-card figcaption span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ranging-svg {
  display: block;
  width: 100%;
  height: auto;
  background: #050505;
}

.ranging-tag {
  fill: var(--accent);
}

.ranging-anchor-pulse {
  fill: #1a1a1a;
  stroke: var(--muted);
  stroke-width: 1.5;
}

.ranging-link {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.ranging-label {
  font-family: var(--font-body);
  font-size: 12px;
  fill: var(--muted);
}

.ranging-distance {
  font-family: var(--font-body);
  font-size: 11px;
  fill: var(--accent);
  letter-spacing: 0.04em;
}

.ranging-pulse {
  stroke: var(--accent);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}

.ranging-pulse-a { animation: ranging-twr 3s linear infinite; }
.ranging-pulse-b { stroke: #fff; animation: ranging-twr 3s linear infinite; animation-delay: 1.5s; }

@keyframes ranging-twr {
  0%   { transform: scale(0.22); opacity: 0.95; }
  45%  { transform: scale(2.05); opacity: 0; }
  100% { transform: scale(2.05); opacity: 0; }
}

.ranging-pulse-a1 { animation: ranging-tdoa 4s linear infinite; animation-delay: 0s; }
.ranging-pulse-a2 { animation: ranging-tdoa 4s linear infinite; animation-delay: 0.5s; }
.ranging-pulse-a3 { animation: ranging-tdoa 4s linear infinite; animation-delay: 1.0s; }
.ranging-pulse-a4 { animation: ranging-tdoa 4s linear infinite; animation-delay: 1.5s; }

@keyframes ranging-tdoa {
  0%   { transform: scale(0.16); opacity: 0.9; }
  35%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

.ranging-anchor-1 { animation: ranging-anchor-emit 4s linear infinite; animation-delay: 0s; }
.ranging-anchor-2 { animation: ranging-anchor-emit 4s linear infinite; animation-delay: 0.5s; }
.ranging-anchor-3 { animation: ranging-anchor-emit 4s linear infinite; animation-delay: 1.0s; }
.ranging-anchor-4 { animation: ranging-anchor-emit 4s linear infinite; animation-delay: 1.5s; }

@keyframes ranging-anchor-emit {
  0%, 12%, 100% { fill: #1a1a1a; stroke: var(--muted); }
  3%, 6% { fill: var(--accent); stroke: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  .ranging-pulse,
  .ranging-anchor-1, .ranging-anchor-2, .ranging-anchor-3, .ranging-anchor-4 {
    animation: none;
  }
  .ranging-pulse { opacity: 0.4; }
}
