/* OBD App web: same language as the app. DM Sans, thin oversized numbers, one jelly colour per meaning. */
@font-face { font-family: "DM Sans"; src: url(fonts/dm_sans_extralight.woff2) format("woff2"); font-weight: 200; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(fonts/dm_sans_light.woff2) format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(fonts/dm_sans_regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(fonts/dm_sans_medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #ededf1; --surface: #ffffff; --surface-2: #f4f4f7; --ink: #16161a; --ink-2: #55555f; --ink-3: #7a7a85;
  --line: rgb(22 22 26 / .08); --accent: #e8e35a; --accent-ink: #16150d; --warn: #b4512a; --ok: #2f8e5c;
  --shadow: 0 18px 50px rgb(40 40 70 / .10), 0 2px 6px rgb(40 40 70 / .05);
  --r-card: 28px; --r-pill: 999px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0b0d; --surface: #151518; --surface-2: #1c1c20; --ink: #f2f2f4; --ink-2: #a6a6b0; --ink-3: #7c7c86;
    --line: rgb(255 255 255 / .08); --shadow: 0 0 0 1px rgb(255 255 255 / .06); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 "DM Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 767px) { .wrap { padding: 0 16px; } }

/* Nav */
/* z-index scale: 10 nav, 20 overlays */
.nav { position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); background: color-mix(in srgb, var(--bg) 78%, transparent); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; text-decoration: none; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; gap: 8px; align-items: center; }

/* Buttons: pill, one primary per view */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 15px "DM Sans", sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease-out, background .15s ease-out; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: transparent; }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.btn:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }

/* Type */
.num { font-family: "DM Sans", sans-serif; font-weight: 200; letter-spacing: -.04em; line-height: 1; }
.unit { font-size: 14px; font-weight: 400; color: var(--ink-3); margin-left: 6px; letter-spacing: 0; }
/* Signature: numbers the car doesn't measure carry a small "estimated" mark */
.est { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: inherit; opacity: .7; letter-spacing: 0; vertical-align: middle; }
.est::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; }
h1, h2, h3 { font-weight: 300; letter-spacing: -.03em; margin: 0; text-wrap: balance; }
p, li, .small { text-wrap: pretty; }
.num, .stats, .row .small, .chart text { font-variant-numeric: tabular-nums; }
h1 { font-size: clamp(42px, 6vw, 72px); line-height: 1.02; }
h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.08; }
h3 { font-size: 20px; font-weight: 400; letter-spacing: -.01em; }
.lead { font-size: 18px; color: var(--ink-2); max-width: 46ch; margin: 20px 0 0; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; color: var(--ink-3); }

/* Jelly: one colour story per card, same recipe as the app */
.jelly { position: relative; overflow: hidden; border-radius: var(--r-card); padding: 28px; color: var(--j-ink);
  background: radial-gradient(120% 90% at 70% 110%, var(--j-bloom), transparent 60%), linear-gradient(180deg, color-mix(in srgb, var(--j-haze) 55%, transparent), transparent 45%), var(--j-base);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 22px 60px -20px var(--j-bloom); }
.jelly .sub { color: var(--j-sub); }
.citrus { --j-base: #f7f5c6; --j-bloom: #f2f58a; --j-haze: #4a443c; --j-ink: #17150f; --j-sub: rgb(32 29 20 / .74); }
.lilac  { --j-base: #d9d3f0; --j-bloom: #8c7be0; --j-haze: #f4c9ec; --j-ink: #1d1834; --j-sub: rgb(29 24 52 / .62); }
.sea    { --j-base: #4e7377; --j-bloom: #7be3a0; --j-haze: #6e86c4; --j-ink: #f4fbf6; --j-sub: rgb(244 251 246 / .72); }
.ember  { --j-base: #f5b8e8; --j-bloom: #ff8a4c; --j-haze: #e8a4f2; --j-ink: #2b1220; --j-sub: rgb(43 18 32 / .62); }
@media (prefers-color-scheme: dark) {
  .jelly { box-shadow: inset 0 1px 0 rgb(255 255 255 / .12); }
  .citrus { --j-base: #16150d; --j-bloom: #8f8a1e; --j-haze: #000; --j-ink: #f5f2d6; --j-sub: rgb(245 242 214 / .74); }
  .lilac  { --j-base: #15122a; --j-bloom: #5b48c2; --j-haze: #8a3f84; --j-ink: #eeeafb; --j-sub: rgb(238 234 251 / .65); }
  .sea    { --j-base: #0c1c1f; --j-bloom: #2f8e5c; --j-haze: #2b3b70; --j-ink: #e8f6ee; --j-sub: rgb(232 246 238 / .65); }
  .ember  { --j-base: #1f0e1a; --j-bloom: #b4512a; --j-haze: #7d3a86; --j-ink: #fce9f2; --j-sub: rgb(252 233 242 / .65); }
}

.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 24px; }
.code { font: 500 15px/1 ui-monospace, "SF Mono", Menlo, monospace; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); display: inline-block; }

/* Reveal on scroll (motion = hierarchy, gated for reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(24px); transition: opacity .5s ease-out, transform .5s ease-out; }
  .reveal.in { opacity: 1; transform: none; }
}
@media (max-width: 900px) { .hide-sm { display: none; } }
