/* ==========================================================================
   GokartManager — product site, "telemetry" direction.
   Paper background, hairline engineering grid, monospace data, one signal
   colour. Deliberately shares nothing with the system's own paddock palette.
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  --paper: #f7f6f3;
  --paper-2: #efeee9;
  --ink: #14161a;
  --ink-soft: #4a4f57;
  --ink-muted: #8b9099;
  --rule: #dcdad3;
  --rule-strong: #c3c0b7;

  /* --signal is ~3.5:1 on paper: large text, rules and markers only.
     Anything under 20px that needs the accent uses --signal-ink (~5.5:1). */
  --signal: #ff4d00;
  --signal-ink: #c23a00;

  --font-display: "Inter Tight", -apple-system, "Segoe UI", Helvetica, sans-serif;
  --font-sans: "Inter", -apple-system, "Segoe UI", Helvetica, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1200px;
  --label-col: 180px;
}

/* --- 2. Reset & globals -------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background: var(--signal);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

.sect {
  padding: 96px 0;
}

.sect--alt {
  background: var(--paper-2);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.skip-link:focus {
  left: 0;
}

/* --- 3. Type primitives -------------------------------------------------- */

.label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.label--signal {
  color: var(--signal-ink);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.06;
  text-wrap: balance;
}

h2 {
  font-size: clamp(34px, 4.2vw, 54px);
}

h3 {
  font-size: 21px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.lede {
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 58ch;
}

/* The label column / content pair that sets the whole page's rhythm. */
.row {
  display: grid;
  grid-template-columns: var(--label-col) 1fr;
  gap: 40px;
  align-items: start;
}

.row-head {
  position: sticky;
  top: 108px;
}

.row-body > * + * {
  margin-top: 20px;
}

.sect-intro {
  margin-bottom: 56px;
}

/* --- 4. Motifs ----------------------------------------------------------- */

/* 4.1 Blueprint dot grid — hero only, masked so it fades at the edges. */
.blueprint {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--rule-strong) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 20%, transparent 75%);
  pointer-events: none;
}

/* 4.2 Ruler rule — the section divider. Minor ticks every 16px, a major tick
   every 4th, drawn as two repeating gradients over one hairline. */
.ruler {
  position: relative;
  height: 22px;
  /* The label hangs out of the box below the ticks — the margin is its room. */
  margin-bottom: 52px;
  border-top: 1px solid var(--rule);
}

.ruler::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(to right, var(--rule-strong) 0 1px, transparent 1px 64px);
  background-size: 16px 6px, 64px 11px;
  background-repeat: repeat-x;
  background-position: 0 0, 0 0;
}

.ruler span {
  position: absolute;
  top: 12px;
  left: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--paper);
  padding-right: 10px;
}

.sect--alt .ruler span {
  background: var(--paper-2);
}

/* 4.3 Crosshair registration marks at panel corners. */
.crop {
  position: relative;
}

.crop::before,
.crop::after {
  content: "+";
  position: absolute;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  color: var(--rule-strong);
  pointer-events: none;
}

.crop::before {
  top: -6px;
  left: -6px;
}

.crop::after {
  bottom: -6px;
  right: -6px;
}

/* 4.4 Readout — the signature component. */
.readout {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
}

.readout div {
  flex: 1 1 auto;
  min-width: 130px;
  padding: 14px 18px;
  border-right: 1px solid var(--rule);
}

.readout div:last-child {
  border-right: none;
}

.readout--stats {
  margin-bottom: 48px;
}

.readout dt,
.readout .k {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.readout dd,
.readout .v {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.readout .v--signal {
  color: var(--signal-ink);
}

/* Used once, in the hero: the lap time flashes when a new best lands. */
.readout .v.is-flash {
  color: var(--signal-ink);
}

/* 4.5 Dimension line — used exactly once, annotating latency. */
.dim {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  color: var(--ink-muted);
}

.dim-line {
  position: relative;
  flex: 1 1 auto;
  max-width: 260px;
  height: 1px;
  background: var(--rule-strong);
}

.dim-line::before,
.dim-line::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 1px;
  height: 7px;
  background: var(--rule-strong);
}

.dim-line::before { left: 0; }
.dim-line::after { right: 0; }

.dim-value {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--signal-ink);
  white-space: nowrap;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* --- 5. Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 13px 20px;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--signal);
}

.btn-ghost {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink);
}

.arr {
  transition: transform 0.15s ease;
}

.btn:hover .arr {
  transform: translateX(3px);
}

/* --- 6. Navigation ------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 246, 243, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.nav.is-stuck {
  border-bottom-color: var(--rule);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.brand {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand i {
  font-style: normal;
  color: var(--signal-ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  list-style: none;
}

/* :not(.btn) — this rule out-specifies .btn-primary and would repaint the
   CTA's label with the muted link colour. */
.nav-links a:not(.btn) {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.nav-links a:not(.btn):hover {
  color: var(--signal-ink);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--rule-strong);
  align-items: center;
  justify-content: center;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 16px;
  height: 1px;
  background: var(--ink);
  content: "";
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span::before { transform: translateY(-5px); }
.nav-toggle span::after { transform: translateY(4px); }

.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-1px) rotate(-45deg); }

.nav-drawer {
  display: none;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

.nav-drawer.is-open {
  display: block;
}

.nav-drawer ul {
  list-style: none;
  padding: 4px 0 16px;
}

.nav-drawer li + li {
  border-top: 1px solid var(--rule);
}

.nav-drawer a {
  display: block;
  padding: 14px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* --- 7. Hero ------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 92px 0 76px;
  overflow: hidden;
}

.hero-inner {
  position: relative;
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(46px, 7vw, 96px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 13ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--signal);
}

.hero .lede {
  margin-top: 26px;
  font-size: 18px;
}

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

.hero .readout {
  margin-top: 56px;
}

/* --- 8. Frames ----------------------------------------------------------- */

.frame {
  position: relative;
  border: 1px solid var(--rule);
  /* Dots must be the FIRST layer — the first background paints on top. */
  background:
    radial-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(var(--paper-2), var(--paper-2));
  background-size: 16px 16px, auto;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.frame-body {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
}

.frame-body .slot {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
}

.frame-body .glyph {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rule-strong);
}

/* A frame holding a real screenshot drops the placeholder ratio and takes the
   image's own. The 16/10 above is only for empty placeholder frames. */
.frame--auto {
  aspect-ratio: auto;
}

.frame--auto img {
  width: 100%;
  height: auto;
}

/* The crew app is a phone screenshot — portrait among landscapes. Centre it on
   the frame's paper so the odd ratio reads as deliberate. */
.frame--device {
  aspect-ratio: auto;
  display: grid;
  place-items: center;
  padding: 44px 20px;
}

.frame--device img {
  width: 260px;
  max-width: 62%;
  height: auto;
  border: 1px solid var(--rule-strong);
}

/* --- 9. Feature grid ----------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  position: relative;
  border: 1px solid var(--rule);
  padding: 26px 24px 24px;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: var(--ink);
}

.card-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  color: var(--signal-ink);
}

.card h3 {
  margin-top: 12px;
}

.card p {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 15px;
}

.tags {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  list-style: none;
}

.tags li {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* --- 10. Screens --------------------------------------------------------- */

.shots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 28px;
  align-items: start;
}

.shot--full {
  grid-column: 1 / -1;
}

.shot figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

.shot figcaption b {
  font-weight: 500;
  color: var(--ink);
}

/* --- 11. Claims ---------------------------------------------------------- */

.claims {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.claim {
  background: var(--paper);
  padding: 30px 28px;
}

.sect--alt .claim {
  background: var(--paper-2);
}

.claim h3 {
  margin-top: 10px;
}

.claim p {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 15px;
}

/* --- 12. Spec table ------------------------------------------------------ */

.spec {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--ink);
}

.spec th,
.spec td {
  text-align: left;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}

.spec th {
  width: 190px;
  padding-right: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.spec td {
  font-size: 15px;
  color: var(--ink-soft);
}

.swatches {
  display: inline-flex;
  gap: 6px;
  vertical-align: middle;
  margin-right: 10px;
}

.swatches i {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* --- 13. Pricing --------------------------------------------------------- */

.prices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}

.price {
  position: relative;
  border: 1px solid var(--rule);
  padding: 28px 26px;
}

.price--hot {
  border-color: var(--ink);
}

.price h3 {
  margin-top: 10px;
}

.price-amount {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.price-amount b {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.price-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.price ul {
  list-style: none;
  margin-top: 20px;
  display: grid;
  gap: 9px;
}

.price li {
  position: relative;
  padding-left: 18px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.price li::before {
  content: "+";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  color: var(--signal-ink);
}

.price .btn {
  margin-top: 24px;
  width: 100%;
  justify-content: center;
}

.fine {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* --- 14. CTA ------------------------------------------------------------- */

.cta {
  padding: 104px 0;
  border-top: 1px solid var(--rule);
}

.cta h2 {
  font-weight: 300;
  font-size: clamp(38px, 5.4vw, 68px);
  letter-spacing: -0.04em;
  max-width: 16ch;
}

.cta p {
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 52ch;
}

.cta-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- 15. Footer ---------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule);
  padding: 52px 0 36px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.footer ul {
  list-style: none;
  margin-top: 14px;
  display: grid;
  gap: 9px;
}

.footer li a,
.footer li span {
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.footer li a:hover {
  color: var(--signal-ink);
}

.footer-note {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 14px;
  color: var(--ink-soft);
}

.footer-bottom {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* --- 16. Responsive ------------------------------------------------------ */

@media (max-width: 1080px) {
  :root { --label-col: 140px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .sect { padding: 72px 0; }
  .row { grid-template-columns: 1fr; gap: 18px; }
  .row-head { position: static; }
  .prices { grid-template-columns: 1fr; }
  .hero h1 { max-width: none; }
}

@media (max-width: 720px) {
  .cards,
  .shots,
  .claims { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .sect { padding: 56px 0; }
  .cta { padding: 72px 0; }
  .readout div { min-width: 50%; }
  .spec th,
  .spec td { display: block; width: auto; padding: 0; border-bottom: none; }
  .spec th { padding-top: 16px; }
  .spec td { padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
  .footer-grid { grid-template-columns: 1fr; }
}

/* --- 17. Motion preferences ---------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal { opacity: 1; transform: none; }
}
