/* TrackDyno site: dyno-sheet concept. Ruled graph-paper surfaces, the power
   curve as the thesis, mono readouts for every number. Single dark look by
   choice (matches the app icon: black, white, brand orange). */

@font-face { font-family: "Chakra Petch"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/chakra-petch-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-style: italic; font-display: swap; src: url("assets/fonts/chakra-petch-latin-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-style: italic; font-display: swap; src: url("assets/fonts/chakra-petch-latin-700-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: italic; font-display: swap; src: url("assets/fonts/barlow-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("assets/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  /* color */
  --bg: #0a0b0d;          /* asphalt black, faint cool bias */
  --panel: #121418;       /* raised surface */
  --rule: #1f2228;        /* graph-paper lines, borders */
  --rule-strong: #2e323a;
  --fg: #f3f2ef;          /* warm white, like the wordmark */
  --muted: #9a9ea7;
  --faint: #6b707a;
  --accent: #ff5a0a;      /* brand orange: power */
  --accent-ink: #ff7a36;  /* orange for small text on dark */
  --torque: #4a90ff;      /* torque trace, matches the app */
  --good: #3ccf6e;
  --best: #b366ff;        /* session-best purple */

  /* type */
  --display: "Chakra Petch", "Eurostile", "Bank Gothic", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-cap: 0.8125rem;   /* 13 */
  --fs-sm: 0.9375rem;    /* 15 */
  --fs-base: 1.0625rem;  /* 17 */
  --fs-lg: 1.25rem;      /* 20 */
  --fs-h3: 1.375rem;     /* 22 */
  --fs-h2: clamp(1.75rem, 1.2rem + 2.2vw, 2.625rem);
  --fs-h1: clamp(2.5rem, 1.4rem + 5vw, 5rem);

  --radius: 10px;
  --wrap: 1160px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--fg); text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}

h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.05; }
h1 { font-size: var(--fs-h1); font-weight: 700; font-style: italic; text-transform: uppercase; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.005em; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
p { margin: 0; }
.label {
  font-family: var(--mono);
  font-size: var(--fs-cap);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.label b { color: var(--accent-ink); font-weight: 500; }
.lede { font-size: var(--fs-lg); color: var(--muted); max-width: 36em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand img { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--rule-strong); }
.brand span { font-family: var(--display); font-weight: 700; font-style: italic; text-transform: uppercase; font-size: 1.125rem; letter-spacing: 0.01em; }
.brand span em { font-style: italic; color: var(--accent); }
.nav { display: flex; align-items: center; gap: 22px; margin-left: auto; font-size: var(--fs-sm); }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #0a0b0d; }
@media (max-width: 640px) { .nav .hide-sm { display: none; } .nav { gap: 16px; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: 0.02em;
  text-decoration: none; border-radius: 8px; padding: 12px 20px;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: #0a0b0d; }
.btn-primary:hover { background: var(--accent-ink); color: #0a0b0d; }
.btn-ghost { border-color: var(--rule-strong); color: var(--fg); background: transparent; }
.btn-ghost:hover { border-color: var(--muted); color: var(--fg); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-sm { padding: 8px 14px; font-size: 0.9375rem; }

/* ---------- graph paper ---------- */
.paper {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--rule); position: relative; overflow: hidden; }
.hero::after { /* fade the paper toward the copy */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 45%, transparent 75%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; display: grid; gap: 40px; padding-block: 64px 56px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) {
  .hero .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; padding-block: 88px 80px; }
}
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero h1 .o { color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.meta-line { font-size: var(--fs-sm); color: var(--faint); }

/* the dyno sheet */
.sheet { background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 18px 18px 12px; min-width: 0; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.sheet-head { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.readouts { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.readout { display: grid; gap: 0; }
.readout .v { font-family: var(--mono); font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.readout .v small { font-size: 0.5em; color: var(--muted); margin-left: 4px; font-weight: 400; }
.readout.hp .v { color: var(--accent); }
.readout.tq .v { color: var(--torque); }
.readout .at { font-family: var(--mono); font-size: var(--fs-cap); color: var(--muted); }
.sheet svg { width: 100%; height: auto; display: block; overflow: visible; }
.sheet .grid line { stroke: var(--rule); stroke-width: 1; }
.sheet .axis text { fill: var(--faint); font-family: var(--mono); font-size: 12px; }
.sheet .trace { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sheet .trace.hp { stroke: var(--accent); }
.sheet .trace.tq { stroke: var(--torque); }
.sheet .area { fill: var(--accent); opacity: .09; }
.sheet .xover line { stroke: var(--muted); stroke-dasharray: 3 4; }
.sheet .xover text { fill: var(--muted); font-family: var(--mono); font-size: 11px; }
.sheet .peak circle { stroke: var(--bg); stroke-width: 2; }
.sheet-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; border-top: 1px solid var(--rule); margin-top: 8px; padding-top: 10px; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.key i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

@media (prefers-reduced-motion: no-preference) {
  .sheet .trace { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 1.6s cubic-bezier(.3,.1,.2,1) both; }
  .sheet .trace.tq { animation-delay: .15s; }
  .sheet .area, .sheet .peak, .sheet .xover { animation: fade .5s ease 1.4s both; }
  @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes fade { from { opacity: 0; } }
}

/* ---------- strip of facts ---------- */
.facts { border-bottom: 1px solid var(--rule); }
.facts .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.fact { padding: 22px 20px 22px 0; display: grid; gap: 4px; min-width: 0; }
.fact + .fact { border-left: 1px solid var(--rule); padding-left: 20px; }
@media (max-width: 939px) { .fact + .fact { border-left: 0; padding-left: 0; } .fact { border-top: 1px solid var(--rule); } .fact:first-child { border-top: 0; } }
.fact strong { font-family: var(--display); font-weight: 600; font-size: 1.125rem; }
.fact span { color: var(--muted); font-size: var(--fs-sm); }

/* ---------- sections ---------- */
.section { padding-block: 88px; border-bottom: 1px solid var(--rule); }
.section-head { display: grid; gap: 14px; max-width: 46em; margin-bottom: 48px; }

.feature { display: grid; gap: 36px; grid-template-columns: minmax(0, 1fr); align-items: center; }
.feature + .feature { margin-top: 96px; }
@media (min-width: 900px) {
  .feature { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; }
  .feature.flip .feature-copy { order: 2; }
}
.feature-copy { display: grid; gap: 16px; min-width: 0; }
.feature-copy p { color: var(--muted); max-width: 34em; }
.specs { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.specs li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: var(--fs-sm); }
.specs li > span:first-child { font-family: var(--mono); font-size: var(--fs-cap); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
@media (max-width: 420px) { .specs li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.visual { min-width: 0; }
.shot { border-radius: 14px; border: 1px solid var(--rule-strong); overflow: hidden; background: #000; box-shadow: 0 30px 70px -35px rgba(0,0,0,.9); }
.shot.phone { max-width: 340px; margin-inline: auto; border-radius: 34px; border: 8px solid #1b1d22; }
.caption { margin-top: 12px; }

/* timeslip */
.slip {
  max-width: 380px; margin-inline: auto; background: var(--fg); color: #16171a;
  font-family: var(--mono); font-size: 0.875rem; padding: 22px 22px 18px;
  border-radius: 4px; transform: rotate(-1.5deg);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.95);
  -webkit-mask: radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) 0 0 / 14px 100%;
          mask: radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) 0 0 / 14px 100%;
  padding-bottom: 26px;
}
.slip header { text-align: center; border-bottom: 1px dashed #16171a; padding-bottom: 10px; margin-bottom: 8px; }
.slip header b { display: block; font-family: var(--display); font-style: italic; font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; }
.slip table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.slip td { padding: 5px 0; }
.slip td:last-child { text-align: right; }
.slip tr.big td { font-size: 1.05rem; font-weight: 500; border-top: 1px dashed #16171a; padding-top: 9px; }
.slip .sub { color: #5b5e66; }
.slip footer { margin-top: 10px; border-top: 1px dashed #16171a; padding-top: 8px; font-size: 0.75rem; color: #5b5e66; text-align: center; }

/* braking trace card */
.trace-card { background: var(--panel); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 18px; }
.trace-card svg { width: 100%; height: auto; display: block; }
.trace-card .grid line { stroke: var(--rule); }
.trace-card .axis text { fill: var(--faint); font-family: var(--mono); font-size: 11px; }
.trace-card .speed { fill: none; stroke: var(--fg); stroke-width: 2.5; }
.trace-card .decel { fill: var(--accent); opacity: .16; }
.trace-card .decel-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.trace-card .mark line { stroke: var(--accent-ink); stroke-dasharray: 3 4; }
.trace-card .mark text { fill: var(--accent-ink); font-family: var(--mono); font-size: 11px; }
.trace-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-bottom: 12px; }
.trace-stats div { display: grid; }
.trace-stats .v { font-family: var(--mono); font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.15; }
.trace-stats .v small { font-size: .55em; color: var(--muted); margin-left: 3px; }

/* ---------- how it measures ---------- */
.formula {
  font-family: var(--mono); font-size: clamp(0.95rem, 0.75rem + 0.9vw, 1.3rem); line-height: 1.5;
  background: var(--panel); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: 22px 24px; overflow-x: auto; white-space: nowrap; margin-bottom: 40px;
}
.formula .o { color: var(--accent); }
.formula-key { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; white-space: normal; font-size: var(--fs-cap); color: var(--muted); }
.sensors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.sensor { padding: 22px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; gap: 8px; align-content: start; min-width: 0; }
.sensor h3 { font-size: 1.125rem; }
.sensor p { color: var(--muted); font-size: var(--fs-sm); }
.note { margin-top: 32px; padding: 18px 22px; border-left: 3px solid var(--accent); background: var(--panel); color: var(--muted); max-width: 52em; font-size: var(--fs-sm); }
.note strong { color: var(--fg); }

/* ---------- OBD ---------- */
.obd { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .obd { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; } }
.compat { display: grid; gap: 22px; align-content: start; }
.compat ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.compat li { font-family: var(--mono); font-size: var(--fs-cap); padding: 6px 10px; border-radius: 6px; border: 1px solid var(--rule-strong); }
.compat .yes li { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.compat .no li { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }

/* ---------- CTA band ---------- */
.cta { padding-block: 88px; }
.cta .wrap { display: grid; gap: 28px; justify-items: start; }
.cta h2 { font-size: var(--fs-h1); font-style: italic; font-weight: 700; text-transform: uppercase; max-width: 14ch; }
.cta h2 .o { color: var(--accent); }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--muted); }
.checks li::before { content: "✓"; color: var(--accent); margin-right: 8px; font-family: var(--mono); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--rule); font-size: var(--fs-sm); color: var(--muted); }
.site-foot .wrap { display: grid; gap: 18px; padding-block: 36px 44px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--fg); }
.fineprint { font-size: var(--fs-cap); color: var(--faint); max-width: 60em; }

/* ---------- document pages (support, privacy) ---------- */
.doc-hero { border-bottom: 1px solid var(--rule); }
.doc-hero .wrap { padding-block: 56px 44px; display: grid; gap: 14px; }
.doc-hero h1 { font-size: clamp(2.25rem, 1.5rem + 3.5vw, 3.75rem); }
.doc { display: grid; gap: 48px; padding-block: 48px 88px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .doc { grid-template-columns: 220px minmax(0, 1fr); gap: 64px; } }
.toc { display: none; }
@media (min-width: 960px) {
  .toc { display: grid; gap: 8px; align-content: start; position: sticky; top: 24px; font-size: var(--fs-sm); }
  .toc a { color: var(--muted); text-decoration: none; }
  .toc a:hover { color: var(--fg); }
}
.prose { max-width: 42em; min-width: 0; }
.prose h2 { font-size: 1.625rem; margin: 48px 0 14px; scroll-margin-top: 24px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.1875rem; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; color: #c9cacd; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--fg); font-weight: 600; }
.prose code { font-family: var(--mono); font-size: .875em; background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 5px; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin: 0 0 18px; }
.prose th, .prose td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-family: var(--mono); font-size: var(--fs-cap); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.table-scroll { overflow-x: auto; }

.contact-card { background: var(--panel); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; margin-bottom: 40px; }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.email { font-family: var(--mono); font-size: clamp(1rem, .9rem + .6vw, 1.25rem); color: var(--fg); user-select: all; word-break: break-all; }
.copy-status { font-size: var(--fs-cap); color: var(--good); font-family: var(--mono); min-height: 1em; }
.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2em minmax(0, 1fr); gap: 10px; }
.steps li::before { content: counter(step); font-family: var(--mono); color: var(--accent); border: 1px solid var(--rule-strong); border-radius: 6px; width: 1.8em; height: 1.8em; display: grid; place-items: center; font-size: var(--fs-cap); }

details.faq { border-bottom: 1px solid var(--rule); }
details.faq:first-of-type { border-top: 1px solid var(--rule); }
details.faq summary { cursor: pointer; list-style: none; padding: 16px 32px 16px 0; font-family: var(--display); font-weight: 600; font-size: 1.125rem; position: relative; color: var(--fg); }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-family: var(--mono); color: var(--accent); font-size: 1.25rem; }
details.faq[open] summary::after { content: "–"; }
details.faq .a { padding-bottom: 14px; }
