/* Base styles: fonts, reset, typography, forms, focus. Tokens come from tokens.css. */

@font-face {
  font-family: "Barlow Condensed";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url(/assets/fonts/barlow-condensed-700.87523287.woff2) format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url(/assets/fonts/barlow-condensed-800.95cdc5c4.woff2) format("woff2");
}
@font-face {
  font-family: "Inter";
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url(/assets/fonts/inter-var.78926162.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url(/assets/fonts/jetbrains-mono-400.5c250b86.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url(/assets/fonts/jetbrains-mono-600.e6b1c8d3.woff2) format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html[data-theme="light"] {
  color-scheme: light;
}
html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-ui);
  font-size: var(--type-body);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
}
h1 {
  font-size: var(--type-screen-title);
}
h2 {
  font-size: var(--type-question);
}
h3,
h4 {
  font-size: var(--type-body);
  letter-spacing: 0.02em;
}

p {
  margin: 0;
}

a {
  color: var(--c-link);
  text-underline-offset: 0.15em;
}

img,
svg {
  max-width: 100%;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

small,
.meta {
  font-size: var(--type-meta);
  color: var(--c-text-2);
}

/* Plates, km, dates, VIN, money. */
.mono,
data,
code,
kbd {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-size: var(--type-data);
}

/* Forms: 16 px minimum stops iOS zooming on focus. */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
input,
select,
textarea {
  font-size: max(16px, var(--type-body));
  min-height: var(--size-input);
  width: 100%;
  padding: 0 14px;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
}
textarea {
  padding-block: 12px;
  min-height: calc(var(--size-input) * 2);
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: 0;
}
label {
  font-weight: 600;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
button {
  cursor: pointer;
}
button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* htmx: its built-in <style> is disabled (CSP), so the indicator rules live here. */
.htmx-indicator {
  opacity: 0;
  transition: opacity 150ms ease-out;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
