/* dankcars — shared stylesheet. Every page links this one file.
   Identity: "sidewall lettering on asphalt" — wide Saira capitals like the
   moulded text on a tire, Barlow for reading, graphite + road-line yellow,
   tire A in ink, tire B in signal orange. Fonts are self-hosted (OFL, see
   /fonts/*-OFL.txt). Light and dark come from the same tokens. */

@font-face {
  font-family: "Saira";
  src: url("/fonts/saira-latin-wdth-wght.woff2") format("woff2-variations"), url("/fonts/saira-latin-wdth-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #e9e6df;
  --ink: #17191c;
  --ink-soft: #4a4f57;
  --line: #cfcac0;
  --road: #f2b705;          /* road-line yellow: marks, focus, highlights */
  --road-ink: #17191c;      /* text placed on --road */
  --tire-a: #2b2f36;        /* current tire */
  --tire-a-fill: #3a3f47;
  --tire-b: #c2410c;        /* new tire */
  --tire-b-fill: #9a3412;
  --rim: #b8bcc4;
  --good: #1f7a4a;
  --warn: #b45309;
  --radius: 10px;
  --font-display: "Saira", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131519;
    --surface: #1c1f24;
    --surface-2: #262a31;
    --ink: #ebe8e1;
    --ink-soft: #a9adb5;
    --line: #353a42;
    --road: #f5c431;
    --road-ink: #131519;
    --tire-a: #d9dce2;
    --tire-a-fill: #4a505a;
    --tire-b: #ff8a4c;
    --tire-b-fill: #b4461a;
    --rim: #7d838d;
    --good: #5ccf8f;
    --warn: #f0a74a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--font-body);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration-color: var(--road); text-decoration-thickness: 2px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--road); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* masthead: a strip of tread */
.mast { border-bottom: 1px solid var(--line); background: var(--surface); }
.mast .wrap { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.brand {
  font: 800 18px/1 var(--font-display);
  font-stretch: 125%;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
}
.brand::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -1px;
  border-radius: 50%; border: 4px solid var(--ink); box-shadow: inset 0 0 0 2px var(--road);
}
.mast .tag { color: var(--ink-soft); font-size: 14px; margin-left: auto; }

h1, h2, h3 { font-family: var(--font-display); font-stretch: 112%; line-height: 1.15; letter-spacing: .01em; }
h1 { font-size: clamp(22px, 3.2vw, 34px); font-weight: 750; margin: 14px 0 4px; }
h2 { font-size: 22px; font-weight: 700; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .05em; }
h3 { font-size: 17px; font-weight: 700; margin: 18px 0 6px; }
.lede { margin: 0 0 12px; color: var(--ink-soft); max-width: 70ch; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stack > * + * { margin-top: 16px; }

/* size entry */
.sizes { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: end; }
.field label { display: block; font: 700 13px/1.2 var(--font-display); font-stretch: 112%; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.field .key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.key-a { background: var(--tire-a); }
.key-b { background: var(--tire-b); }
.field input {
  width: 100%; min-width: 0;
  font: 600 20px/1.2 var(--font-display); font-stretch: 105%;
  letter-spacing: .02em;
  padding: 10px 10px; border-radius: 8px;
  border: 2px solid var(--line); background: var(--bg); color: var(--ink);
}
.field input:focus { border-color: var(--road); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--road) 35%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--warn); }
.field .err { min-height: 1.3em; font-size: 13.5px; color: var(--warn); margin: 3px 0 0; }
.swap {
  align-self: center; margin-bottom: 22px;
  font: 700 18px/1 var(--font-display); width: 40px; height: 44px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer;
}
.examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 14px; }
.examples span { color: var(--ink-soft); }
.chip {
  font: 600 13.5px/1 var(--font-body); padding: 7px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
}
.chip:hover { border-color: var(--road); }

/* the one-sentence answer */
.verdict { font-size: 18px; line-height: 1.45; margin: 0; }
.verdict b { font-family: var(--font-display); font-stretch: 105%; }
.verdict .hl { background: var(--road); color: var(--road-ink); padding: 0 4px; border-radius: 3px; font-weight: 600; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
thead th { white-space: normal; font: 700 12.5px/1.2 var(--font-display); font-stretch: 112%; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
td small { display: block; color: var(--ink-soft); font-size: 13px; }
.pos { color: var(--tire-b); }
.col-a { border-top: 3px solid var(--tire-a); }
.col-b { border-top: 3px solid var(--tire-b); }

/* drawing */
.drawing svg { display: block; width: 100%; height: auto; }
.drawing figcaption { font-size: 14px; color: var(--ink-soft); margin-top: 8px; }
.svg-tire-a { fill: var(--tire-a-fill); stroke: var(--tire-a); }
.svg-tire-b { fill: var(--tire-b-fill); stroke: var(--tire-b); }
.svg-rim { fill: var(--rim); stroke: none; }
.svg-hub { fill: var(--surface); }
.svg-ghost { fill: none; stroke: var(--tire-a); stroke-dasharray: 6 5; }
.svg-ground { stroke: var(--ink-soft); }
.svg-dim { stroke: var(--ink-soft); fill: none; }
.svg-text { fill: var(--ink); font-family: var(--font-display); font-weight: 600; }
.svg-text-soft { fill: var(--ink-soft); font-family: var(--font-body); }

/* decode */
.decode dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 15.5px; }
.decode dt { font-weight: 600; }
.decode dd { margin: 0; }
details summary { cursor: pointer; font-weight: 600; margin-top: 10px; }
.ref-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 16px; }
.ref-tables table { font-size: 14px; }

/* prose */
.prose { max-width: 72ch; }
.prose p, .prose li { margin: 0 0 10px; }
.formula { font-family: var(--font-display); font-stretch: 100%; font-weight: 500; background: var(--surface-2); padding: 10px 12px; border-left: 4px solid var(--road); border-radius: 4px; overflow-x: auto; white-space: pre; font-size: 15px; line-height: 1.6; }

/* layout */
.app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-bottom: 24px; }
.app > *, .info > * { min-width: 0; }
.info { display: grid; gap: 16px; padding: 8px 0 32px; }
@media (min-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .app .side { position: sticky; top: 12px; }
  .info { grid-template-columns: 1fr 1fr; gap: 16px 32px; }
}

.foot { border-top: 1px solid var(--line); padding: 16px 0 28px; color: var(--ink-soft); font-size: 14px; }

@media (max-width: 420px) {
  .card { padding: 12px; }
  .field input { font-size: 16px; font-stretch: 95%; letter-spacing: 0; padding: 9px 7px; }
  .swap { width: 34px; }
  .sizes { gap: 6px; }
  table { font-size: 14px; }
  th, td { padding: 6px 5px; }
  .verdict { font-size: 17px; }
}
figure.card { margin: 0; }
.note { margin-top: 10px; font-size: 15px; }

/* tire size pages (/tire/<size>/) — built by tools/build-tire-pages.cjs */
.crumb { margin: 12px 0 0; font-size: 14px; color: var(--ink-soft); }
.svg-dim-hi { stroke: var(--road); fill: none; }
.alts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-bottom: 24px; }
.alts > * { min-width: 0; }
.alt h3 { margin-top: 0; }
.alt .count { font: 600 13px/1 var(--font-body); color: var(--road-ink); background: var(--road); border-radius: 999px; padding: 3px 8px; vertical-align: 2px; }
.alt td:first-child a { font-family: var(--font-display); font-weight: 600; font-stretch: 105%; }
#calc { padding-top: 8px; }
#calc > h2, #alternatives { margin-top: 8px; }
.size-list { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; }
.size-list a { font-family: var(--font-display); font-weight: 600; }
.size-list small { color: var(--ink-soft); }
@media (min-width: 960px) {
  .alts { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
}
