/* breathedge2.ru — «Инструктаж по выживанию» (ManuBook SSG 2.x)
   Светлая ретро-космическая тема: мимеографная бумага + ржавый оранжевый + teal + аварийный жёлтый. */
:root {
  --paper: #f4ebd8;
  --paper-2: #ece0c6;
  --card: #fffaf0;
  --ink: #22262b;
  --ink-2: #4c5257;
  --rust: #e4572e;
  --rust-d: #b8431f;
  --teal: #2a9d8f;
  --teal-d: #1f7568;
  --hazard: #f2b233;
  --deep: #1b2a4a;
  --line: #cdbf9f;
  --shadow: 0 2px 0 rgba(34, 38, 43, .12);
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Consolas", "DejaVu Sans Mono", "Liberation Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  background-image:
    linear-gradient(rgba(205, 191, 159, .28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(205, 191, 159, .28) 1px, transparent 1px);
  background-size: 34px 34px;
}
img { max-width: 100%; height: auto; }
a { color: var(--rust-d); }
a:hover { color: var(--rust); }
h1, h2, h3, h4 { font-family: var(--sans); line-height: 1.18; letter-spacing: .01em; }
h1 { font-size: clamp(1.7rem, 3.6vw, 2.45rem); text-transform: uppercase; margin: .2em 0 .5em; }
h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  text-transform: uppercase;
  margin: 1.9em 0 .6em;
  padding-bottom: .28em;
  border-bottom: 3px solid var(--hazard);
  position: relative;
}
h2::before { content: ""; position: absolute; left: 0; bottom: -3px; width: 46px; height: 3px; background: var(--rust); }
h3 { font-size: 1.12rem; color: var(--deep); }
p { margin: .7em 0; }
.container { width: min(920px, 100% - 2.4rem); margin-inline: auto; }

/* ------------------------------------------------ header */
.site-header {
  background: var(--deep);
  color: #fdf7e8;
  border-bottom: 4px solid var(--rust);
  position: relative;
}
.site-header::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -4px; height: 4px;
  background: repeating-linear-gradient(45deg, var(--hazard) 0 12px, #22262b 12px 24px);
  opacity: .55;
}
.site-header .container { width: min(1140px, 100% - 1.4rem); }
.head-row { display: flex; align-items: center; gap: .8rem; min-height: 62px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: #fdf7e8; flex: 0 0 auto; }
.brand:hover { color: #fff; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 6px;
  background: var(--rust); color: #fff; font-family: var(--mono); font-weight: 700; font-size: 1.05rem;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.brand-text { font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; display: flex; flex-direction: column; line-height: 1.05; }
.brand-text small { font-family: var(--mono); font-weight: 400; font-size: .62rem; letter-spacing: .04em; color: var(--hazard); text-transform: uppercase; }
.nav { margin-left: auto; display: flex; gap: .1rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: #efe7d4; text-decoration: none; font-size: .82rem; font-weight: 600;
  padding: .45rem .6rem; border-radius: 4px; white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a.active { background: var(--rust); color: #fff; }
.burger { display: none; margin-left: auto; background: transparent; border: 2px solid var(--hazard); color: var(--hazard); font-size: 1.1rem; border-radius: 6px; padding: .15rem .5rem; cursor: pointer; }

/* ------------------------------------------------ crumbs */
.crumbs { font-family: var(--mono); font-size: .72rem; color: var(--ink-2); margin: .9rem 0 -.4rem; letter-spacing: .02em; }
.crumbs a { color: var(--teal-d); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { color: var(--ink-2); }

/* ------------------------------------------------ hero */
.hero {
  margin: 1.1rem 0 1.6rem;
  background: var(--card);
  border: 2px solid var(--deep);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 6px 6px 0 rgba(27, 42, 74, .16);
}
.hero-media { position: relative; aspect-ratio: 21 / 9; background: var(--deep); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-body { padding: 1.1rem 1.3rem 1.4rem; }
.tagline { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--teal-d); margin: 0 0 .3rem; }
.hero h1 { margin-top: 0; }
.lead { font-size: 1.06rem; color: var(--ink-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: .9rem;
  padding: .58rem 1rem; border-radius: 6px; border: 2px solid var(--deep);
  background: var(--card); color: var(--deep); box-shadow: var(--shadow);
}
.btn:hover { background: var(--paper-2); color: var(--deep); }
.btn-primary { background: var(--rust); border-color: var(--rust-d); color: #fff; }
.btn-primary:hover { background: var(--rust-d); color: #fff; }
.btn-lg { font-size: 1rem; padding: .7rem 1.2rem; }

/* ------------------------------------------------ cards */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.1rem 0 1.4rem; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card); border: 2px solid var(--line); border-radius: 8px;
  padding: .85rem; display: flex; flex-direction: column; gap: .4rem;
}
.card-link { transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--rust); transform: translateY(-2px); }
.card-anchor { text-decoration: none; color: inherit; display: block; }
.card-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 5px; background: var(--paper-2); display: block; }
.card-img.portrait { aspect-ratio: 1 / 1; }
.card-img.ph { display: grid; place-items: center; font-family: var(--mono); font-size: 2rem; color: var(--rust); background: var(--paper-2); }
.card-title { font-size: 1rem; margin: .1rem 0 0; color: var(--ink); }
.card-desc { font-size: .86rem; color: var(--ink-2); margin: .1rem 0; flex: 1; }
.card-top { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .68rem; color: var(--teal-d); text-transform: uppercase; letter-spacing: .05em; }
.backlink { font-family: var(--mono); font-size: .72rem; margin: .2rem 0 0; }
.backlink a { color: var(--rust-d); text-decoration: none; }
.backlink a:hover { text-decoration: underline; }

/* ------------------------------------------------ figures */
.shot { margin: 1.3rem 0; }
.shot img { width: 100%; border: 2px solid var(--deep); border-radius: 6px; display: block; }
.shot figcaption { font-family: var(--mono); font-size: .72rem; color: var(--ink-2); margin-top: .35rem; }
.shot figcaption::before { content: "› "; color: var(--rust); }

/* ------------------------------------------------ lists / steps */
.steps { list-style: none; counter-reset: st; padding: 0; margin: 1rem 0; }
.steps li {
  position: relative; counter-increment: st; background: var(--card);
  border-left: 4px solid var(--teal); border-radius: 0 6px 6px 0;
  padding: .7rem .9rem .7rem 3.1rem; margin: .55rem 0;
}
.steps li::before {
  content: counter(st); position: absolute; left: .7rem; top: .65rem;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--teal); color: #fff; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: .85rem;
}
.step-kind { display: block; font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rust-d); }

/* ------------------------------------------------ tables */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 2px solid var(--deep); }
table.tbl th, table.tbl td { border: 1px solid var(--line); padding: .5rem .65rem; text-align: left; font-size: .92rem; }
table.tbl th { background: var(--deep); color: #fdf7e8; font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }

/* ------------------------------------------------ accordion */
.acc { margin: 1rem 0; }
.acc details { background: var(--card); border: 2px solid var(--line); border-left: 5px solid var(--rust); border-radius: 6px; margin: .5rem 0; }
.acc summary { cursor: pointer; font-weight: 700; padding: .7rem .9rem; list-style: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::before { content: "▸ "; color: var(--rust); }
.acc details[open] summary::before { content: "▾ "; }
.acc-body { padding: 0 .95rem .8rem; color: var(--ink-2); }

/* ------------------------------------------------ panels */
.panel { background: var(--card); border: 2px solid var(--line); border-radius: 8px; padding: .8rem 1rem; margin: 1.1rem 0; }
.panel-amber { border-color: var(--hazard); background: #fdf3d8; }
.panel-teal { border-color: var(--teal); background: #e2f2ef; }
.panel-title { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--rust-d); margin: 0 0 .3rem; }
.note { font-size: .82rem; color: var(--ink-2); font-style: italic; }

/* ------------------------------------------------ achievements */
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin: 1rem 0; }
.ach-row { background: var(--card); border: 2px solid var(--line); border-left: 4px solid var(--hazard); border-radius: 6px; padding: .55rem .75rem; }
.ach-name { display: block; font-weight: 700; color: var(--deep); }
.ach-cond { display: block; font-size: .85rem; color: var(--ink-2); }

/* ------------------------------------------------ news */
.news-item { background: var(--card); border: 2px solid var(--line); border-radius: 8px; padding: .8rem 1rem; margin: 1rem 0; }
.news-item h3 { margin: .1rem 0 .4rem; }
.news-item .meta { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--teal-d); margin: 0; }
.news-item ul { margin: .4rem 0 .2rem; padding-left: 1.2rem; }
.news-item li { font-size: .9rem; margin: .2rem 0; }
.vk-item { display: flex; gap: .9rem; align-items: flex-start; }
.vk-item img { width: 190px; border: 2px solid var(--deep); border-radius: 6px; flex: 0 0 auto; }
@media (max-width: 620px) { .vk-item { flex-direction: column; } .vk-item img { width: 100%; } }

/* ------------------------------------------------ codes */
.code-list { display: grid; gap: .8rem; margin: 1rem 0; }
.code-card { background: var(--card); border: 2px solid var(--deep); border-radius: 8px; padding: .9rem 1rem; }
.code-val {
  display: inline-block; font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
  color: #fff; background: var(--rust-d); border-radius: 6px; padding: .2rem .7rem; cursor: pointer;
  user-select: none; letter-spacing: .12em;
}
.code-val:hover { background: var(--rust); }
.code-val.copied { background: var(--teal-d); }
.code-where { margin: .5rem 0 .2rem; }
.code-rew { font-size: .88rem; color: var(--ink-2); }
.codes-tbl td { vertical-align: top; }
.codes-tbl code.copy-code {
  font-family: var(--mono); font-weight: 700; font-size: 1.05rem; color: #fff;
  background: var(--rust-d); border-radius: 5px; padding: .15rem .55rem; cursor: pointer;
  user-select: none; letter-spacing: .1em;
}
.codes-tbl code.copy-code:hover { background: var(--rust); }
.codes-tbl code.copy-code.copied { background: var(--teal-d); }
.console-tbl code { font-family: var(--mono); background: var(--paper-2); padding: .1rem .4rem; border-radius: 4px; }
@media (max-width: 620px) {
  .codes-tbl { border: 0; }
  .codes-tbl thead { display: none; }
  .codes-tbl tr { display: block; background: var(--card); border: 2px solid var(--deep); border-radius: 8px; margin: .6rem 0; padding: .3rem .2rem; }
  .codes-tbl td { display: block; border: 0; padding: .35rem .7rem; }
  .codes-tbl td::before { content: attr(data-label); display: block; font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--teal-d); }
}

/* ------------------------------------------------ misc */
.prevnext { display: flex; justify-content: space-between; gap: 1rem; margin: 1.6rem 0 .6rem; font-family: var(--mono); font-size: .78rem; }
.prevnext a { text-decoration: none; color: var(--rust-d); }
.prevnext a:hover { text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 1rem; }
.chip { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 20px; padding: .18rem .6rem; color: var(--ink-2); }
.badge { display: inline-block; font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; background: var(--hazard); color: var(--ink); border-radius: 4px; padding: .1rem .45rem; }
.match { font-size: .82rem; color: var(--ink-2); }

/* ------------------------------------------------ footer */
.site-footer { margin-top: 2.6rem; background: var(--deep); color: #d9d2c0; border-top: 4px solid var(--rust); }
.site-footer .container { padding: 1.2rem 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .8rem; }
.foot-links a { color: #e8dfc9; text-decoration: none; }
.foot-links a:hover { color: var(--hazard); }
.disclaimer { font-size: .74rem; color: #a9a390; margin: .9rem 0 0; line-height: 1.5; }

/* ------------------------------------------------ mobile */
@media (max-width: 860px) {
  .card-grid, .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .brand-text small { display: none; }
  .nav { display: none; }
  .burger { display: block; }
  .nav.open {
    display: flex; flex-direction: column; gap: .1rem;
    position: static; width: 100%; order: 3; margin: .4rem 0 .6rem;
    background: rgba(0, 0, 0, .18); border-radius: 6px; padding: .35rem; overflow-x: visible;
  }
  .head-row { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .card-grid, .cards-2, .cards-4, .ach-grid { grid-template-columns: 1fr; }
  .hero { box-shadow: 4px 4px 0 rgba(27, 42, 74, .16); }
  .hero-media { aspect-ratio: 16 / 9; }
}
