/* ==========================================================================
   Luxury Car Deals design system
   Ink + paper + Giallo (the logo yellow). Instrument Serif for display type,
   Inter for UI and numbers.

   1. Fonts        5. Buttons & forms     9. Data viz (stats, range, ladder)
   2. Tokens       6. Badges & chips     10. Content (prose, FAQ, tables)
   3. Base         7. Cards              11. Site header & footer
   4. Layout       8. Search             12. Utilities
   ========================================================================== */

/* 1. Fonts (self-hosted, latin + latin-ext) ------------------------------- */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/inter-latin.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;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/inter-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Instrument Serif";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/instrument-serif-latin.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;
}

@font-face {
    font-family: "Instrument Serif";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/instrument-serif-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Instrument Serif";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/instrument-serif-italic-latin.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;
}

@font-face {
    font-family: "Instrument Serif";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/instrument-serif-italic-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* 2. Tokens ------------------------------------------------------------- */

:root {
    /* Brand */
    --brand: #FFDE59;
    --brand-strong: #FFD52E;
    --brand-ink: #18150A;
    --brand-tint: #FFF6CF;

    /* Ink: header, footer, heroes, data panels */
    --ink: #0B0B0C;
    --ink-2: #151517;
    --ink-3: #222226;
    --ink-line: rgba(255, 255, 255, 0.1);
    --on-ink: #F6F5F1;
    --on-ink-2: rgba(246, 245, 241, 0.72);
    --on-ink-3: rgba(246, 245, 241, 0.5);

    /* Paper: page and content surfaces */
    --paper: #F6F5F1;
    --surface: #FFFFFF;
    --surface-2: #EFEDE6;
    --line: #E5E2D9;
    --line-strong: #CFCBBF;
    --text: #111113;
    --text-2: #55555D;
    --text-3: #7E7E86;

    /* Semantic */
    --good: #0F9158;
    --good-strong: #0A7446;
    --good-tint: #E1F4E9;
    --good-on-ink: #4ADE80;
    --warn: #B26A0C;
    --warn-tint: #FCF0DA;
    --bad: #C93A3A;
    --bad-tint: #FBE6E4;
    --bad-on-ink: #FF8A80;

    /* Type */
    --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    /* Shape */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    /* Elevation */
    --shadow-1: 0 1px 2px rgba(17, 17, 19, 0.06);
    --shadow-2: 0 14px 34px -16px rgba(17, 17, 19, 0.28);
    --shadow-3: 0 32px 64px -24px rgba(17, 17, 19, 0.45);

    /* Layout */
    --container: 1240px;
    --gutter: clamp(16px, 4vw, 32px);
    --header-h: 64px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    /* Legacy aliases: templates written against the old palette keep working. */
    --primary: var(--ink);
    --primary-dark: #000000;
    --primary-light: var(--surface-2);
    --secondary: var(--good);
    --success: var(--good);
    --accent: var(--brand);
    --dark: var(--text);
    --gray: var(--text-2);
    --light: var(--surface-2);
    --white: var(--surface);
    --shadow-sm: var(--shadow-1);
    --shadow: var(--shadow-1);
    --shadow-md: var(--shadow-2);
    --shadow-lg: var(--shadow-2);
    --shadow-xl: var(--shadow-3);
    --radius: var(--radius-sm);
}

/* 3. Base --------------------------------------------------------------- */

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

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img,
svg,
video,
picture {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
}

ul[role="list"],
ol[role="list"] {
    list-style: none;
}

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

.on-ink :focus-visible,
.site-header :focus-visible,
.site-footer :focus-visible {
    outline-color: var(--brand);
}

::selection {
    background: var(--brand);
    color: var(--brand-ink);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Type scale */

.display,
.h1,
.h2,
.section-title {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.02;
    text-wrap: balance;
}

.display {
    font-size: clamp(2.75rem, 1.35rem + 5.4vw, 5.75rem);
}

.h1 {
    font-size: clamp(2.375rem, 1.6rem + 3.2vw, 4.25rem);
}

.h2,
.section-title {
    font-size: clamp(2rem, 1.5rem + 1.9vw, 3rem);
}

.display em,
.h1 em,
.h2 em,
.section-title em {
    font-style: italic;
}

.h3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.h4 {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.35;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
}

.eyebrow-dot::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 222, 89, 0.25);
}

.lede {
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    line-height: 1.55;
    color: var(--text-2);
    text-wrap: pretty;
}

.muted {
    color: var(--text-2);
}

.subtle {
    color: var(--text-3);
}

.small {
    font-size: 0.875rem;
}

.num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.9em;
    letter-spacing: 0.02em;
}

.text-good {
    color: var(--good);
}

.text-bad {
    color: var(--bad);
}

.highlight {
    background: linear-gradient(transparent 62%, rgba(255, 222, 89, 0.85) 62%);
    padding: 0 0.08em;
}

/* 4. Layout ------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container-narrow {
    max-width: 880px;
}

.section {
    padding-block: clamp(56px, 4.5vw + 32px, 112px);
}

.section-tight {
    padding-block: clamp(40px, 3vw + 20px, 72px);
}

.section-alt {
    background: var(--surface);
    border-block: 1px solid var(--line);
}

.section-ink,
.on-ink {
    background: var(--ink);
    color: var(--on-ink);
}

.section-ink .eyebrow,
.on-ink .eyebrow {
    color: var(--on-ink-3);
}

.section-ink .lede,
.on-ink .lede,
.section-ink .muted,
.on-ink .muted {
    color: var(--on-ink-2);
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
    margin-bottom: clamp(24px, 2.5vw + 8px, 44px);
}

.section-head > :first-child {
    max-width: 760px;
}

.section-head .eyebrow {
    margin-bottom: 14px;
}

.section-head .lede {
    margin-top: 14px;
}

.grid {
    display: grid;
    gap: clamp(16px, 1.6vw, 24px);
}

.grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.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-3,
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.stack {
    display: flex;
    flex-direction: column;
    gap: var(--stack-gap, 16px);
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--cluster-gap, 8px);
}

.dot-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 0;
    list-style: none;
}

.dot-list > * + *::before {
    content: "·";
    margin: 0 0.45em;
    opacity: 0.6;
}

/* 5. Buttons & forms ---------------------------------------------------- */

.btn {
    --btn-h: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--btn-h);
    padding: 0 1.125rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.005em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"],
.btn.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.btn svg,
.btn .icon {
    width: 18px;
    height: 18px;
    flex: none;
}

.btn-primary {
    background: var(--brand);
    color: var(--brand-ink);
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14), 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
    background: var(--brand-strong);
    color: var(--brand-ink);
}

.btn-dark {
    background: var(--ink);
    color: var(--on-ink);
}

.btn-dark:hover {
    background: var(--ink-3);
    color: var(--on-ink);
}

.btn-outline,
.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--line-strong);
}

.btn-outline:hover,
.btn-secondary:hover {
    border-color: var(--text);
    background: rgba(17, 17, 19, 0.03);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
}

.btn-ghost:hover {
    background: rgba(17, 17, 19, 0.06);
}

.on-ink .btn-outline,
.section-ink .btn-outline,
.site-header .btn-outline,
.site-footer .btn-outline {
    color: var(--on-ink);
    border-color: rgba(255, 255, 255, 0.24);
}

.on-ink .btn-outline:hover,
.section-ink .btn-outline:hover,
.site-header .btn-outline:hover,
.site-footer .btn-outline:hover {
    border-color: var(--on-ink);
    background: rgba(255, 255, 255, 0.06);
}

.on-ink .btn-ghost,
.section-ink .btn-ghost,
.site-header .btn-ghost {
    color: var(--on-ink-2);
}

.on-ink .btn-ghost:hover,
.section-ink .btn-ghost:hover,
.site-header .btn-ghost:hover {
    color: var(--on-ink);
    background: rgba(255, 255, 255, 0.08);
}

.btn-sm {
    --btn-h: 36px;
    padding: 0 0.875rem;
    font-size: 0.875rem;
}

.btn-lg {
    --btn-h: 54px;
    padding: 0 1.5rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: var(--btn-h);
    padding: 0;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    color: inherit;
}

.link-arrow::after {
    content: "→";
    transition: transform 0.2s var(--ease);
}

.link-arrow:hover::after {
    transform: translateX(3px);
}

.field {
    display: grid;
    gap: 6px;
}

.label,
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-2);
}

.input,
.select,
.textarea,
.form-input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

.textarea,
textarea.form-input {
    padding: 12px 14px;
    min-height: 120px;
    line-height: 1.55;
    resize: vertical;
}

.select,
select.form-input {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2355555D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.input:focus,
.select:focus,
.textarea:focus,
.form-input:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(11, 11, 12, 0.12);
}

.input::placeholder,
.textarea::placeholder,
.form-input::placeholder {
    color: var(--text-3);
}

.input-lg {
    min-height: 56px;
    font-size: 1.0625rem;
}

.otp-input {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    text-align: center;
    text-indent: 0.5em;
}

.help,
.form-help {
    font-size: 0.8125rem;
    color: var(--text-3);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.45;
}

.alert-error {
    background: var(--bad-tint);
    border-color: #F1C5C0;
    color: #8F2222;
}

.alert-success {
    background: var(--good-tint);
    border-color: #BCE5CD;
    color: var(--good-strong);
}

.alert-info {
    background: var(--brand-tint);
    border-color: #F3E2A0;
    color: #5C4A00;
}

/* 6. Badges & chips ----------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 9px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.005em;
    white-space: nowrap;
}

.badge svg {
    width: 13px;
    height: 13px;
}

.badge-deal {
    background: var(--good-tint);
    color: var(--good-strong);
}

.badge-brand {
    background: var(--brand);
    color: var(--brand-ink);
}

.badge-ink {
    background: var(--ink);
    color: var(--on-ink);
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--text-2);
}

.badge-glass {
    background: rgba(11, 11, 12, 0.64);
    color: #FFFFFF;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.badge-glass.badge-deal {
    background: rgba(10, 116, 70, 0.88);
    color: #FFFFFF;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.chip:hover {
    border-color: var(--text);
}

.chip img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.chip .count {
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.on-ink .chip,
.section-ink .chip {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--on-ink);
}

.on-ink .chip:hover,
.section-ink .chip:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
}

.on-ink .chip .count,
.section-ink .chip .count {
    color: var(--on-ink-3);
}

/* Deal rating: great / good / fair / high */
.rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.rating::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.rating-great {
    color: var(--good);
}

.rating-good {
    color: #4D8F2F;
}

.rating-fair {
    color: var(--warn);
}

.rating-high {
    color: var(--bad);
}

/* 7. Cards -------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.card-pad {
    padding: clamp(20px, 2vw + 8px, 32px);
}

a.card,
.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

a.card:hover,
.card-link:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

/* Car card: listing tile used in grids */
.car-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.car-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-2);
    transform: translateY(-3px);
}

.car-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--ink) url("/images/coming-soon.webp") center / cover no-repeat;
}

.car-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.car-card:hover .car-card__media img {
    transform: scale(1.035);
}

.car-card__badges {
    position: absolute;
    inset: 12px 12px auto 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    pointer-events: none;
}

.car-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px 18px;
}

.car-card__meta {
    font-size: 0.8125rem;
    color: var(--text-3);
}

.car-card__title {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.012em;
    line-height: 1.3;
}

.car-card__sub {
    font-size: 0.875rem;
    color: var(--text-2);
    line-height: 1.4;
}

.car-card__foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
}

.car-card__price-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-3);
    line-height: 1.3;
}

.car-card__price {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.car-card__cta {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line);
    color: var(--text);
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.car-card__cta svg {
    width: 16px;
    height: 16px;
}

.car-card:hover .car-card__cta {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--on-ink);
}

/* Brand tile: logo + name */
.brand-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.brand-tile:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-2);
    transform: translateY(-2px);
}

.brand-tile__logo {
    flex: none;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--paper);
}

.brand-tile__logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.brand-tile__name {
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    text-transform: capitalize;
}

.brand-tile__meta {
    font-size: 0.8125rem;
    color: var(--text-3);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(11, 11, 12, 0.62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.modal.is-open {
    display: flex;
}

.modal__dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-3);
}

.modal__header {
    padding: 28px 28px 0;
}

.modal__body {
    padding: 20px 28px 28px;
}

.modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-2);
    font-size: 1.375rem;
    line-height: 1;
}

.modal__close:hover {
    background: var(--surface-2);
    color: var(--text);
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, #F8F7F3 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: lcd-shimmer 1.4s linear infinite;
    border-radius: var(--radius-lg);
}

@keyframes lcd-shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@keyframes lcd-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.fade-in {
    animation: lcd-rise 0.5s var(--ease) both;
}

/* 8. Search ------------------------------------------------------------- */

.search-form {
    position: relative;
}

.search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 6px 6px 6px 18px;
    box-shadow: var(--shadow-1);
}

.search:focus-within {
    border-color: var(--ink);
}

.search__icon {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--text-3);
}

.search__input {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
}

.search__input::placeholder {
    color: var(--text-3);
}

.search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.search-lg {
    padding: 8px 8px 8px 22px;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
    border-color: transparent;
}

.search-lg .search__input {
    height: 52px;
    font-size: 1.0625rem;
}

.search__results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 950;
    max-height: min(440px, 70vh);
    overflow-y: auto;
    padding: 6px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-3);
    text-align: left;
}

.search__results[hidden] {
    display: none;
}

.search__option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.search__option:hover,
.search__option.is-active {
    background: var(--paper);
}

.search__option img {
    flex: none;
    width: 64px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius-xs);
    background: var(--ink);
}

.search__option-text {
    display: grid;
    min-width: 0;
}

.search__option-title {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search__option-meta {
    font-size: 0.8125rem;
    color: var(--text-3);
}

.search__option-price {
    margin-left: auto;
    flex: none;
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.search__empty {
    padding: 14px 12px;
    font-size: 0.875rem;
    color: var(--text-3);
}

.search__all {
    display: block;
    margin-top: 4px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.search__all:hover {
    text-decoration: underline;
}

/* 9. Data viz ----------------------------------------------------------- */

/* Data panel: the dark "terminal" card used for market numbers */
.data-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(20px, 2vw + 10px, 32px);
    background: var(--ink);
    color: var(--on-ink);
    border-radius: var(--radius-xl);
    isolation: isolate;
}

.data-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(120% 90% at 100% 0%, rgba(255, 222, 89, 0.12), transparent 55%);
    pointer-events: none;
}

.data-panel .eyebrow {
    color: var(--on-ink-3);
}

.big-number {
    font-size: clamp(2.5rem, 1.9rem + 2.2vw, 3.75rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.delta-good {
    color: var(--good);
}

.delta-bad {
    color: var(--bad);
}

.on-ink .delta-good,
.data-panel .delta-good {
    color: var(--good-on-ink);
}

.on-ink .delta-bad,
.data-panel .delta-bad {
    color: var(--bad-on-ink);
}

/* Stat row: hairline-divided numbers. Flex rather than grid, so a short last
   row stretches instead of leaving an empty cell. */
.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.stat {
    flex: 1 1 140px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    background: var(--surface);
}

.stat__label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
}

.stat__value {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
}

.stat__note {
    font-size: 0.8125rem;
    color: var(--text-3);
}

.on-ink .stat-row,
.data-panel .stat-row {
    background: var(--ink-line);
    border-color: var(--ink-line);
}

.on-ink .stat,
.data-panel .stat {
    background: var(--ink);
}

.on-ink .stat__label,
.data-panel .stat__label,
.on-ink .stat__note,
.data-panel .stat__note {
    color: var(--on-ink-3);
}

/* Range bar: where a price sits between the cheapest and priciest listing */
.range {
    --range-track: rgba(17, 17, 19, 0.1);
    --range-band: rgba(17, 17, 19, 0.22);
    --range-avg: var(--text);
    --range-deal: var(--good);
}

.on-ink .range,
.data-panel .range {
    --range-track: rgba(255, 255, 255, 0.12);
    --range-band: rgba(255, 255, 255, 0.3);
    --range-avg: var(--on-ink);
    --range-deal: var(--good-on-ink);
}

.range__track {
    position: relative;
    height: 8px;
    margin: 18px 0 10px;
    border-radius: var(--radius-pill);
    background: var(--range-track);
}

.range__band {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: var(--radius-pill);
    background: var(--range-band);
}

.range__pin {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    border-radius: 50%;
    transform: translateY(-50%);
    border: 3px solid var(--ink);
    background: var(--range-avg);
}

.range__pin--deal {
    background: var(--range-deal);
}

.range__pin--avg {
    width: 4px;
    height: 22px;
    margin-left: -2px;
    border: 0;
    border-radius: 2px;
}

.range__ends {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-3);
}

.on-ink .range__ends,
.data-panel .range__ends {
    color: var(--on-ink-3);
}

.range__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 14px;
    list-style: none;
    font-size: 0.8125rem;
}

.range__legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.range__legend strong {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--range-avg);
}

.legend-swatch--deal {
    background: var(--range-deal);
}

.legend-swatch--band {
    width: 18px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--range-band);
}

/* Price ladder: horizontal bars, one row per model year */
/* Rows share the list's columns (subgrid), so every bar starts and ends in
   the same place whatever the width of each label and value. Browsers
   without subgrid keep the fixed columns. */
.ladder {
    display: grid;
    grid-template-columns: minmax(var(--ladder-label, 40px), auto) minmax(0, 1fr) auto;
    gap: 2px 16px;
    list-style: none;
}

.ladder__row {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-columns: subgrid;
    align-items: center;
    gap: 6px 16px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}

.ladder__row:hover {
    background: var(--paper);
}

.ladder__year {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ladder__bar {
    position: relative;
    height: 10px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    overflow: hidden;
}

.ladder__bar > span {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--w, 50%);
    border-radius: inherit;
    background: var(--ink);
}

.ladder__value {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ladder__meta {
    grid-column: 2 / -1;
    margin-top: -2px;
    font-size: 0.8125rem;
    color: var(--text-3);
}

.ladder__row.is-best .ladder__bar > span {
    background: var(--brand);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* Small label under the year, e.g. <span class="ladder__tag">Sweet spot</span> */
.ladder__tag {
    display: block;
    margin-top: 2px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--warn);
}

/* Ladder on dark panels */
.on-ink .ladder__row:hover,
.data-panel .ladder__row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.on-ink .ladder__bar,
.data-panel .ladder__bar {
    background: rgba(255, 255, 255, 0.1);
}

.on-ink .ladder__bar > span,
.data-panel .ladder__bar > span {
    background: rgba(246, 245, 241, 0.75);
}

.on-ink .ladder__row.is-best .ladder__bar > span,
.data-panel .ladder__row.is-best .ladder__bar > span {
    background: var(--brand);
    box-shadow: none;
}

.on-ink .ladder__tag,
.data-panel .ladder__tag {
    color: var(--brand);
}

.on-ink .ladder__meta,
.data-panel .ladder__meta {
    color: var(--on-ink-3);
}

/* Meter: score bar */
.meter {
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    overflow: hidden;
}

.meter > span {
    display: block;
    height: 100%;
    width: var(--value, 0%);
    border-radius: inherit;
    background: var(--good);
}

/* 10. Content: prose, FAQ, tables, link hubs, breadcrumbs ---------------- */

.prose {
    max-width: 70ch;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text);
}

.prose > * + * {
    margin-top: 1.1em;
}

.prose h2 {
    margin-top: 2em;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.375rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.prose h3 {
    margin-top: 1.7em;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.prose h2 + *,
.prose h3 + * {
    margin-top: 0.6em;
}

.prose ul,
.prose ol {
    padding-left: 1.3em;
}

.prose li + li {
    margin-top: 0.4em;
}

.prose li::marker {
    color: var(--text-3);
}

.prose a {
    text-decoration: underline;
    text-decoration-color: var(--brand-strong);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.18em;
}

.prose a:hover {
    text-decoration-color: var(--text);
}

.prose strong {
    font-weight: 600;
}

.prose blockquote {
    padding-left: 1em;
    border-left: 3px solid var(--brand);
    color: var(--text-2);
}

.prose hr {
    border: 0;
    border-top: 1px solid var(--line);
}

.faq {
    border-top: 1px solid var(--line);
}

.faq details {
    border-bottom: 1px solid var(--line);
}

.faq summary {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    padding: 20px 0;
    list-style: none;
    cursor: pointer;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    flex: none;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    color: var(--text-3);
    transition: transform 0.2s var(--ease);
}

.faq details[open] summary::after {
    transform: rotate(45deg);
}

.faq__answer,
.faq details > p {
    max-width: 70ch;
    padding-bottom: 22px;
    color: var(--text-2);
}

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-table th {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-strong);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-align: left;
    text-transform: uppercase;
    color: var(--text-3);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover td {
    background: rgba(17, 17, 19, 0.02);
}

.data-table .is-num {
    text-align: right;
}

.data-table a {
    font-weight: 600;
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 0 28px;
    list-style: none;
}

.link-grid a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 0.9375rem;
    text-decoration: none;
    transition: border-color 0.2s var(--ease);
}

.link-grid a:hover {
    border-bottom-color: var(--text);
}

.link-grid .count {
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    list-style: none;
    font-size: 0.8125rem;
    color: var(--text-3);
}

.breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs li + li::before {
    content: "/";
    color: var(--line-strong);
}

.breadcrumbs a {
    color: var(--text-2);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--text);
    text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
    color: var(--text);
}

.on-ink .breadcrumbs a {
    color: var(--on-ink-2);
}

.on-ink .breadcrumbs,
.on-ink .breadcrumbs li + li::before {
    color: var(--on-ink-3);
}

.on-ink .breadcrumbs [aria-current="page"] {
    color: var(--on-ink);
}

/* Status pages: 404 and errors */
.status-page {
    padding-block: clamp(56px, 8vw, 120px) clamp(72px, 10vw, 140px);
    text-align: center;
}

.status-page .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.status-page .lede {
    max-width: 560px;
}

.status-code {
    font-family: var(--font-display);
    font-size: clamp(6.5rem, 3rem + 14vw, 12rem);
    line-height: 0.8;
    letter-spacing: -0.04em;
    color: var(--ink);
}

.status-code em {
    display: inline-block;
    font-style: italic;
    background: linear-gradient(transparent 68%, var(--brand) 68%);
    padding-inline: 0.04em;
}

.status-page .search-form {
    width: 100%;
    max-width: 560px;
    margin-top: 8px;
    text-align: left;
}

.status-links,
.status-actions {
    justify-content: center;
}

.status-details {
    width: 100%;
    max-width: 720px;
    margin-top: 16px;
    text-align: left;
}

.status-details summary {
    cursor: pointer;
    color: var(--text-2);
    font-size: 0.875rem;
}

.status-details pre {
    margin-top: 12px;
    padding: 16px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* 11. Site header & footer ---------------------------------------------- */

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 2000;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--brand-ink);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    color: var(--on-ink);
    border-bottom: 1px solid var(--ink-line);
}

/* The blur lives on a pseudo-element: backdrop-filter on the header itself
   would make it the containing block for the fixed mobile menu and clip it. */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(11, 11, 12, 0.94);
    -webkit-backdrop-filter: saturate(150%) blur(16px);
    backdrop-filter: saturate(150%) blur(16px);
}

.site-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    height: var(--header-h);
}

.site-logo {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 6px 0;
}

.site-logo img {
    width: auto;
    height: 20px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.site-nav a {
    padding: 8px 12px;
    white-space: nowrap;
    border-radius: var(--radius-pill);
    color: var(--on-ink-2);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--on-ink);
    background: rgba(255, 255, 255, 0.07);
}

.header-search {
    position: relative;
    flex: 1 1 auto;
    min-width: 180px;
    max-width: 380px;
    margin-left: auto;
}

.has-hero-search .header-search {
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s var(--ease), visibility 0.2s;
}

.has-hero-search.hero-search-passed .header-search {
    visibility: visible;
    opacity: 1;
}

.header-search .search {
    padding: 0 4px 0 14px;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.header-search .search:focus-within {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.32);
}

.header-search .search__icon {
    width: 16px;
    height: 16px;
    color: var(--on-ink-3);
}

.header-search .search__input {
    height: 38px;
    color: var(--on-ink);
    font-size: 0.875rem;
}

.header-search .search__input::placeholder {
    color: var(--on-ink-3);
}

.header-search .search__results {
    min-width: 340px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.header-search + .header-actions {
    margin-left: 0;
}

.site-nav + .header-actions {
    margin-left: auto;
}

.header-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 3px 12px 3px 3px;
    border-radius: var(--radius-pill);
    color: var(--on-ink);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s var(--ease);
}

.header-user:hover {
    background: rgba(255, 255, 255, 0.08);
}

.avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ink-3);
    color: var(--on-ink);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border-radius: 50%;
    color: var(--on-ink);
    align-items: center;
    justify-content: center;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-toggle svg {
    width: 22px;
    height: 22px;
}

.nav-toggle .icon-close,
.nav-toggle[aria-expanded="true"] .icon-menu {
    display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
    display: block;
}

.mobile-menu {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 899;
    display: none;
    flex-direction: column;
    gap: 24px;
    padding: 20px var(--gutter) 32px;
    overflow-y: auto;
    background: var(--ink);
    color: var(--on-ink);
}

.mobile-menu.is-open {
    display: flex;
}

.mobile-menu .search {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.mobile-menu .search__input {
    color: var(--on-ink);
}

.mobile-menu .search__input::placeholder {
    color: var(--on-ink-3);
}

.mobile-menu__links {
    display: grid;
    list-style: none;
}

.mobile-menu__links a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--ink-line);
    color: var(--on-ink);
    font-family: var(--font-display);
    font-size: 1.75rem;
    line-height: 1.1;
    text-decoration: none;
}

.mobile-menu__links a::after {
    content: "→";
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--on-ink-3);
}

.mobile-menu__actions {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.mobile-menu__user {
    font-size: 0.875rem;
    color: var(--on-ink-3);
    text-align: center;
}

body.menu-open {
    overflow: hidden;
}

/* Laptop widths: the search folds into an icon that opens over the nav. */
@media (max-width: 1179px) {
    .site-header__inner {
        gap: 16px;
    }

    .site-logo img {
        height: 17px;
    }

    .header-user {
        padding-right: 3px;
    }

    .header-user__label {
        display: none;
    }

    .header-search {
        flex: none;
        width: 40px;
        min-width: 0;
        max-width: none;
    }

    .header-search .search {
        justify-content: center;
        height: 40px;
        padding: 0;
    }

    .header-search .search__icon {
        color: var(--on-ink-2);
    }

    .header-search .search__input {
        position: absolute;
        inset: 0;
        height: 100%;
        padding: 0;
        opacity: 0;
        cursor: pointer;
    }

    .header-search:focus-within,
    .header-search.is-open {
        position: absolute;
        inset: 0 var(--gutter);
        z-index: 2;
        display: flex;
        align-items: center;
        width: auto;
        background: var(--ink);
    }

    .header-search:focus-within .search,
    .header-search.is-open .search {
        justify-content: flex-start;
        padding: 0 4px 0 14px;
    }

    .header-search:focus-within .search__input,
    .header-search.is-open .search__input {
        position: static;
        height: 38px;
        opacity: 1;
        cursor: text;
    }
}

@media (max-width: 900px) {
    .site-nav,
    .header-search,
    .header-actions {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }
}

@media (max-width: 420px) {
    .site-logo img {
        height: 16px;
    }
}

.site-footer {
    padding: clamp(56px, 6vw, 88px) 0 32px;
    background: var(--ink);
    color: var(--on-ink-2);
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 40px 32px;
}

.footer-brand img {
    width: auto;
    height: 20px;
}

.footer-brand p {
    max-width: 34ch;
    margin-top: 18px;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.footer-brand .btn {
    margin-top: 22px;
}

.footer-col h2 {
    margin-bottom: 14px;
    color: var(--on-ink);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.footer-col ul {
    display: grid;
    gap: 2px;
    list-style: none;
}

.footer-col a {
    display: inline-block;
    padding: 4px 0;
    color: var(--on-ink-2);
    font-size: 0.9375rem;
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.footer-col a:hover {
    color: var(--on-ink);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 24px;
    margin-top: clamp(40px, 5vw, 64px);
    padding-top: 24px;
    border-top: 1px solid var(--ink-line);
    font-size: 0.8125rem;
    color: var(--on-ink-3);
}

.footer-bottom p {
    max-width: 72ch;
}

.footer-bottom a {
    color: inherit;
}

.footer-bottom a:hover {
    color: var(--on-ink);
}

@media (max-width: 900px) {
    .footer-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

/* 12. Utilities --------------------------------------------------------- */

.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center {
    text-align: center;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-6 { margin-top: 48px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hide-mobile {
    display: initial;
}

@media (max-width: 640px) {
    .hide-mobile {
        display: none !important;
    }
}

.icon {
    width: 1em;
    height: 1em;
    flex: none;
}
