/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body) / var(--lh-body) var(--font-ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; } /* wins over any display: flex/grid on the same element */
img { height: auto; -webkit-user-drag: none; user-select: none; } /* no drag ghosts */
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 4px; }
main[tabindex="-1"]:focus, main[tabindex="-1"]:focus-visible { outline: none; } /* skip-link target, not a control */
::selection { background: var(--accent-tint); color: var(--accent-ink); }
svg.lucide { width: var(--icon, 20px); height: var(--icon, 20px); flex: none; }

/* Typography */
h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.08; }
h2 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 600; }
h3 { font-size: var(--fs-h3); }
h4 { font-size: 17px; }
p { max-width: 68ch; }
.lead { font-size: 18px; color: var(--muted); }
.small { font-size: var(--fs-small); }
.tiny { font-size: var(--fs-tiny); }
.muted { color: var(--muted); }
.accent { color: var(--accent-text); }
.eyebrow {
  display: inline-block;
  font-size: var(--fs-tiny); font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-text);
}
.text-center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.band { background: var(--surface-2); }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack--lg { gap: var(--s-6); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.row--between { justify-content: space-between; }
.row--center { justify-content: center; }
.grid { display: grid; gap: var(--s-5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }
.mt-2 { margin-top: var(--s-2); } .mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); }
@media (max-width: 760px) { .hide-mobile { display: none !important; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--btn-h); padding: 0 var(--s-5);
  border-radius: var(--radius-pill); border: 1px solid transparent;
  font-weight: 600; font-size: 15px; line-height: 1; white-space: nowrap;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn svg.lucide { --icon: 18px; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--ink); } /* ink, not white: white on the accent fails AA */
.btn--primary:hover { background: var(--accent-hover); }
.btn--outline { border-color: var(--accent); color: var(--accent-text); }
.btn--outline:hover { background: var(--accent-tint); color: var(--accent-ink); }
.btn--ghost { color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: #e9ecec; }
.btn--lg { height: 52px; padding: 0 var(--s-6); font-size: 16px; }
.btn--sm { height: 36px; padding: 0 var(--s-4); font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled, .btn[aria-disabled="true"] {
  background: var(--surface-2); color: var(--muted); border-color: var(--border); pointer-events: none;
}
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--btn-h); height: var(--btn-h);
  border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon--primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn-icon--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-icon--square { border-radius: var(--radius-sm); width: var(--control-h); height: var(--control-h); }
.link { color: var(--accent-text); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link svg.lucide { --icon: 16px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label {
  font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.input {
  width: 100%; height: var(--control-h); padding: 0 var(--s-4);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.input:focus-visible { outline: none; } /* the accent border + ring above is the focus style */
.input:disabled { background: var(--surface-2); color: var(--muted); }
textarea.input { height: auto; min-height: 128px; padding-block: var(--s-3); resize: vertical; }
select.input { padding-right: 40px; }
.select-wrap { position: relative; }
.select-wrap > svg.lucide { position: absolute; right: 14px; top: 50%; translate: 0 -50%; color: var(--muted); --icon: 16px; pointer-events: none; }
input[type="date"].input, input[type="time"].input, input[type="datetime-local"].input { min-width: 0; }
input[type="date"].input::-webkit-calendar-picker-indicator,
input[type="time"].input::-webkit-calendar-picker-indicator,
input[type="datetime-local"].input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
[data-theme="dark"] input[type="date"].input::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"].input::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"].input::-webkit-calendar-picker-indicator { filter: invert(1); }
.input-wrap { position: relative; }
.input-wrap > svg.lucide { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); --icon: 18px; pointer-events: none; }
.input-wrap > .input { padding-left: 42px; }
.field__hint { font-size: var(--fs-tiny); color: var(--muted); }
.field__error { font-size: var(--fs-tiny); font-weight: 600; color: var(--text); display: none; }
.field.has-error .field__error { display: block; }
.field.has-error .input { border-color: var(--text); }
.checkbox, .radio { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.checkbox input, .radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-text); }
.range { width: 100%; accent-color: var(--accent-text); height: 28px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 42px; height: 24px; border-radius: var(--radius-pill); background: var(--border); position: relative; flex: none;
  transition: background-color var(--t-fast);
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-sm); transition: transform var(--t-fast);
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent-text); outline-offset: 3px; }

/* Segmented control */
.segmented {
  display: inline-flex; padding: 4px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill);
}
.segmented__btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 18px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.segmented__btn svg.lucide { --icon: 16px; }
.segmented__btn:hover { color: var(--text); }
.segmented__btn:focus-visible { outline-offset: -2px; }
.segmented__btn[aria-pressed="true"], .segmented__btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .segmented__btn[aria-pressed="true"], [data-theme="dark"] .segmented__btn.is-active { background: var(--accent-tint); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--border); }
.segmented--block { display: flex; } .segmented--block .segmented__btn { flex: 1; justify-content: center; min-width: 0; padding: 0 8px; gap: 6px; }
@media (max-width: 960px) { .segmented__btn { height: 40px; } }


/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card--pad { padding: var(--s-5); }
.card--lift { transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.card--lift:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .02em; color: var(--text); white-space: nowrap;
}
.chip svg.lucide { --icon: 14px; }
.chip--accent { background: var(--accent-tint); border-color: transparent; color: var(--accent-ink); }
.chip--muted { color: var(--muted); }
.chip--solid { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* Scroll reveal: only hidden once reveal.js has registered (html.has-reveal) */
html.has-reveal .reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--t-reveal) ease, transform var(--t-reveal) var(--ease); }
html.has-reveal .reveal.is-visible { opacity: 1; transform: none; }
.reveal--delay-1 { transition-delay: 80ms !important; }
.reveal--delay-2 { transition-delay: 160ms !important; }
.reveal--delay-3 { transition-delay: 240ms !important; }
html[data-shot] .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  html.has-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .card--lift, .btn, .car-card__photo img { transition: none; }
}
