/*
 * Autoshot's shared design layer: the typeface, the colour tokens and the few
 * components every page draws the same way (button, label, card, notice).
 *
 * Every page links this file after fonts.css and keeps only page-specific
 * rules inline. A token defined here is not redefined in a page's own :root.
 *
 * The rules this file exists to hold:
 *  - One typeface, Archivo, self-hosted (no request to Google: GDPR).
 *    Numbers align through tabular figures, not through a second mono font.
 *  - Red is the brand mark: the logo and the "shot" of the wordmark. It is not
 *    a button colour, a step colour or a selected state. Actions are ink.
 *  - Errors and destructive actions read from --danger, never from --red.
 *  - Nothing is set smaller than 11px; body copy is 14px or more.
 *
 * Loaded as /static/autoshot.css?v=N. The service worker serves /static/
 * cache-first, so bump N in every page whenever this file changes.
 */

/* Archivo latin-ext */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/archivo-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* Archivo latin */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/archivo-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* Archivo italic latin-ext */
@font-face {
  font-family: 'Archivo';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/archivo-latin-ext-wght-italic.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* Archivo italic latin */
@font-face {
  font-family: 'Archivo';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/archivo-latin-wght-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  /* Type. --mono is kept as a name because the pages use it for every label
     and figure; it now resolves to the same family as the body. */
  --sans: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: var(--sans);

  /* Brand. Logo mark and wordmark only. */
  --red: #cc0000;
  --red-dark: #a00000;

  /* Ink: text and the primary action. --ink-3 is the lightest text colour and
     clears 4.5:1 on --bg and --bg-2. --ink-4 is for rules and disabled marks,
     never for text. */
  --ink: #1a1714;
  --ink-hover: #332e29;
  --ink-2: #4a4540;
  --ink-3: #6b655f;
  --ink-4: #b0aba5;

  /* Surfaces and rules, warm neutrals. */
  --bg: #faf8f5;
  --bg-2: #f2efe9;
  --bg-3: #e8e4dc;
  --white: #ffffff;
  --border: #e2ddd5;
  --border-2: #d0cbc0;
  --border-strong: #4a4540;

  /* States. Each text colour clears 4.5:1 on its own -light surface. */
  --good: #0a7a4f;
  --good-light: #e6f5ee;
  --amber: #8a5a00;
  --amber-light: #fff4e0;
  --amber-border: #ecd9a8;
  --danger: #a3211b;
  --danger-light: #fbeceb;
  --danger-border: #efc6c3;

  /* Kept so older page rules still resolve: these two were the pink error
     surfaces. They are error colours now, not brand tints. */
  --red-light: var(--danger-light);
  --red-mid: var(--danger-border);

  /* Shape. */
  --radius-control: 8px;
  --radius-card: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(26, 23, 20, .06), 0 1px 3px rgba(26, 23, 20, .05);
  --shadow-md: 0 4px 16px rgba(26, 23, 20, .08), 0 2px 6px rgba(26, 23, 20, .04);
  --shadow-lg: 0 16px 48px rgba(26, 23, 20, .10), 0 4px 12px rgba(26, 23, 20, .06);
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-variant-numeric: inherit;
}

/* One focus ring everywhere: solid, 2px, in ink. A soft halo does not show on
   a phone in daylight, which is where a car gets photographed. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ── Wordmark ─────────────────────────────────────────────────────────── */
.as-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.as-logo b,
.as-logo .shot {
  font-weight: inherit;
  color: var(--red);
}

/* The hidden attribute loses to any class that sets display, so say it once
   for every shared component. */
[class^='as-'][hidden],
[class*=' as-'][hidden] {
  display: none !important;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.as-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.as-btn:disabled,
.as-btn[aria-disabled='true'] {
  opacity: .5;
  cursor: not-allowed;
}
.as-btn--lg {
  min-height: 52px;
  padding: 0 24px;
  font-size: 16px;
  line-height: 24px;
}
.as-btn--block {
  width: 100%;
}
/* The one filled action of a screen. */
.as-btn--ink {
  background: var(--ink);
  color: var(--white);
}
.as-btn--ink:hover:not(:disabled) {
  background: var(--ink-hover);
}
.as-btn--secondary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--border-2);
}
.as-btn--secondary:hover:not(:disabled) {
  border-color: var(--border-strong);
}
.as-btn--ghost {
  background: transparent;
  color: var(--ink);
}
.as-btn--ghost:hover:not(:disabled) {
  background: var(--bg-2);
}
/* Destructive: outlined, so it never competes with the filled action. */
.as-btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.as-btn--danger:hover:not(:disabled) {
  background: var(--danger-light);
}

/* ── Small pieces ─────────────────────────────────────────────────────── */
/* The smallest text on any page. */
.as-label {
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.as-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}

/* A notice states a fact the reader must know before acting. */
.as-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 16px;
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-card);
  background: var(--amber-light);
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
}
.as-notice--danger {
  border-color: var(--danger-border);
  background: var(--danger-light);
}
.as-notice--good {
  border-color: #bfe3d2;
  background: var(--good-light);
}

.as-num {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
