/* override accent red in base.css*/
:root {
    --accent-red: #b95656;
}

/* ============================================
   MODELS HERO - DARK THEME
   ============================================ */

.models-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* Was min-height:75vh plus 14vh/10vh padding. This page is an index of seven
       cars, so a full viewport of stock photograph before the first one was the
       wrong trade — the filters and the first row now sit above the fold. */
    padding: clamp(8rem, 19vh, 11rem) 6vw clamp(2.5rem, 6vh, 4rem);
    overflow: hidden;
    background:
        linear-gradient(rgba(0,0,0,0.52), rgba(0,0,0,0.60)),
        url('images/grand-opening.webp') center / cover no-repeat;
}

/* Ensure all hero content sits above pseudo-element */
.models-hero > * {
    position: relative;
    z-index: 1;
}

/* Hero always sits over a dark photo — keep text white in both themes */
html[data-theme="light"] .models-hero-eyebrow { color: rgba(255,255,255,0.5); }
html[data-theme="light"] .models-hero-title    { color: #ffffff; }
html[data-theme="light"] .models-hero-subtitle { color: rgba(255,255,255,0.65); }

.models-hero-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: var(--text-2xs);
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: var(--space-lg);
}

.models-hero-title {
    font-family: 'Sora', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: var(--text-white);
    margin-bottom: var(--space-md);
}

.models-hero-subtitle {
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    font-weight: 400;
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.6;
}

/* ============================================
   BRANDS SHOWCASE SECTION
   ============================================ */

.brands-showcase {
    padding: var(--space-4xl) 4vw 8rem;
    background: var(--bg-dark);
    overflow: visible;
}

/* ============================================
   FILTERS
   ============================================ */

/* Left-aligned on the grid's own measure: a control panel over a catalogue,
   not another centred marketing block. The eyebrow / title / subtitle that used
   to stand here said nothing the hero one screen above had not already said. */
.model-filters {
    max-width: 1400px;
    margin: 0 auto var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.filter-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* Fixed measure so the two chip rows start on the same line. */
.filter-label {
    flex: 0 0 5.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: var(--text-3xs);
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.filter-chips {
    display: flex;
    gap: var(--space-3xs);
    flex-wrap: wrap;
}

.chip {
    font-family: 'Inter', sans-serif;
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--space-3xs) var(--space-xs);
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast),
                border-color var(--transition-fast),
                background-color var(--transition-fast);
}

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

.chip.active {
    background: var(--text-white);
    border-color: var(--text-white);
    color: var(--bg-dark);
}

.chip:focus-visible {
    outline: 2px solid var(--text-white);
    outline-offset: 2px;
}

/* Doubles as the rule between the controls and the grid. */
.filter-result {
    padding-top: var(--space-2xs);
    border-top: 1px solid var(--border-dark);
    font-family: 'IBM Plex Mono', monospace;
    font-size: var(--text-2xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-subtle);
}

.showcase-empty {
    margin: var(--space-3xl) auto;
    text-align: center;
    font-size: var(--text-lg);
    color: var(--text-muted);
}

/* ============================================
   BRANDS GRID
   ============================================ */

.showcase-brands-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    max-width: 1400px;
    margin: 0 auto;
    /* Cards must not create a new stacking context that fights the dropdown */
    position: relative;
    z-index: 1;
}

.showcase-brand-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.showcase-brand-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-subtle);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.showcase-brand-card-image {
    position: relative;
    /* 3/2 matches the homepage car cards, and gives the photograph more of the
       card than the tag list used to take. */
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--bg-darker);
}

.showcase-brand-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-brand-card:hover .showcase-brand-card-image img {
    transform: scale(1.03);
}

.showcase-brand-card-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: var(--text-3xs);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: var(--space-3xs) var(--space-xs);
    background: var(--bg-dark);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-pill);
    /* --bg-white was never defined anywhere; this only looked right because the
       inherited colour happened to contrast with --bg-dark in both themes. */
    color: var(--text-white);
}

.showcase-brand-card-content {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.showcase-brand-card-name {
    font-family: 'Sora', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-white);
    margin-bottom: var(--space-3xs);
}

.showcase-brand-card-tagline {
    font-size: var(--text-md);
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

/* The min-heights that used to sit on these two reserved 68px for the
   description and 88px for the tags on every card, whether the content needed
   it or not — which is how the tag list ended up the tallest thing in the card.
   Cards in a row are already equal height because grid items stretch, and the
   actions block below is pinned with margin-top:auto, so nothing needs to be
   held open by hand. */
.showcase-brand-card-desc {
    font-size: var(--text-sm);
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

/* Range / power / 0-100, divided like the spec strip in the car detail hero, so
   the seven cards on this page can actually be read against each other. */
.showcase-brand-card-specs {
    display: grid;
    /* auto-fit, not repeat(3): the cars without an electric range show two
       cells and should divide the strip between them, not leave a gap. */
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    margin-bottom: var(--space-md);
    border-top: 1px solid var(--border-dark);
    border-bottom: 1px solid var(--border-dark);
}

.card-spec {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: var(--space-2xs) var(--space-3xs);
    text-align: center;
}

.card-spec + .card-spec {
    border-left: 1px solid var(--border-dark);
}

.card-spec-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-white);
    line-height: 1.3;
}

.card-spec-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: var(--text-3xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.3;
}

.showcase-brand-card-actions {
    display: flex;
    gap: var(--space-2xs);
    margin-top: auto;
}

/* The button was the only clickable thing on a card that reads as one target.
   Stretching it over the card keeps the markup valid — there is no other link
   inside — and makes the whole card the hit area. */
.showcase-brand-card {
    position: relative;
}

.showcase-brand-card-actions .btn::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xs);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-pill);
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    flex: 1;
    text-decoration: none;
}

.btn-primary {
    background: var(--text-white);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: var(--accent-red);
    color: var(--bg-dark);
    transform: translateY(-1px);
}

.btn-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.btn:hover .btn-icon {
    transform: translateX(2px);
}

/* ============================================
   CONTACT CTA SECTION
   ============================================ */

.models-cta {
    padding: var(--space-7xl) 4vw;
    background: var(--bg-darker);
    border-top: 1px solid var(--border-dark);
}

.models-cta-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.models-cta-title {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-white);
    margin-bottom: var(--space-sm);
}

.models-cta-text {
    font-size: var(--text-lg);
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
    line-height: 1.6;
}

.models-cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    font-size: var(--text-base);
    font-weight: 600;
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-pill);
    transition: all 0.25s ease;
    text-decoration: none;
}

.cta-btn-primary {
    background: var(--text-white);
    color: var(--bg-dark);
}

.cta-btn-primary:hover {
    background: var(--accent-red);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cta-btn-secondary {
    background: transparent;
    color: var(--text-white);
    border: 1.5px solid var(--border-subtle);
}

.cta-btn-secondary:hover {
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.05);
}

/* ============================================
   SCROLL REVEAL ANIMATION
   ============================================ */

/* Scoped to html.js so the prerendered markup stays visible without JS. */
.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .showcase-brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .models-hero {
        min-height: 65vh;
        padding: 12vh 5vw 8vh;
    }

    .models-hero-stats {
        gap: var(--space-xl);
    }

    .hero-stat-number {
        font-size: 2rem;
    }

    .showcase-brands-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .brand-filters {
        gap: var(--space-3xs);
    }

    .filter-tab {
        padding: var(--space-2xs) var(--space-sm);
        font-size: var(--text-xs);
    }

    .brand-dropdown-wrap {
        margin-left: 0;
    }

    .models-cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .cta-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .scroll-hint {
        animation: none;
    }
}