/* Jeep Model Guide */
:root {
  color-scheme: light;
  --ink: #1f2419; --muted: #59604f; --line: #dcd8cb; --paper: #fffdf8; --bg: #f4f1e8; --soft: #ebe6d6;
  --bar: #2f3a26; --bar-ink: #f4f1e8;
  --accent: #96421a; --accent-soft: #f6e6da;
  --now: #2d5a1e; --now-bg: #e3f0da; --past: #5d5a50; --past-bg: #ebe8de;
  --focus: #b35c00; --radius: 12px;
  /* timeline */
  --t-bar: #6d7a4e; --t-now: #2d5a1e; --t-grid: #e2ddcd; --t-tick: #6f6b5f;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #ebe8df; --muted: #b4b1a4; --line: #34372e; --paper: #1b1e18; --bg: #121410; --soft: #23271f;
    --bar: #1d2418; --bar-ink: #ebe8df;
    --accent: #f0a46e; --accent-soft: #3a2619;
    --now: #9fd884; --now-bg: #1d3216; --past: #b9b5a8; --past-bg: #2a2c25;
    --focus: #ffb35c;
    --t-bar: #8c9a68; --t-now: #9fd884; --t-grid: #2c2f27; --t-tick: #9d9a8e;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: 8px; top: -60px; background: #fff; color: #7f3510; padding: 8px 14px; border-radius: 8px; z-index: 50; font-weight: 600; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; margin-top: 2rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Header and footer */
.site-header { background: var(--bar); color: var(--bar-ink); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { color: var(--bar-ink); font-weight: 700; font-size: 1.1rem; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--bar-ink); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover { background: rgba(255,255,255,.1); }
.nav a[aria-current="page"] { background: rgba(255,255,255,.16); font-weight: 600; }
.site-header :focus-visible { outline-color: #fff; }
.crumbs { padding-top: 12px; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
main.wrap { padding-top: 16px; padding-bottom: 40px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 20px 0 32px; }
.site-footer p { margin: 0 0 .5rem; max-width: 760px; }
.site-footer a { color: var(--muted); }

/* Home page */
.hero { padding: 12px 0 8px; }
.hero .lede { font-size: 1.1rem; color: var(--muted); max-width: 760px; }
.stats { display: flex; gap: 24px; flex-wrap: wrap; margin: 8px 0 4px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 1.5rem; line-height: 1.1; }
.stats span { color: var(--muted); font-size: .85rem; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 20px 0 8px; position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 5; }
.chip { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--bar); color: var(--bar-ink); border-color: var(--bar); }
.search { flex: 1 1 200px; min-width: 0; max-width: 320px; border: 1px solid #8a8676; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .95rem; background: var(--paper); color: var(--ink); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 12px 0 8px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
a.model-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
a.model-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.model-card .name { font-weight: 700; font-size: 1.1rem; color: var(--accent); }
.model-card .years { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .92rem; }
.model-card .sum { font-size: .92rem; margin: 0; }
.codes { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.code { font-size: .75rem; font-weight: 600; background: var(--soft); border-radius: 6px; padding: 2px 7px; color: var(--ink); }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; vertical-align: middle; }
.badge.now { background: var(--now-bg); color: var(--now); }
.badge.past { background: var(--past-bg); color: var(--past); }
.empty { color: var(--muted); padding: 12px 0; }

/* Model page */
.page-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.page-head .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); }
.lede { font-size: 1.08rem; max-width: 780px; }
.gens { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
a.gen-card { display: grid; grid-template-columns: 120px 1fr; gap: 14px; text-decoration: none; color: var(--ink); }
a.gen-card:hover { border-color: var(--accent); }
.gen-card .when { font-weight: 700; font-variant-numeric: tabular-nums; }
.gen-card .when .code { display: inline-block; margin-top: 6px; font-size: .85rem; }
.gen-card h3 { color: var(--accent); margin-bottom: .25rem; }
.gen-card p { margin: 0 0 .35rem; font-size: .95rem; }
.family { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.family a { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 8px 12px; text-decoration: none; color: var(--ink); font-size: .95rem; }
.family a span { display: block; color: var(--muted); font-size: .8rem; }

/* Generation page */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; margin: 12px 0; }
.fact { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fact .k { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fact .v { font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--soft); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric { color: var(--muted); }
td.dim .metric::before { content: ' · '; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; padding: 0; margin: 8px 0; list-style: none; }
.pills li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: .9rem; }
ul.points { margin: 8px 0 0; padding-left: 1.2rem; }
ul.points li { margin-bottom: .35rem; }
.years-nav { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0 12px; }
.years-nav a { font-size: .85rem; font-variant-numeric: tabular-nums; border: 1px solid var(--line); background: var(--paper); border-radius: 6px; padding: 2px 8px; text-decoration: none; }
.year { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); scroll-margin-top: 12px; }
.year:target { background: var(--accent-soft); border-radius: 8px; }
.year .y { font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.year ul { margin: 0; padding-left: 1.1rem; }
.note { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; font-size: .93rem; }
.sources { font-size: .9rem; padding-left: 1.2rem; }
.sources li { margin-bottom: .25rem; word-break: break-word; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.pager a { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 10px 14px; text-decoration: none; max-width: 48%; }
.pager a span { display: block; font-size: .8rem; color: var(--muted); }
.pager .next { margin-left: auto; text-align: right; }

/* Timeline */
.tl { position: relative; margin: 16px 0; }
.tl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.tl-inner { position: relative; min-width: 900px; padding: 28px 12px 12px 150px; }
.tl-axis { position: absolute; top: 0; left: 150px; right: 12px; height: 100%; pointer-events: none; }
.tl-axis span { position: absolute; top: 6px; font-size: .75rem; color: var(--t-tick); transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.tl-axis i { position: absolute; top: 24px; bottom: 0; width: 1px; background: var(--t-grid); }
.tl-row { position: relative; height: 26px; margin: 3px 0; }
.tl-row .lbl { position: absolute; left: -142px; width: 134px; top: 3px; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.tl-row .lbl a { color: var(--ink); text-decoration: none; }
.tl-row .lbl a:hover { color: var(--accent); text-decoration: underline; }
.tl-seg { position: absolute; top: 5px; height: 16px; background: var(--t-bar); border-radius: 4px; box-shadow: 0 0 0 1px var(--paper); color: #fff; font-size: .7rem; font-weight: 600; line-height: 16px; padding: 0 4px; overflow: hidden; white-space: nowrap; text-decoration: none; min-width: 6px; }
.tl-seg.now { background: var(--t-now); }
.tl-seg:hover, .tl-seg:focus-visible { filter: brightness(1.15); }
@media (prefers-color-scheme: dark) { .tl-seg { color: #121410; } }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: 8px 0; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

@media (max-width: 640px) {
  a.gen-card { grid-template-columns: 1fr; gap: 6px; }
  .year { grid-template-columns: 1fr; gap: 4px; }
  .pager a { max-width: 100%; }
  td.dim .metric { display: block; }
  td.dim .metric::before { content: none; }
  .filters { position: static; }
}
