/* Base, layout, header, footer, and shared components */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-stretch: 100%;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.05; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--radius); }
::selection { background: var(--alpenglow); color: var(--obsidian); }
[hidden] { display: none !important; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 1000; background: var(--alpenglow); color: var(--obsidian); padding: 12px 16px; font-weight: 600; }
.skip-link:focus { top: 16px; }

/* ---------- Typography roles ---------- */
.t-display { font-size: var(--fs-display); font-stretch: 125%; font-weight: 600; letter-spacing: var(--track-display); text-transform: uppercase; line-height: .96; }
.t-h1 { font-size: var(--fs-h1); font-stretch: 118%; font-weight: 600; letter-spacing: .01em; line-height: 1; }
.t-h2 { font-size: var(--fs-h2); font-stretch: 112%; font-weight: 600; line-height: 1.05; }
.t-h3 { font-size: var(--fs-h3); font-stretch: 108%; font-weight: 600; line-height: 1.15; }
.t-lead { font-size: var(--fs-lead); color: var(--fg-muted); line-height: 1.5; max-width: 60ch; }
.t-label { font-size: var(--fs-micro); font-stretch: 125%; font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--fg-muted); }
.t-mono { font-family: var(--mono); font-size: .9em; letter-spacing: 0; }
.t-muted { color: var(--fg-muted); }
.t-small { font-size: var(--fs-small); }
.t-accent { color: var(--accent); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: 880px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 10vw, 144px); position: relative; }
.stack > * + * { margin-top: var(--s-5); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5); }
@media (max-width: 767px) { .grid-12 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); } }

/* ---------- The character line ---------- */
.cline { height: 1px; background: var(--line); box-shadow: var(--line-glow); border: 0; margin: 0; transform-origin: left center; }
.cline--v { width: 1px; height: auto; background: var(--line-v); }
.cline--quiet { box-shadow: none; opacity: .7; }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }
[data-draw] { transform: scaleX(0); transition: transform var(--dur-reveal) var(--ease-glide); }
[data-draw].is-in { transform: scaleX(1); }
[data-draw="v"] { transform: scaleY(0); transform-origin: center top; }
[data-draw="v"].is-in { transform: scaleY(1); }

/* Generic reveal — transform/opacity only */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-cine) var(--ease-precise), transform var(--dur-cine) var(--ease-precise); transition-delay: calc(var(--i, 0) * 70ms); }
[data-reveal].is-in { opacity: 1; transform: none; }
[data-tier="essential"] [data-reveal], [data-tier="essential"] [data-draw] { opacity: 1; transform: none; transition: none; }
.no-js [data-reveal], .no-js [data-draw] { opacity: 1; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center;
  transition: background-color var(--dur-ui) var(--ease-precise), border-color var(--dur-ui) var(--ease-precise), transform var(--dur-section) var(--ease-precise);
  border-bottom: 1px solid transparent;
}
.site-header.is-solid { background: rgb(16 20 25 / .82); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-bottom-color: var(--rule); }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header .wrap { display: flex; align-items: center; gap: var(--s-6); }
.brand { display: flex; align-items: center; color: var(--white); text-decoration: none; flex: none; }
.brand svg { height: 26px; width: auto; }
.brand .brand-mono { display: none; height: 22px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: var(--s-1); }
.nav a {
  position: relative; padding: 10px 12px; text-decoration: none; white-space: nowrap;
  font-size: var(--fs-micro); font-stretch: 125%; font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--silver);
  transition: color var(--dur-feedback) linear;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--white); }
.nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 1px; background: var(--line); transform: scaleX(0); transition: transform var(--dur-ui) var(--ease-precise); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.header-tools { display: flex; align-items: center; gap: var(--s-2); }
.icon-btn { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border: 1px solid var(--rule); background: transparent; border-radius: var(--radius); color: var(--silver); text-decoration: none; gap: 6px; grid-auto-flow: column; font-size: var(--fs-micro); font-weight: 600; letter-spacing: .08em; transition: border-color var(--dur-feedback), color var(--dur-feedback); }
.icon-btn:hover { border-color: var(--rule-strong); color: var(--white); }
.icon-btn svg { width: 18px; height: 18px; }
.garage-count { font-family: var(--mono); color: var(--alpenglow); }
.menu-btn { display: none; }

@media (max-width: 1199px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
  .header-tools { margin-left: auto; }
  .brand svg.brand-lockup { height: 22px; }
}
@media (max-width: 479px) {
  .brand svg.brand-lockup { display: none; }
  .brand .brand-mono { display: block; }
  .header-tools .motion-toggle .label { display: none; }
}

/* Mobile sheet */
.sheet { position: fixed; inset: 0; z-index: 60; background: var(--obsidian); display: flex; flex-direction: column; padding: calc(var(--header-h) + 8px) var(--gutter) 32px; overflow-y: auto; opacity: 0; visibility: hidden; transition: opacity var(--dur-ui) var(--ease-precise), visibility 0s linear var(--dur-ui); }
.sheet.is-open { opacity: 1; visibility: visible; transition: opacity var(--dur-ui) var(--ease-precise); }
.sheet-close { position: absolute; top: 14px; right: var(--gutter); }
.sheet nav a { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0; text-decoration: none; font-size: clamp(1.6rem, 7vw, 2.4rem); font-stretch: 125%; font-weight: 600; text-transform: uppercase; border-bottom: 1px solid var(--rule); }
.sheet nav a span { font-family: var(--mono); font-size: .8rem; color: var(--fg-faint); font-stretch: 100%; }
.sheet .sheet-foot { margin-top: auto; padding-top: 32px; display: grid; gap: 12px; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent; --btn-fg: var(--fg); --btn-bd: var(--rule-strong);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 26px; border: 1px solid var(--btn-bd); border-radius: var(--radius);
  background: var(--btn-bg); color: var(--btn-fg); text-decoration: none; overflow: hidden; isolation: isolate;
  font-size: var(--fs-micro); font-stretch: 125%; font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; white-space: nowrap;
  transition: border-color var(--dur-ui) var(--ease-precise), color var(--dur-ui) var(--ease-precise), background-color var(--dur-ui) var(--ease-precise), transform var(--dur-feedback) var(--ease-precise);
}
/* Light rake on hover: the character line passes across the button */
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, transparent 30%, rgb(243 200 150 / .22) 50%, transparent 70%); transform: translateX(-110%); transition: transform var(--dur-cine) var(--ease-glide); }
.btn:hover::before { transform: translateX(110%); }
.btn:hover { border-color: var(--fg-muted); }
.btn:active { transform: translateY(1px); }
.btn .arrow { width: 18px; height: 10px; transition: transform var(--dur-ui) var(--ease-precise); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--accent-fg); --btn-bd: var(--accent); }
.btn--primary:hover { --btn-bg: var(--alpenglow-hi); border-color: var(--alpenglow-hi); }
.btn--light { --btn-bg: var(--white); --btn-fg: var(--obsidian); --btn-bd: var(--white); }
.btn--ghost { --btn-bd: transparent; padding-inline: 12px; }
.btn--sm { min-height: 40px; padding: 0 16px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); animation: busy 1.1s var(--ease-glide) infinite; }
@keyframes busy { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.link-arrow { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: var(--fs-micro); font-stretch: 125%; font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--accent); }
.link-arrow:hover .arrow { transform: translateX(4px); }
.link-arrow .arrow { width: 18px; height: 10px; transition: transform var(--dur-ui) var(--ease-precise); }

/* ---------- Chips / tags ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--rule-strong); border-radius: 99px; font-size: var(--fs-micro); letter-spacing: .04em; color: var(--fg-muted); white-space: nowrap; }
.chip--accent { border-color: var(--accent); color: var(--accent); }
.chip--sample { border-color: var(--alpenglow); color: var(--alpenglow); background: rgb(231 168 106 / .08); font-weight: 600; }
.badge-status { font-family: var(--mono); font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 8px; align-content: start; }
.field > label, .field > .label, fieldset > legend { font-size: var(--fs-micro); font-stretch: 125%; font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--fg-muted); }
.field .hint { font-size: var(--fs-small); color: var(--fg-faint); }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--bg-raised); border: 1px solid var(--rule-strong); color: var(--fg);
  transition: border-color var(--dur-feedback), box-shadow var(--dur-feedback);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus), 0 6px 18px -10px var(--alpenglow); }
.input::placeholder, .textarea::placeholder { color: var(--fg-faint); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.field .error { color: var(--danger); font-size: var(--fs-small); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-small); color: var(--fg-muted); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Segmented choice tiles (radio/checkbox) */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(var(--c, 2), minmax(0, 1fr)); }
/* Column count follows the option count so rows always fill evenly. */
.choices:has(> :last-child:nth-child(3)) { --c: 3; }
.choices:has(> :last-child:nth-child(4)) { --c: 4; }
.choices:has(> :last-child:nth-child(5)) { --c: 5; }
.choices:has(> :last-child:nth-child(6)) { --c: 3; }
.choices:has(> :last-child:nth-child(9)) { --c: 3; }
@media (max-width: 899px) { .choices:has(> :last-child:nth-child(4)) { --c: 2; } }
@media (max-width: 599px) {
  .choices:has(> :last-child:nth-child(3)), .choices:has(> :last-child:nth-child(5)),
  .choices:has(> :last-child:nth-child(6)), .choices:has(> :last-child:nth-child(9)) { --c: 1; }
}
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 12px 16px; border: 1px solid var(--rule-strong); border-radius: var(--radius); font-weight: 500; transition: border-color var(--dur-feedback), background-color var(--dur-feedback); }
.choice small { color: var(--fg-faint); font-weight: 400; font-size: var(--fs-small); }
.choice input:hover + span { border-color: var(--fg-muted); }
.choice input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 0 -2px 0 var(--accent); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Form status */
.notice { padding: 16px 20px; border-left: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); font-size: var(--fs-small); }
.notice--error { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.notice--sample { border-color: var(--alpenglow); }

/* ---------- Vehicle card ---------- */
.vcard { position: relative; display: flex; flex-direction: column; background: var(--obsidian-2); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; transition: border-color var(--dur-ui) var(--ease-precise), transform var(--dur-section) var(--ease-precise); }
.vcard:hover { border-color: var(--rule-strong); }
.vcard__media { position: relative; aspect-ratio: 16 / 10; background: var(--obsidian-3); overflow: hidden; }
.vcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-cine) var(--ease-precise), opacity var(--dur-section) linear; }
.vcard:hover .vcard__media img { transform: scale(1.03); }
.vcard__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgb(243 200 150 / .14) 50%, transparent 65%); transform: translateX(-100%); transition: transform var(--dur-cine) var(--ease-glide); pointer-events: none; }
.vcard:hover .vcard__media::after { transform: translateX(100%); }
.vcard__noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--graphite-2); }
.vcard__noimg svg { width: 45%; opacity: .5; }
.vcard__body { display: grid; gap: 6px; padding: 18px 20px 20px; flex: 1; }
.vcard__year { font-family: var(--mono); font-size: var(--fs-small); color: var(--fg-faint); }
.vcard__title { font-size: 1.2rem; font-stretch: 112%; font-weight: 600; line-height: 1.15; }
.vcard__title a { text-decoration: none; }
.vcard__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.vcard__trim { color: var(--fg-muted); font-size: var(--fs-small); }
.vcard__meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: var(--fs-small); color: var(--fg-muted); }
.vcard__price { font-family: var(--font); font-stretch: 112%; font-weight: 600; font-size: 1.15rem; color: var(--fg); }
.vcard__tools { position: absolute; top: 10px; right: 10px; z-index: 2; display: flex; gap: 6px; }
.vcard__flag { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; gap: 6px; }
.tool-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgb(245 244 240 / .2); background: rgb(16 20 25 / .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--white); transition: background-color var(--dur-feedback), border-color var(--dur-feedback), transform var(--dur-feedback); }
.tool-btn:hover { border-color: var(--white); }
.tool-btn svg { width: 18px; height: 18px; }
.tool-btn[aria-pressed="true"] { background: var(--alpenglow); color: var(--obsidian); border-color: var(--alpenglow); }
.tool-btn.pulse { animation: pulse var(--dur-section) var(--ease-precise); }
@keyframes pulse { 50% { transform: scale(1.18); } }

/* ---------- Footer ---------- */
.site-footer { position: relative; padding: 96px 0 40px; background: var(--obsidian); border-top: 1px solid var(--rule); }
.site-footer .cline { position: absolute; top: -1px; left: 0; right: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s-7); }
.footer-grid h2 { margin-bottom: 16px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-grid a { text-decoration: none; color: var(--silver); }
.footer-grid a:hover { color: var(--white); }
.footer-brand svg { height: 30px; width: auto; color: var(--white); margin-bottom: 20px; }
.footer-legal { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: var(--fs-small); color: var(--fg-faint); }
.footer-legal a { color: inherit; }
@media (max-width: 767px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Sample-data banner */
.sample-banner { position: fixed; inset: 0 0 auto 0; height: 32px; z-index: 51; background: var(--alpenglow); color: var(--obsidian); font-size: var(--fs-micro); font-weight: 600; line-height: 32px; text-align: center; padding: 0 var(--gutter); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.has-banner .site-header { top: 32px; }
.has-banner main { padding-top: 32px; }

/* Page header band used on interior pages */
.page-head { padding: calc(var(--header-h) + clamp(48px, 8vw, 112px)) 0 clamp(40px, 6vw, 72px); position: relative; }
.page-head .t-label { display: block; margin-bottom: 18px; }
.page-head .t-lead { margin-top: 20px; }
.page-head .cline { position: absolute; bottom: 0; left: 0; right: 0; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; padding: 14px 20px; background: var(--white); color: var(--obsidian); border-radius: var(--radius); font-size: var(--fs-small); font-weight: 500; box-shadow: 0 20px 50px -20px rgb(0 0 0 / .6); transition: opacity var(--dur-ui) var(--ease-precise), transform var(--dur-ui) var(--ease-precise); pointer-events: none; max-width: calc(100vw - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Cross-document View Transitions: the line sweep */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out var(--dur-section) var(--ease-exit) both; }
::view-transition-new(root) { animation: vt-in var(--dur-section) var(--ease-precise) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
::view-transition-group(vehicle-hero) { animation-duration: var(--dur-cine); animation-timing-function: var(--ease-glide); }
::view-transition-group(site-header) { animation: none; }
.site-header { view-transition-name: site-header; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Mobile app bar: thumb-reach primary actions ---------- */
.appbar { display: none; }
@media (max-width: 767px) {
  .appbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgb(16 20 25 / .9); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-top: 1px solid var(--rule); }
  .appbar a { display: grid; justify-items: center; gap: 4px; padding: 8px 0 6px; min-height: 52px; text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--silver); border-radius: var(--radius); }
  .appbar a svg { width: 20px; height: 20px; }
  .appbar a[aria-current="page"] { color: var(--alpenglow); }
  .appbar .appbar__call, .appbar .appbar__call[aria-current="page"] { background: var(--alpenglow); color: var(--obsidian); }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .compare-tray { bottom: calc(66px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .header-tools .icon-btn[href="/garage"] { display: none; }
}

/* Legends used as headings keep heading styling, not the label treatment */
legend.t-h2, legend.t-h3 { text-transform: none; letter-spacing: 0; color: var(--fg); font-weight: 600; }
legend.t-h2 { font-stretch: 112%; margin-bottom: 4px; }
legend.t-h3 { font-stretch: 108%; margin-bottom: 4px; }

/* Checkbox labels inside fields read as sentences, not as uppercase field labels */
.field > label.check { font-size: var(--fs-small); font-stretch: 100%; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--fg-muted); line-height: 1.5; }
.form-hint { margin: -4px 0 0; color: var(--fg-faint); font-size: var(--fs-small); }
