:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --well: #efebe4;
  --text: #1f1d1a;
  --muted: #69645c;
  --line: #e4dfd6;
  --accent: #c2410c;
  --accent-text: #ffffff;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412;
    --surface: #1d1b19;
    --well: #26231f;
    --text: #ece8e1;
    --muted: #a39d93;
    --line: #34302b;
    --accent: #ff7a33;
    --accent-text: #1a0f07;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; }
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 20px; }
.muted { color: var(--muted); }

/* шапка */
header.top { background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding-block: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.brand svg, .brand img { width: 28px; height: 28px; }
nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }

main { padding-bottom: 48px; }
section { padding-block: 28px; }

/* главная */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; align-items: center; padding-top: 44px; }
.eyebrow { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin: 0 0 12px; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -.01em; margin: 0 0 16px; }
.lead { color: var(--muted); font-size: 1.12rem; max-width: 40em; margin: 0 0 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 1.6rem; }
.section-head a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.section-head a:hover { color: var(--text); }

.grid, .notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card, .note {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover, .note:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgb(0 0 0 / .08); }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--well); }
.card h3 { font-size: 1rem; margin: 14px 16px 4px; }
.card .meta { color: var(--muted); font-size: .9rem; margin: 0 16px 16px; }
.note { padding: 18px 20px; }
.note h3 { font-size: 1.05rem; margin: 0 0 8px; }
.note p { color: var(--muted); font-size: .95rem; margin: 0; }
.note:hover h3 { color: var(--accent); }
.about { max-width: 46em; }
.about h2 { font-size: 1.6rem; margin: 0 0 12px; }

/* каталог */
.page h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 40px 0 12px; }
.model {
  display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 28px; align-items: start;
  padding-block: 28px; border-top: 1px solid var(--line); scroll-margin-top: 16px;
}
.model img { width: 100%; aspect-ratio: 4 / 3; background: var(--well); border-radius: var(--radius); }
.model:target img { outline: 3px solid var(--accent); outline-offset: 3px; }
.model h2 { font-size: 1.4rem; margin: 4px 0 8px; }
.model p { margin: 0 0 16px; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 20px; margin: 0 0 20px; }
.specs div { border-left: 3px solid var(--line); padding-left: 10px; }
.specs dt { color: var(--muted); font-size: .85rem; }
.specs dd { margin: 0; }

/* заметки */
.prose { max-width: 46em; }
.crumbs { color: var(--muted); font-size: .95rem; margin: 32px 0 0; }
.crumbs a { color: var(--muted); }
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 8px 0 12px; }
.prose h2 { font-size: 1.35rem; margin: 32px 0 10px; }
.prose p, .prose li { font-size: 1.05rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 4px 0; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em;
  background: var(--well); padding: 1px 6px; border-radius: 6px;
}
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--muted); font-weight: 600; }
.tip { background: var(--well); border-radius: var(--radius); padding: 14px 18px; margin: 24px 0; }

/* листинг файлов */
.files {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 16px 0 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.files th, .files td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.files tr:last-child td { border-bottom: 0; }
.files th { color: var(--muted); font-weight: 600; font-size: .9rem; }
.files td + td, .files th + th { white-space: nowrap; color: var(--muted); }
.files a { text-decoration: none; }
.files a:hover { text-decoration: underline; }

.notfound h1 { font-size: 4rem; color: var(--accent); margin: 48px 0 8px; }

/* подвал */
footer.bottom { background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer.bottom .wrap { padding-block: 24px; }
footer.bottom p { margin: 0 0 6px; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .model { grid-template-columns: 1fr; gap: 16px; }
  .files td:nth-child(3), .files th:nth-child(3) { display: none; }
}
