/* The public model directory at /models (templates/models.html).
 *
 * Loaded AFTER landing.css and on top of it: the tokens, the nav, the buttons,
 * the badges, the questions block, the chip cloud and the footer are the main
 * landing's, so the two pages cannot drift apart. This file only adds what the
 * directory has and the landing has not: the hero with its highlight tiles, the
 * filter bar, the model cards and the comparison table. Every rule is prefixed
 * md- (model directory), so nothing here can restyle the landing.
 *
 * No colour of its own: landing tokens, white / black tints, and two values
 * taken from landing.css as they stand there (the tile hover and the violet
 * gradient of its canvas banner).
 */

.md { padding-top: 6px; }
.md-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.nbtn.is-current { background: var(--accent-soft); color: var(--accent-bright); }

.md-crumbs { display: flex; align-items: center; gap: 8px; padding: 14px 0 0; color: var(--muted); font-size: 14px; }
.md-crumbs a:hover { color: var(--text); }
.md-crumbs [aria-current] { color: var(--text); }

/* ---------------------------------------------------------------- hero */

.md-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 28px 0 36px; }
.md-hero .pill { margin-bottom: 18px; }
.md-hero h1 { font-size: clamp(32px, 3.7vw, 54px); line-height: 1.05; letter-spacing: -0.045em; font-weight: 700; text-transform: uppercase; max-width: 19ch; }
.md-hero-text > p { margin-top: 18px; color: var(--muted); font-size: 18px; line-height: 1.5; max-width: 620px; }
.md-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.md-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.md-highlight { display: flex; flex-direction: column; justify-content: space-between; gap: 22px; min-height: 148px; padding: 16px 16px 14px; border-radius: var(--r-lg); background: var(--surface-2); }
.md-highlight dt { color: var(--muted); font-size: 14px; font-weight: 500; }
.md-highlight dd { display: grid; gap: 6px; }
.md-highlight strong { font-size: clamp(26px, 2.4vw, 34px); line-height: 1; letter-spacing: -0.04em; font-weight: 700; text-transform: uppercase; color: var(--accent-bright); }
.md-highlight span { color: var(--text); font-size: 14px; line-height: 1.35; }

/* ---------------------------------------------------------------- filter bar */

.md-bar { position: sticky; top: 52px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.md-chips { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.md-chips::-webkit-scrollbar { display: none; }
.md-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.06); color: var(--text); font-size: 15px; font-weight: 500; transition: background 0.2s, color 0.2s; }
.md-chip { -webkit-tap-highlight-color: transparent; }
.md-chip:hover { background: rgba(255, 255, 255, 0.12); }
.md-chip:focus-visible, .md-link:focus-visible, .md-table a:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.md-chip.is-active { background: var(--accent); color: #fff; }

.md-search { flex: 0 1 340px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.md-search[hidden] { display: none; }
.md-search svg { width: 18px; height: 18px; flex-shrink: 0; }
.md-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 15px; }
.md-search input::placeholder { color: var(--muted); }
.md-search:focus-within { box-shadow: inset 0 0 0 1px var(--accent-bright); }
.md-search input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.6; }

.md-empty { margin: 40px 0; padding: 28px; border-radius: var(--r-lg); background: var(--surface); color: var(--muted); text-align: center; }
.md-empty[hidden] { display: none; }

/* ---------------------------------------------------------------- groups + cards */

.md-group, .md-compare { padding-top: 40px; scroll-margin-top: 104px; }
.md-group[hidden], .md-compare[hidden], .md-card[hidden] { display: none; }
.md-group-head { margin-bottom: 18px; }
.md-group-head p { margin-top: 6px; color: var(--muted); max-width: 760px; }

.md-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.md-card { display: flex; flex-direction: column; padding: 18px 18px 16px; border-radius: var(--r-lg); background: var(--surface-2); scroll-margin-top: 116px; transition: background 0.2s, box-shadow 0.2s; }
.md-card:hover { background: #2b2f34; }
.md-card:target { box-shadow: inset 0 0 0 2px var(--accent-bright); }

.md-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.md-icon { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-bright); }
.md-icon svg { width: 20px; height: 20px; }
.md-kind { color: var(--muted); font-size: 13px; background: rgba(255, 255, 255, 0.06); padding: 4px 10px; border-radius: 8px; }
.md-card-top .badge { margin-left: auto; }

.md-card h3 { font-size: 22px; line-height: 1.15; letter-spacing: -0.02em; text-transform: none; }
.md-summary { margin-top: 12px; font-size: 16px; line-height: 1.45; }
.md-detail { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 1.5; }

.md-specs { margin-top: 16px; border-top: 1px solid var(--line); }
.md-specs div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.md-specs dt { color: var(--muted); }
.md-specs dd { color: var(--text); }

.md-card-foot { margin-top: auto; padding-top: 16px; }
.md-price { display: grid; gap: 2px; }
.md-price strong { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.md-price span { color: var(--muted); font-size: 13px; }
.md-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 14px; }
.md-actions .btn { white-space: normal; text-align: center; }
.md-link { color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.22); text-underline-offset: 3px; }
.md-link:hover { color: var(--text); }

/* ---------------------------------------------------------------- comparison */

.md-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.md-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 15px; }
.md-table th, .md-table td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); line-height: 1.4; }
.md-table thead th { color: var(--muted); font-size: 13px; font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.md-table tbody tr:last-child th, .md-table tbody tr:last-child td { border-bottom: 0; }
.md-table tbody th { position: sticky; left: 0; background: var(--surface); font-weight: 600; white-space: nowrap; }
.md-table thead th:first-child { position: sticky; left: 0; z-index: 1; }
.md-table tbody th a { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.22); text-underline-offset: 3px; }
.md-table tbody th a:hover { color: var(--accent-bright); }
.md-table td { color: var(--muted); }
.md-table td:last-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.md-note { margin-top: 14px; color: var(--muted); font-size: 14px; max-width: 860px; }
.md-note a { color: var(--accent-bright); }

/* ---------------------------------------------------------------- closing */

.md .faq-section { padding-top: 72px; }
.md-cta { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 40px 32px; border-radius: var(--r-xl); background: linear-gradient(100deg, #5b3fc9 0%, #2d1f7a 55%, #121633 100%); }
.md-cta h2 span { color: var(--accent-bright); }
.md-cta p { margin-top: 12px; color: rgba(255, 255, 255, 0.78); font-size: 16px; max-width: 560px; }
.md-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; flex-shrink: 0; }

/* ---------------------------------------------------------------- breakpoints (the landing's own steps) */

@media (max-width: 1200px) {
    .md-hero { grid-template-columns: 1fr; }
    .md-highlights { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .md-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md-highlight { min-height: 124px; }
    /* Search first, chips under it, and the bar sticks only once the search row has
       slid under the nav: 12 px padding + 40 px field + 10 px gap = 62 px above the
       chips, so top -2 px parks them 8 px below the 52 px nav. A phone keeps one row
       of chips in view instead of losing two rows of the screen to the bar. */
    .md-bar { flex-direction: column-reverse; align-items: stretch; gap: 10px; top: -2px; }
    .md-search { flex: 0 0 40px; }
    .md-group, .md-compare { scroll-margin-top: 120px; }
    .md-card { scroll-margin-top: 128px; }
    .md-cta { flex-direction: column; align-items: flex-start; padding: 32px 24px; }
}

@media (max-width: 640px) {
    .md-hero { padding: 20px 0 28px; }
    .md-hero-text > p { font-size: 16px; }
    .md-hero-actions .btn { flex: 1 1 100%; }
    .md-grid { grid-template-columns: 1fr; }
    .md-specs div { grid-template-columns: 104px minmax(0, 1fr); }
    .md-table { min-width: 820px; font-size: 14px; }
    .md-table th, .md-table td { padding: 12px; }
    .md-table tbody th { white-space: normal; min-width: 128px; max-width: 148px; }
    .md-cta-actions, .md-cta-actions .btn { width: 100%; }
}
