/* Soul of Technology - токены из раздела 6 ТЗ.
   Поправки по контрасту (WCAG AA, см. NOTES.md):
   - серый для дат #777777 даёт 4,48:1 на белом - взят #707070 (4,95:1);
   - белый текст на #5FCF34 даёт 2,0:1 - плашка рубрики с текстом #04052D (9,8:1). */
:root {
  --bg: #FFFFFF;
  --text: #242424;
  --accent: #04052D;
  --dark: #100F0F;
  --link: #125CA6;
  --accent2: #348BCF;
  --badge: #5FCF34;
  --muted: #707070;
  --divider-dark: #323232;
  --divider: #DDDDDD;
  --white: #FFFFFF;
  --heading: "Inter", "Helvetica Neue", Arial, sans-serif;
  --body: "Oswald", "Arial Narrow", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #FFFFFF; }
}
:root[data-theme="dark"] { --bg: #FFFFFF; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--heading); font-weight: 700; color: var(--accent); line-height: 1.15; }
h1 { font-size: 44px; margin: 0 0 16px; }
h2 { font-size: 30px; margin: 40px 0 16px; }
h3 { font-size: 20px; margin: 24px 0 12px; }
p { margin: 0 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--white); padding: 8px; z-index: 10; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 860px; }
.button {
  display: inline-block; background: var(--link); color: var(--white); text-decoration: none;
  font-family: var(--heading); font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
  padding: 12px 22px; border: 0; cursor: pointer;
}
.button:hover { text-decoration: none; background: #0d4a88; }
.badge {
  display: inline-block; background: var(--badge); color: var(--accent);
  font-family: var(--heading); font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; padding: 4px 8px; margin-bottom: 10px;
}

/* шапка */
.site-header { background: var(--accent); color: var(--white); height: 72px; position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.logo { font-family: var(--heading); font-weight: 700; font-size: 20px; color: var(--white); text-decoration: none; }
.site-menu { display: flex; gap: 28px; margin-left: auto; }
.site-menu a {
  font-family: var(--heading); font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--white); text-decoration: none;
}
.site-menu a:hover, .site-menu a[aria-current="page"] { color: var(--accent2); }
.nav-toggle { display: none; background: none; border: 1px solid var(--divider-dark); color: var(--white); padding: 8px 12px; font: inherit; cursor: pointer; }
.search-open { background: none; border: 0; color: var(--white); cursor: pointer; padding: 8px; }
.search-panel { background: var(--white); border-bottom: 1px solid var(--divider); padding: 16px 0; }
.search-panel input { width: 100%; font: inherit; font-size: 17px; padding: 10px 12px; border: 1px solid var(--divider); }
.search-results { list-style: none; padding: 8px 0 0; margin: 0; }
.search-results li { padding: 6px 0; border-bottom: 1px solid var(--divider); }

/* крошки */
.crumbs { font-family: var(--heading); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 24px 24px 0; max-width: 1200px; margin: 0 auto; }
.crumbs a { color: var(--muted); }
.crumbs span { color: var(--text); }

/* главная */
.hero-section { background: var(--accent); color: var(--white); }
.hero-inner { padding-top: 48px; padding-bottom: 32px; }
.hero-kicker { font-family: var(--heading); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--badge); margin: 0 0 12px; }
.hero-section h1 { color: var(--white); font-size: 48px; max-width: 900px; }
.hero-section .lead { color: #E6E6F0; font-size: 19px; max-width: 760px; }
.hero-figure { margin: 0 0 24px; }
.hero-figure figcaption { font-size: 13px; color: var(--muted); padding-top: 6px; }
.hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
/* герой главной: ограниченная высота, чтобы не занимать весь первый экран */
.home-hero { width: 100%; height: 460px; aspect-ratio: auto; object-fit: cover; }
@media (max-width: 720px) { .home-hero { height: 260px; } }
.rubrics { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 24px; }
.pill { display: inline-block; font-family: var(--heading); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; background: var(--badge); color: var(--accent); padding: 6px 12px; }
.home-grid { display: grid; grid-template-columns: 8fr 4fr; gap: 48px; padding-top: 32px; }
.home-main { min-width: 0; }
.latest { padding: 0; }
.latest h2 { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 16px; }
.card { background: var(--white); display: flex; flex-direction: column; }
.card-media { display: block; }
.card-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card-body { padding: 16px 0 0; }
.card h3 { font-size: 18px; margin: 0 0 8px; }
.card h3 a { color: var(--accent); text-decoration: none; }
.card h3 a:hover { color: var(--link); text-decoration: underline; }
.card-body p { font-size: 15px; margin: 0 0 8px; }
.card-meta { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.home-text { padding-top: 16px; }
.home-text h2 { margin-top: 32px; }
.sidebar { font-size: 15px; }
.side-box { background: #F5F5F7; padding: 20px; margin-bottom: 24px; }
.side-title { font-size: 18px; margin: 0 0 12px; }
.side-list { list-style: none; padding: 0; margin: 0; }
.side-list li { padding: 8px 0; border-bottom: 1px solid var(--divider); }
.side-list a { color: var(--accent); text-decoration: none; }
.side-list a:hover { color: var(--link); text-decoration: underline; }
.toc { list-style: decimal; padding-left: 20px; }
.mini-stack p { margin-bottom: 10px; }
.mini-stack a { color: var(--accent); text-decoration: none; }

/* статья и раздел */
.article { padding-top: 16px; }
.article-head { padding-top: 24px; }
.article-head h1 { font-size: 44px; }
.byline { font-family: var(--heading); font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 0 0 16px; }
.lead { font-size: 20px; line-height: 1.5; color: var(--text); }
.article-grid { display: grid; grid-template-columns: minmax(0, 760px) 300px; gap: 48px; justify-content: space-between; }
.article-main { min-width: 0; }
.prose p, .prose li { max-width: 760px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose h2 { scroll-margin-top: 90px; }
.prose a { color: var(--link); }
.prose blockquote { border-left: 4px solid var(--accent2); margin: 24px 0; padding: 4px 0 4px 20px; color: var(--accent); }
.faq h3 { margin-top: 20px; }
.related { padding-top: 16px; padding-bottom: 32px; }
.contact-form { display: grid; gap: 16px; max-width: 560px; margin-top: 16px; }
.contact-form label { display: grid; gap: 6px; font-family: var(--heading); font-size: 14px; color: var(--accent); }
.contact-form input, .contact-form textarea { font: inherit; font-size: 16px; padding: 10px; border: 1px solid var(--divider); background: var(--white); }
.form-note { font-size: 13px; color: var(--muted); }

/* служебные и статусные */
.status { text-align: center; padding: 64px 24px; }
.status-code { font-family: var(--heading); font-size: 72px; font-weight: 700; color: var(--accent); margin: 0; line-height: 1; }

/* подвал */
.site-footer { background: var(--accent); color: #CFCFD8; margin-top: 56px; padding: 40px 0 16px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid nav { display: grid; gap: 8px; align-content: start; }
.footer-grid a { color: #E6E6F0; text-decoration: none; font-size: 15px; }
.footer-grid a:hover { color: var(--accent2); }
.footer-brand { font-family: var(--heading); font-weight: 700; color: var(--white); font-size: 20px; margin: 0 0 8px; }
.footer-title { font-family: var(--heading); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--white); margin: 0 0 8px; }
.site-footer p { font-size: 14px; margin: 0 0 10px; }
.copy { margin-top: 24px; font-size: 12px; color: #A0A0AA; border-top: 1px solid var(--divider-dark); padding-top: 16px; }

/* телефон и планшет */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .home-grid, .article-grid { grid-template-columns: 1fr; }
  .hero-section h1 { font-size: 38px; }
}
/* мобильные метки рубрик на главной: сетка 2 на 2, одинаковая ширина, без переноса внутри метки */
@media (max-width: 600px) {
  .rubrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 16px; margin-bottom: 24px; }
  .rubrics .pill { text-align: center; white-space: nowrap; font-size: 11px; letter-spacing: .3px; padding: 8px 6px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  h1, .hero-section h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .wrap { padding: 0 16px; }
  .crumbs { padding: 16px 16px 0; }
  .nav-toggle { display: inline-block; }
  .site-menu { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--accent); flex-direction: column; gap: 0; padding: 8px 16px; margin: 0; }
  .site-menu.open { display: flex; }
  .site-menu a { padding: 12px 0; border-bottom: 1px solid var(--divider-dark); }
  .grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-row { position: relative; }
}
