:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
  --bg: #F5F9FD;
  --surface: #FFFFFF;
  --ink: #142B44;
  --muted: #64788E;
  --line: #DFE8F2;
  --mark: #FF8A3D;
  --sign: #E3F1FD;
  --sign-2: #F2F8FE;
  --sign-ink: #142B44;
  --accent-ink: #D9661A;
  --tag-ink: #A84D0F;
  --shadow: 0 8px 24px -16px rgba(20, 60, 110, .28);
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Manrope", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem; line-height: 1.55;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 3px; }

header {
  background: linear-gradient(120deg, var(--sign), var(--sign-2)); color: var(--sign-ink);
  border-bottom: 1px solid var(--line);
}
.bar {
  max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo {
  font-family: "Russo One", "Arial Black", sans-serif; font-size: 1.6rem;
  text-decoration: none; letter-spacing: .02em; display: flex; align-items: center; gap: .6rem;
}
.bar nav a { text-decoration: none; font-weight: 500; opacity: .9; }
.bar nav a:hover { opacity: 1; text-decoration: underline; }

main { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }

h1 {
  font-family: "Russo One", "Arial Black", sans-serif; font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; margin: 0 0 .75rem;
}
.lead { color: var(--muted); max-width: 60ch; margin: 0 0 2rem; font-size: 1.1rem; }

.search {
  width: 100%; max-width: 420px; padding: .75rem 1rem; font: inherit;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
  margin-bottom: 2rem;
}
.search:focus { border-color: var(--mark); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--mark) 30%, transparent); }

/* Марки — как номерные знаки */
.brands {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem;
}
.plate {
  display: flex; align-items: stretch; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  min-height: 72px; transition: transform .15s ease;
}
.plate:hover { transform: translateY(-2px); border-color: var(--mark); }
.plate .text { padding: .7rem 1.1rem; display: flex; flex-direction: column; justify-content: center; }
.plate .name { font-family: "Russo One", "Arial Black", sans-serif; font-size: 1.25rem; line-height: 1.2; }
.plate .meta { color: var(--muted); font-size: .85rem; }
.empty { color: var(--muted); }

/* Навигация */
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; color: var(--muted); font-size: .95rem; }
.crumbs a { text-decoration: none; font-weight: 700; color: var(--accent-ink); }
.crumbs a:hover { text-decoration: underline; }
.brand-info { color: var(--muted); margin: 0 0 2rem; }

/* Карточки моделей */
.models {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem;
}
.mcard {
  display: flex; flex-direction: column; height: 100%; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
}
.mcard:hover { transform: translateY(-3px); border-color: var(--mark); }
.mcard .body { padding: .9rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.mcard h2 { font-size: 1.2rem; margin: 0; }
.mcard p { margin: 0; color: var(--muted); font-size: .92rem; }
.mcard .row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: auto; padding-top: .6rem; }
.tag {
  font-size: .8rem; font-weight: 500; padding: .15rem .55rem; border-radius: 999px;
  color: var(--muted); background: var(--bg); border: 1px solid var(--line); white-space: nowrap;
}

/* Страница модели */
.model-page { display: grid; gap: 1.5rem; max-width: 720px; }
.specs { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: .5rem 1.5rem; box-shadow: var(--shadow); }
.specs dl { margin: 0; }
.specs div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.specs div:last-child { border-bottom: 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 500; }
.desc { font-size: 1.1rem; max-width: 65ch; margin: 0; }
.others { margin-top: 3rem; }
.others h2 { font-size: 1.2rem; margin: 0 0 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; margin: 0; padding: 0; }
.chips a {
  display: inline-block; padding: .45rem .9rem; border-radius: 999px; text-decoration: none; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line);
}
.chips a:hover { border-color: var(--mark); color: var(--accent-ink); }
@media (max-width: 800px) {
  .model-page { grid-template-columns: 1fr; }
  .specs div { grid-template-columns: 8rem 1fr; }
}

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer .bar { padding: 1.5rem 1.25rem; }

@media (prefers-reduced-motion: reduce) {
  .plate, .mcard { transition: none; }
  .plate:hover, .mcard:hover { transform: none; }
}

.plate[hidden] { display: none; }
.brands li[hidden] { display: none; }
