/* Блог «Профобразование и карьера». Токены и правила — см. DESIGN.md */

@font-face {
  font-family: 'Golos Text'; src: url('fonts/golos-cyrillic.woff2') format('woff2-variations');
  font-weight: 400 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text'; src: url('fonts/golos-latin.woff2') format('woff2-variations');
  font-weight: 400 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: oklch(0.995 0.002 175);
  --surface: oklch(0.965 0.012 175);
  --ink: oklch(0.25 0.025 175);
  --muted: oklch(0.47 0.02 175);
  --line: oklch(0.9 0.012 175);
  --accent: oklch(0.43 0.085 170);
  --accent-strong: oklch(0.35 0.075 170);
  --on-accent: oklch(0.99 0.005 175);
  --radius: 12px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(1.9rem, 1.5rem + 2vw, 3rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.2 0.012 175);
    --surface: oklch(0.25 0.015 175);
    --ink: oklch(0.93 0.008 175);
    --muted: oklch(0.75 0.015 175);
    --line: oklch(0.34 0.015 175);
    --accent: oklch(0.8 0.1 170);
    --accent-strong: oklch(0.87 0.09 170);
    --on-accent: oklch(0.2 0.02 175);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.65 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
}
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; font-weight: 700; letter-spacing: -0.012em; text-wrap: balance; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: calc(72rem + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10; padding: 0.5rem 1rem;
  background: var(--accent); color: var(--on-accent); border-radius: 8px;
}
.skip:focus { top: 0.5rem; color: var(--on-accent); }

/* Шапка */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 0.5rem 2.5rem; flex-wrap: wrap; padding-block: 1rem; }
.logo { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
.logo:hover { color: var(--accent); }
.site-nav { flex: 1; min-width: 0; }
.site-nav ul {
  display: flex; gap: 0.25rem 1.5rem; list-style: none; margin: 0; padding: 0;
  overflow-x: auto; scrollbar-width: none;
}
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav a {
  display: block; padding: 0.35rem 0; color: var(--muted); text-decoration: none;
  font-size: 0.975rem; white-space: nowrap; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.site-nav .nav-archive { margin-left: auto; }

/* Вступление */
.intro { background: var(--surface); padding-block: clamp(2.5rem, 7vw, 5rem); }
.intro h1 { font-size: var(--step-3); font-weight: 800; max-width: 20em; }
.intro p { margin-top: 1rem; max-width: 38rem; font-size: 1.1875rem; color: var(--muted); }
.page { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem); }

/* Подпись к статье */
.meta { display: flex; flex-wrap: wrap; gap: 0 0.6rem; color: var(--muted); font-size: 0.9rem; }
.meta a { color: var(--accent); text-decoration: none; font-weight: 600; }
.meta a:hover { text-decoration: underline; }
.meta > * + *::before { content: '·'; margin-right: 0.6rem; }

/* Главная */
.intro { padding-block: clamp(1.75rem, 4vw, 3rem); }
.intro p { font-size: 1.0625rem; margin-top: 0.6rem; }
.frame { display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.frame img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 0.7s var(--ease); }
a.frame:hover img, article:hover > .frame img { transform: scale(1.04); }
article h2 a, article h3 a { color: inherit; text-decoration: none; }
article h2 a:hover, article h3 a:hover { color: var(--accent); }

.featured { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.5rem, 4vw, 3.5rem); padding-block: clamp(1.75rem, 4vw, 3rem); }
.feature .frame img { aspect-ratio: 16 / 9; }
.feature .meta { margin-top: 1rem; }
.feature h2 { font-size: var(--step-2); margin: 0.4rem 0 0.6rem; }
.feature p { color: var(--muted); max-width: 42rem; }
.side-posts { display: flex; flex-direction: column; justify-content: space-between; gap: 1.25rem; }
.side-post { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1rem; align-items: center; }
.side-post .frame { border-radius: 8px; }
.side-post h2 { font-size: 1.0625rem; line-height: 1.3; margin-top: 0.25rem; font-weight: 600; }
.side-post .meta { font-size: 0.82rem; }

.steps { background: var(--accent); color: var(--on-accent); padding-block: clamp(2rem, 5vw, 3.25rem); }
.steps h2 { color: inherit; font-size: var(--step-2); margin-bottom: 1.25rem; }
.steps ol { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.25rem 2rem; }
.steps li { counter-increment: s; }
.steps a { display: block; color: inherit; text-decoration: none; }
.steps b { display: block; font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.steps b::before { content: counter(s); display: block; font-size: var(--step-3); font-weight: 800; line-height: 1.1; margin-bottom: 0.25rem; opacity: 0.55; transition: opacity 0.2s var(--ease); }
.steps a:hover b::before { opacity: 1; }
.steps a:hover b { text-decoration: underline; text-underline-offset: 0.18em; }
.steps span { display: block; margin-top: 0.3rem; font-size: 0.925rem; line-height: 1.45; opacity: 0.88; }

.rubrics { padding-block: clamp(1rem, 3vw, 2rem) clamp(2.5rem, 6vw, 4rem); }
.rubric { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.25rem, 4vw, 3.5rem); padding-block: clamp(1.75rem, 4vw, 2.75rem); border-bottom: 1px solid var(--line); }
.rubric:last-of-type { border-bottom: 0; }
.rubric:nth-of-type(even) { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.rubric:nth-of-type(even) .rubric-head { order: 2; }
.rubric-head h2 { font-size: var(--step-2); }
.rubric-head h2 a { color: var(--ink); text-decoration: none; }
.rubric-head h2 a:hover { color: var(--accent); }
.rubric-head p { color: var(--muted); margin: 0.5rem 0 0.75rem; }
.more { font-weight: 600; }
.rubric-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2rem); }
.tile .meta { margin-top: 0.7rem; font-size: 0.82rem; }
.tile h3 { font-size: 1.125rem; line-height: 1.3; font-weight: 600; margin-top: 0.2rem; }

.arc-teaser { background: var(--surface); padding-block: clamp(2rem, 5vw, 3rem); }
.arc-teaser .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem 3rem; flex-wrap: wrap; }
.arc-teaser h2 { font-size: var(--step-1); }
.arc-teaser p { color: var(--muted); max-width: 40rem; margin-top: 0.3rem; }
.btn-on { display: inline-block; padding: 0.7rem 1.2rem; border-radius: 8px; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 600; transition: background-color 0.2s var(--ease); }
.btn-on:hover { background: var(--accent-strong); color: var(--on-accent); }

/* Список статей */
.post-list { margin-top: 0; }
.post-row { display: grid; grid-template-columns: minmax(0, 1fr) 11.5rem; gap: 1.5rem; padding-block: 1.5rem; border-top: 1px solid var(--line); }
.post-row.no-img { grid-template-columns: minmax(0, 1fr); }
.post-row h2 { font-size: var(--step-1); margin: 0.3rem 0 0.4rem; }
.post-row p { color: var(--muted); max-width: 42rem; }
.post-row img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; }

.empty { color: var(--muted); }

/* Заголовок раздела */
.page-head { margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.page-head h1 { font-size: var(--step-3); font-weight: 800; }
.page-head p { margin-top: 0.75rem; max-width: 42rem; color: var(--muted); font-size: 1.125rem; }

/* Статья */
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: '/'; margin-inline: 0.5rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.article-layout { display: grid; grid-template-columns: minmax(0, 42rem) minmax(0, 16rem); gap: clamp(2rem, 6vw, 5rem); justify-content: space-between; }
.article-head h1 { font-size: var(--step-3); font-weight: 800; margin-bottom: 0.9rem; }
.hero { margin: 1.75rem 0 0; }
.hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.hero figcaption { margin-top: 0.5rem; font-size: 0.82rem; color: var(--muted); }
.hero figcaption a { color: inherit; }

.prose { margin-top: 1.75rem; text-wrap: pretty; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--step-2); margin-top: 2.2em; scroll-margin-top: 1.5rem; }
.prose h3 { font-size: var(--step-1); margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin-inline: 0; padding: 1rem 1.25rem; background: var(--surface); border-radius: var(--radius); }
.prose strong { font-weight: 600; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; line-height: 1.5; }
.prose th, .prose td { padding: 0.65rem 0.9rem; text-align: left; vertical-align: top; }
.prose th { background: var(--surface); font-weight: 600; }
.prose tr + tr > * { border-top: 1px solid var(--line); }

.toc { position: sticky; top: 1.5rem; align-self: start; font-size: 0.925rem; line-height: 1.4; max-height: calc(100vh - 3rem); overflow-y: auto; }
.toc h2 { font-size: 0.925rem; font-weight: 700; margin-bottom: 0.6rem; letter-spacing: 0; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li + li { margin-top: 0.55rem; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }

.related { margin-top: clamp(2.5rem, 6vw, 3.5rem); padding: 1.25rem 1.5rem; background: var(--surface); border-radius: var(--radius); }
.related h2 { font-size: var(--step-1); margin-bottom: 0.5rem; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { padding-block: 0.45rem; }

/* Пагинация */
.pager { margin-top: 2rem; }
.pager ul { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.pager a, .pager [aria-current] {
  display: grid; place-items: center; min-width: 2.75rem; height: 2.75rem; padding-inline: 0.5rem;
  border-radius: 8px; text-decoration: none;
}
.pager a:hover { background: var(--surface); }
.pager [aria-current] { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* Архив */
.arc-note { padding: 1rem 1.25rem; background: var(--surface); border-radius: var(--radius); max-width: 46rem; }
.arc-search { margin-top: 1.5rem; max-width: 26rem; }
.arc-search label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 0.3rem; }
.arc-search input {
  width: 100%; height: 2.75rem; padding-inline: 0.85rem; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--muted); border-radius: 8px;
}
.arc-group { margin-top: clamp(2rem, 5vw, 3rem); }
.arc-group h2 { font-size: var(--step-1); margin-bottom: 0.6rem; }
.arc-list { list-style: none; margin: 0; padding: 0; columns: 2 26rem; column-gap: clamp(2rem, 5vw, 4rem); }
.arc-list li { display: flex; justify-content: space-between; gap: 1.5rem; padding-block: 0.6rem; border-top: 1px solid var(--line); break-inside: avoid; line-height: 1.4; }
.arc-list time { flex: none; color: var(--muted); font-size: 0.85rem; padding-top: 0.1rem; }
.arc-empty { margin-top: 2rem; color: var(--muted); }

/* Подвал */
.site-foot { margin-top: auto; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.925rem; }
.site-foot .wrap { padding-block: 2rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem; list-style: none; margin: 0 0 0.9rem; padding: 0; }
.foot-links a { color: var(--ink); text-decoration: none; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }
.site-foot p { max-width: 46rem; }
.site-foot p + p { margin-top: 0.3rem; }

@media (max-width: 62rem) {
  .featured { grid-template-columns: minmax(0, 1fr); }
  .rubric, .rubric:nth-of-type(even) { grid-template-columns: minmax(0, 1fr); }
  .rubric:nth-of-type(even) .rubric-head { order: 0; }
  .article-layout { grid-template-columns: minmax(0, 42rem); }
  .toc { position: static; order: -1; max-height: none; padding: 1rem 1.25rem; background: var(--surface); border-radius: var(--radius); margin-top: 0; }
  .article-main { display: contents; }
  .article-head { order: -2; }
  .article-rest { order: 0; }
}
@media (max-width: 42rem) {
  .site-nav { flex-basis: 100%; }
  .site-nav ul { flex-wrap: wrap; overflow: visible; gap: 0 1.1rem; }
  .site-nav .nav-archive { margin-left: 0; }
  .side-post { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .rubric-tiles { gap: 1.25rem 1rem; }
  .tile h3 { font-size: 1rem; }
  .post-row { grid-template-columns: minmax(0, 1fr) 6.5rem; gap: 1rem; }
  .post-row p { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  @supports (animation-timeline: view()) {
    .rubric, .side-post, .steps li {
      animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%;
    }
    @keyframes rise { from { opacity: 0.2; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .site-head, .site-foot, .toc, .related, .pager { display: none; }
  body { background: #fff; color: #000; }
}
