/* «РЕД ОС» — общий стиль сайта */
:root {
  --red: #d7192d;
  --red-dark: #a8101f;
  --red-soft: #fdecee;
  --bg: #ffffff;
  --bg-alt: #f6f6f7;
  --card: #ffffff;
  --text: #1c1c1f;
  --muted: #5d5d66;
  --line: #e3e3e8;
  --shadow: 0 6px 24px rgba(20, 20, 30, .08);
  --radius: 14px;
  --maxw: 1160px;
  --font: "Segoe UI", "Helvetica Neue", Roboto, Arial, system-ui, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121215; --bg-alt: #1a1a1f; --card: #1f1f25; --text: #ececf1;
    --muted: #a5a5b0; --line: #2f2f38; --red-soft: #3a1418;
    --shadow: 0 6px 24px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.6 var(--font); -webkit-text-size-adjust: 100%;
}
img, svg, video, iframe { max-width: 100%; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
code, pre { font-family: var(--mono); font-size: .9em; }
pre { background: #1d1d22; color: #f1f1f1; padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--card); padding: 8px 12px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
section { padding: 56px 0; }
section.alt { background: var(--bg-alt); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* Шапка */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none; white-space: nowrap; }
.logo b { background: var(--red); color: #fff; border-radius: 8px; padding: 2px 8px; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a, .nav summary {
  color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px;
  font-size: .95rem; cursor: pointer; list-style: none;
}
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: " ▾"; font-size: .75em; }
.nav a:hover, .nav summary:hover, .nav a[aria-current="page"] { background: var(--red-soft); color: var(--red); }
.nav details { position: relative; }
.nav details > div {
  position: absolute; top: 100%; left: 0; min-width: 210px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
  display: flex; flex-direction: column;
}
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 1.2rem; color: var(--text); }
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--card);
    flex-direction: column; align-items: stretch; padding: 10px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav details > div { position: static; box-shadow: none; border: 0; padding-left: 12px; }
}

/* Подвал */
.site-footer { background: #17171b; color: #cfcfd6; padding: 36px 0; font-size: .92rem; }
.site-footer a { color: #ff8a96; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }

/* Кнопки, бейджи */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--red); color: #fff; padding: 10px 18px;
  border-radius: 10px; text-decoration: none; font-weight: 600; border: 0; cursor: pointer; font: inherit; }
.btn:hover { background: var(--red-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--red); border: 2px solid var(--red); }
.btn.ghost:hover { background: var(--red-soft); }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--red-soft); color: var(--red); }
.todo { display: inline-block; background: #ffd400; color: #222; font-weight: 800; font-size: .78rem; padding: 2px 8px; border-radius: 6px; letter-spacing: .03em; }
.todo-box { border: 2px dashed #e0b800; background: color-mix(in srgb, #ffd400 12%, var(--card)); border-radius: var(--radius); padding: 18px; }

/* Карточки */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .4em; }
a.card { display: block; color: inherit; text-decoration: none; transition: transform .2s, border-color .2s; }
a.card:hover { transform: translateY(-3px); border-color: var(--red); }
.role-card { border-top: 6px solid var(--red); }
.role-card ul { padding-left: 1.1em; margin: .4em 0 0; }
.stat { font-size: 2rem; font-weight: 800; color: var(--red); line-height: 1.1; }

figure { margin: 0; }
figcaption, .credit { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.credit a { color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-alt); }
.table-scroll { overflow-x: auto; }

/* Герой */
.hero { background: linear-gradient(135deg, #8f0b18, var(--red) 55%, #ff5a5f); color: #fff; padding: 72px 0 64px; }
.hero .lead { color: #ffe4e6; }
.hero .btn { background: #fff; color: var(--red); }
.hero .btn.ghost { background: transparent; color: #fff; border-color: #fff; }
.page-head { background: var(--bg-alt); border-bottom: 1px solid var(--line); padding: 40px 0 28px; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }

/* Анимация появления */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

.embed { width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-alt); }

@media print {
  .site-header, .site-footer, .menu-btn, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .reveal { opacity: 1; transform: none; }
}
