/* ================================================================
   КОНСИЛИУМ ВЕКОВ — дизайн-система
   Наследует язык «Полночь» из проекта meduk-relax:
   тёмное золото, жидкое стекло, Unbounded + Manrope.
   Радиусы: карточки 18px, контролы 12px, чипы pill.
   ================================================================ */

/* ============ Шрифты (self-hosted, работают офлайн) ============ */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("assets/fonts/manrope-var-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("assets/fonts/manrope-var-latin.woff2") format("woff2");
  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;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/unbounded-var-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/unbounded-var-latin.woff2") format("woff2");
  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;
}

/* ============ Темы ============ */

:root {
  --r-card: 18px;
  --r-ctrl: 12px;
  --r-chip: 999px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --content: 1180px;
  --cta-grad: linear-gradient(135deg, #f6d982, #b67a24);
  --cta-ink: #120d05;

  /* Полночь (тёмное золото) */
  --bg: #050505;
  --text: #f3ead7;
  --muted: #b9ad94;
  --faint: #83795f;
  --gold: #d8a84e;
  --gold-soft: #f4d27a;
  --gold-dim: #9b8b6b;
  --line: rgba(244, 210, 122, 0.2);
  --line-strong: rgba(244, 210, 122, 0.5);
  --input-bg: rgba(255, 255, 255, 0.045);
  --chip-active-bg: rgba(216, 168, 78, 0.16);
  --panel-solid: #12100b;
  --glass-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015) 38%, rgba(16, 13, 9, 0.5));
  --glass-border: rgba(244, 210, 122, 0.18);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glass-sheen: rgba(255, 255, 255, 0.1);
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.38);
  --cta-shadow: rgba(216, 168, 78, 0.26);
  --grain-line: rgba(255, 255, 255, 0.05);
  --stage-bg:
    radial-gradient(circle at 72% 24%, rgba(216, 168, 78, 0.16), transparent 36%),
    radial-gradient(circle at 10% 85%, rgba(82, 143, 168, 0.12), transparent 30%),
    linear-gradient(180deg, #050505 0%, #0b0907 60%, #050505 100%);
  --dialog-bg: #0d0b08;
  --toast-bg: rgba(13, 11, 8, 0.94);
  --toast-text: #f3ead7;
  --portrait-fx: grayscale(0.35) contrast(1.06) sepia(0.22);
  --portrait-fx-hover: grayscale(0) contrast(1.02) sepia(0.05);

  /* Семантика верификации */
  --ok: #8fbf72;
  --warn: #e0a63f;
  --risk: #d4705a;
  --ok-bg: rgba(143, 191, 114, 0.14);
  --warn-bg: rgba(224, 166, 63, 0.14);
  --risk-bg: rgba(212, 112, 90, 0.14);
}

html[data-theme="light"] {
  --bg: #f3f1ec;
  --text: #231e12;
  --muted: #5f5844;
  --faint: #8a8168;
  --gold: #8a6410;
  --gold-soft: #7c5a14;
  --gold-dim: #6e6248;
  --line: rgba(122, 90, 20, 0.26);
  --line-strong: rgba(122, 90, 20, 0.55);
  --input-bg: rgba(60, 48, 20, 0.055);
  --chip-active-bg: rgba(138, 100, 16, 0.14);
  --panel-solid: #fbf9f4;
  --glass-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.4));
  --glass-border: rgba(60, 48, 20, 0.16);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --glass-sheen: rgba(255, 255, 255, 0.65);
  --shadow-soft: 0 16px 40px rgba(90, 75, 40, 0.14);
  --cta-shadow: rgba(150, 108, 30, 0.28);
  --grain-line: rgba(60, 48, 20, 0.06);
  --stage-bg:
    radial-gradient(circle at 72% 24%, rgba(216, 168, 78, 0.22), transparent 40%),
    radial-gradient(circle at 10% 85%, rgba(120, 160, 180, 0.18), transparent 32%),
    linear-gradient(180deg, #f7f4ed 0%, #efe9dc 60%, #f3f1ec 100%);
  --dialog-bg: #fbf8f2;
  --toast-bg: rgba(50, 42, 26, 0.95);
  --toast-text: #f6f0e2;
  --portrait-fx: grayscale(0.2) contrast(1.03) sepia(0.12);
  --portrait-fx-hover: none;
  --ok: #4a7a32;
  --warn: #8a6410;
  --risk: #a63f28;
  --ok-bg: rgba(74, 122, 50, 0.12);
  --warn-bg: rgba(138, 100, 16, 0.12);
  --risk-bg: rgba(166, 63, 40, 0.1);
}

html[data-theme="paper"] {
  --bg: #efe6d0;
  --text: #2b2214;
  --muted: #63563e;
  --faint: #8b7c5e;
  --gold: #8a5a20;
  --gold-soft: #7c4f16;
  --gold-dim: #71603f;
  --line: rgba(110, 78, 30, 0.28);
  --line-strong: rgba(110, 78, 30, 0.58);
  --input-bg: rgba(110, 78, 30, 0.07);
  --chip-active-bg: rgba(138, 90, 32, 0.16);
  --panel-solid: #f7efdc;
  --glass-bg: linear-gradient(160deg, rgba(255, 250, 238, 0.8), rgba(250, 240, 218, 0.5));
  --glass-border: rgba(90, 64, 24, 0.2);
  --glass-inset: inset 0 1px 0 rgba(255, 252, 242, 0.9);
  --glass-sheen: rgba(255, 252, 240, 0.6);
  --shadow-soft: 0 14px 36px rgba(96, 72, 32, 0.16);
  --cta-shadow: rgba(140, 96, 34, 0.3);
  --grain-line: rgba(110, 78, 30, 0.07);
  --stage-bg:
    radial-gradient(circle at 72% 24%, rgba(180, 130, 50, 0.18), transparent 40%),
    linear-gradient(180deg, #f2e9d4 0%, #eadfc4 60%, #efe6d0 100%);
  --dialog-bg: #f7efdc;
  --toast-bg: rgba(62, 48, 26, 0.95);
  --toast-text: #f7f0de;
  --portrait-fx: sepia(0.45) contrast(1.05);
  --portrait-fx-hover: sepia(0.2);
  --ok: #4a6b2e;
  --warn: #8a5a20;
  --risk: #9c3d22;
  --ok-bg: rgba(74, 107, 46, 0.12);
  --warn-bg: rgba(138, 90, 32, 0.12);
  --risk-bg: rgba(156, 61, 34, 0.1);
}

/* ============ База ============ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

html[data-theme="paper"] body {
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(110, 78, 30, 0.016) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(110, 78, 30, 0.014) 3px 4px);
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.08; }
p { margin: 0; }
img { max-width: 100%; display: block; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
::selection { background: rgba(216, 168, 78, 0.35); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Жидкое стекло: слоистая подсветка + блюр. Web-аппроксимация, не системный материал. */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  box-shadow: var(--glass-inset), var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, var(--glass-sheen), transparent 34%);
  opacity: 0.5;
  pointer-events: none;
}
.glass > * { position: relative; }

@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--panel-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .glass::before { display: none; }
}

/* ============ Шапка ============ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(14px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand__mark {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--cta-grad);
  color: var(--cta-ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 16px var(--cta-shadow);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand__sub { font-size: 10.5px; color: var(--faint); letter-spacing: 0.09em; text-transform: uppercase; }

.nav { display: flex; gap: 3px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  padding: 8px 14px;
  border-radius: var(--r-chip);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--input-bg); }
.nav a[aria-current="page"] {
  color: var(--gold-soft);
  background: var(--chip-active-bg);
  border-color: var(--line);
}
html[data-theme="light"] .nav a[aria-current="page"],
html[data-theme="paper"] .nav a[aria-current="page"] { color: var(--gold); }

.theme-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 35% 30%, var(--gold-soft), var(--bg));
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}
.theme-btn:hover { transform: rotate(28deg) scale(1.08); }

.burger {
  display: none;
  width: 36px; height: 34px;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--line);
  background: var(--input-bg);
  cursor: pointer;
  font-size: 15px;
}

/* ============ Оболочка ============ */

.stage { background: var(--stage-bg); min-height: 100dvh; }
.wrap { max-width: var(--content); margin: 0 auto; padding: clamp(22px, 4vw, 46px) clamp(14px, 3vw, 28px) 90px; }

.view { animation: fade 0.45s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 12px;
}

.h-page { font-size: clamp(28px, 4.6vw, 46px); letter-spacing: -0.025em; }
.lede { color: var(--muted); font-size: clamp(14.5px, 1.6vw, 17px); max-width: 68ch; margin-top: 14px; }

.section-head { margin-bottom: 26px; }

/* ============ Кнопки ============ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn--cta {
  background: var(--cta-grad);
  color: var(--cta-ink);
  border-color: transparent;
  box-shadow: 0 8px 26px var(--cta-shadow);
}
.btn--cta:hover { box-shadow: 0 12px 34px var(--cta-shadow); }
.btn--lg { padding: 14px 28px; font-size: 15px; }
.btn--ghost { background: transparent; }

/* ============ Главная ============ */

.hero { padding: clamp(30px, 7vw, 76px) 0 clamp(26px, 5vw, 54px); text-align: center; }
.hero h1 {
  font-size: clamp(34px, 7vw, 74px);
  letter-spacing: -0.035em;
  background: linear-gradient(170deg, var(--text) 30%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lede { color: var(--muted); font-size: clamp(15px, 1.9vw, 19px); max-width: 60ch; margin: 20px auto 0; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }

.hero__strip {
  display: flex; justify-content: center; gap: 0; margin: 44px auto 0;
  max-width: 640px; padding: 0;
}
.hero__face {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--bg);
  margin-left: -12px;
  object-fit: cover;
  filter: var(--portrait-fx);
  transition: transform 0.35s var(--ease), filter 0.35s var(--ease);
  background: var(--panel-solid);
}
.hero__face:first-child { margin-left: 0; }
.hero__face:hover { transform: translateY(-6px) scale(1.12); filter: var(--portrait-fx-hover); z-index: 2; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr));
  gap: 16px;
  margin-top: 20px;
}

.card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
  overflow: hidden;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.card__ico { font-size: 26px; line-height: 1; }
.card h3 { font-size: 18px; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 13.5px; }
.card__more { margin-top: auto; padding-top: 12px; color: var(--gold); font-size: 12.5px; font-weight: 700; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 14px;
  margin-top: 44px;
}
.stat { padding: 20px; text-align: center; }
.stat__n { font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--gold); letter-spacing: -0.03em; }
.stat__l { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

/* ============ Консилиум ============ */

.council-bar { padding: 20px; margin-bottom: 20px; }
.council-bar__label { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; margin-bottom: 12px; }

.ask {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.ask__input {
  flex: 1 1 320px;
  padding: 13px 16px;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font-size: 15px;
  min-width: 0;
}
.ask__input::placeholder { color: var(--faint); }
.ask__input:focus { border-color: var(--line-strong); outline: none; }

.seeds { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.seed {
  padding: 7px 14px;
  border-radius: var(--r-chip);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition: all 0.22s var(--ease);
}
.seed:hover { color: var(--text); background: var(--chip-active-bg); border-color: var(--line-strong); }
.seed[aria-pressed="true"] { background: var(--chip-active-bg); color: var(--gold-soft); border-color: var(--line-strong); }
html[data-theme="light"] .seed[aria-pressed="true"],
html[data-theme="paper"] .seed[aria-pressed="true"] { color: var(--gold); }

.eras { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.era {
  padding: 7px 15px;
  border-radius: var(--r-chip);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.era:hover { color: var(--text); border-color: var(--line-strong); }
.era[aria-pressed="true"] {
  background: var(--cta-grad);
  color: var(--cta-ink);
  border-color: transparent;
}

.picker { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pick {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--r-chip);
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.pick:hover { border-color: var(--line-strong); }
.pick[aria-pressed="true"] { border-color: var(--pick-accent, var(--gold)); background: var(--chip-active-bg); }
.pick[aria-pressed="false"] { opacity: 0.5; }
.pick[aria-pressed="false"] .pick__img { filter: grayscale(1) contrast(0.9); }
.pick__img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--panel-solid); }
.pick__n { font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* Реплики консилиума */
.answers { display: flex; flex-direction: column; gap: 16px; }

.reply {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 20px;
  padding: 22px;
  border-left: 3px solid var(--reply-accent, var(--gold));
  animation: rise 0.5s var(--ease) backwards;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.reply__aside { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.reply__img {
  width: 72px; height: 72px; border-radius: 14px;
  object-fit: cover; object-position: center top;
  border: 1px solid var(--line);
  filter: var(--portrait-fx);
  background: var(--panel-solid);
  transition: filter 0.4s var(--ease);
}
.reply:hover .reply__img { filter: var(--portrait-fx-hover); }
.reply__years { font-size: 10.5px; color: var(--faint); line-height: 1.3; }

.reply__body { min-width: 0; }
.reply__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.reply__name { font-family: var(--display); font-size: 17px; font-weight: 700; }
.reply__era {
  font-size: 10.5px; padding: 2px 9px; border-radius: var(--r-chip);
  background: var(--chip-active-bg); color: var(--gold); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.reply__title { font-size: 12px; color: var(--faint); margin-bottom: 12px; }
.reply__text { font-size: 14.5px; line-height: 1.62; color: var(--text); }
.reply__text p + p { margin-top: 9px; }

.reply__quote {
  margin-top: 14px;
  padding: 12px 16px;
  border-left: 2px solid var(--reply-accent, var(--gold));
  background: var(--input-bg);
  border-radius: 0 var(--r-ctrl) var(--r-ctrl) 0;
}
.reply__quote q { font-style: italic; font-size: 13.5px; color: var(--text); }
.reply__src { display: block; margin-top: 6px; font-size: 11px; color: var(--faint); }

.reply__foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-chip);
  letter-spacing: 0.03em;
}
.tag--ok { background: var(--ok-bg); color: var(--ok); }
.tag--warn { background: var(--warn-bg); color: var(--warn); }
.tag--risk { background: var(--risk-bg); color: var(--risk); }
.tag--flat { background: var(--input-bg); color: var(--muted); }

/* Арбитр */
.arbiter {
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: linear-gradient(150deg, var(--chip-active-bg), transparent 60%), var(--panel-solid);
  animation: rise 0.5s var(--ease) backwards;
}
.arbiter__head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.arbiter__mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--cta-grad); color: var(--cta-ink);
  font-size: 18px; flex-shrink: 0;
}
.arbiter__t { font-family: var(--display); font-size: 16px; font-weight: 700; }
.arbiter__s { font-size: 11.5px; color: var(--faint); }
.arbiter__text { font-size: 14.5px; line-height: 1.62; }
.arbiter__text p + p { margin-top: 9px; }
.arbiter__verdicts { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.verdict {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline;
  font-size: 13px; padding: 9px 12px;
  background: var(--input-bg); border-radius: var(--r-ctrl);
}
.verdict__who { font-weight: 700; color: var(--gold); white-space: nowrap; }

.disclaimer {
  margin-top: 20px; padding: 14px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--r-ctrl);
  font-size: 12px; color: var(--faint);
  display: flex; gap: 10px; align-items: flex-start;
}

/* Скелетон загрузки */
.skeleton { display: flex; flex-direction: column; gap: 16px; }
.sk-row { height: 132px; border-radius: var(--r-card); background: var(--input-bg); position: relative; overflow: hidden; }
.sk-row::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--glass-sheen), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============ Одна болезнь сквозь века ============ */

.disease-tabs { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 24px; }

.d-hero { padding: 26px; margin-bottom: 8px; border-left: 3px solid var(--d-accent, var(--gold)); }
.d-hero h2 { font-size: clamp(22px, 3.2vw, 32px); letter-spacing: -0.02em; }
.d-hero__sub { color: var(--gold); font-size: 13.5px; font-weight: 600; margin-top: 6px; }
.d-hero__sum { color: var(--muted); font-size: 14.5px; margin-top: 14px; max-width: 70ch; }
.d-hero__toll {
  margin-top: 16px; padding: 11px 16px;
  background: var(--risk-bg); color: var(--risk);
  border-radius: var(--r-ctrl); font-size: 13px; font-weight: 600;
  display: inline-flex; gap: 8px; align-items: center;
}

/* Таймлайн: одна колонка на мобиле, змейка на десктопе */
.timeline { position: relative; padding: 32px 0 0 0; }
.timeline::before {
  content: ""; position: absolute;
  left: 15px; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, transparent, var(--line-strong) 8%, var(--line-strong) 92%, transparent);
}

.mile { position: relative; padding: 0 0 26px 46px; animation: rise 0.5s var(--ease) backwards; }
.mile__dot {
  position: absolute; left: 8px; top: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--mile-color, var(--gold));
  display: grid; place-items: center;
  font-size: 8px;
  z-index: 1;
}
.mile__year {
  font-family: var(--display); font-size: 12.5px; font-weight: 800;
  color: var(--mile-color, var(--gold)); letter-spacing: 0.02em;
}
.mile__card {
  margin-top: 7px; padding: 18px;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--glass-bg);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.mile__card:hover { border-color: var(--line-strong); transform: translateX(3px); }
.mile__t { font-size: 15.5px; font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
.mile__who { font-size: 12px; color: var(--gold); font-weight: 600; margin-top: 3px; }
.mile__b { font-size: 13.5px; color: var(--muted); margin-top: 9px; line-height: 1.6; }
.mile__src { font-size: 11px; color: var(--faint); margin-top: 10px; font-style: italic; }
.mile__flag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em;
  padding: 2px 9px; border-radius: var(--r-chip); margin-bottom: 8px;
}

.d-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; margin-top: 24px; }
.d-foot__box { padding: 22px; }
.d-foot__box h4 { font-size: 14px; color: var(--gold); margin-bottom: 9px; letter-spacing: 0.01em; }
.d-foot__box p { font-size: 13.5px; color: var(--muted); }

/* ============ Атлас ============ */

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 16px;
}
.art {
  padding: 0; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.art:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.art__fig { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--panel-solid); }
.art__img {
  width: 100%; height: 100%; object-fit: cover;
  filter: var(--portrait-fx);
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
}
.art:hover .art__img { transform: scale(1.06); filter: var(--portrait-fx-hover); }
.art__sign {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  padding: 8px 12px;
  border-radius: var(--r-ctrl);
  background: rgba(8, 6, 3, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f3ead7;
  font-size: 11.5px; font-weight: 700;
  border: 1px solid rgba(244, 210, 122, 0.25);
}
.art__meta { padding: 15px 16px 17px; }
.art__t { font-size: 14.5px; font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
.art__a { font-size: 12px; color: var(--faint); margin-top: 3px; }
.art__dx { font-size: 12.5px; color: var(--gold); font-weight: 600; margin-top: 9px; }

/* Модалка картины */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: clamp(10px, 3vw, 28px);
  background: rgba(4, 3, 2, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade 0.3s var(--ease);
  overflow-y: auto;
}
.modal__box {
  width: min(920px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--dialog-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}
.modal__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.modal__fig { background: #0a0806; display: grid; place-items: center; min-height: 240px; }
.modal__fig img { width: 100%; height: 100%; max-height: 92dvh; object-fit: contain; }
.modal__side { padding: 26px; overflow-y: auto; }
.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--dialog-bg); color: var(--text);
  cursor: pointer; font-size: 16px; line-height: 1;
}
.modal__box { position: relative; }
.m-block { margin-top: 18px; }
.m-block h5 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.11em; color: var(--gold); margin-bottom: 7px; font-family: var(--body); font-weight: 800; }
.m-block p { font-size: 13.5px; color: var(--muted); line-height: 1.62; }

/* ============ Ночная смена ============ */

.shift {
  max-width: 760px; margin: 0 auto;
  --shift-glow: rgba(216, 168, 78, 0.1);
}
.shift__frame {
  padding: 0; overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--panel-solid);
}
.shift__bar {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--input-bg);
  font-size: 12.5px;
}
.shift__time { font-family: var(--display); font-weight: 800; color: var(--gold); font-size: 15px; letter-spacing: 0.03em; }
.shift__place { color: var(--faint); }
.shift__prog { margin-left: auto; display: flex; gap: 4px; }
.shift__pip { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.shift__pip--on { background: var(--gold); }

.shift__body { padding: 26px; }
.shift__text { font-size: 15.5px; line-height: 1.7; animation: fade 0.4s var(--ease); }
.shift__text p + p { margin-top: 11px; }

.vitals {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 9px; margin-top: 20px;
}
.vital {
  padding: 11px 12px;
  border-radius: var(--r-ctrl);
  background: var(--input-bg);
  border: 1px solid var(--line);
}
.vital__l { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 700; }
.vital__v { font-family: var(--display); font-size: 15px; font-weight: 700; margin-top: 3px; }
.vital--alarm { border-color: var(--risk); background: var(--risk-bg); }
.vital--alarm .vital__v { color: var(--risk); }
.vitals__note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-style: italic; }

.teach {
  margin-top: 18px; padding: 12px 16px;
  border-left: 3px solid var(--gold);
  background: var(--chip-active-bg);
  border-radius: 0 var(--r-ctrl) var(--r-ctrl) 0;
  font-size: 12.5px; color: var(--text);
}

.choices { display: flex; flex-direction: column; gap: 9px; margin-top: 24px; }
.choice {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 17px;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: all 0.22s var(--ease);
}
.choice:hover { border-color: var(--line-strong); transform: translateX(4px); background: var(--chip-active-bg); }
.choice__i {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: var(--faint);
}

/* Финал */
.outcome { padding: 26px; animation: rise 0.5s var(--ease); }
.outcome__badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: var(--r-chip);
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
}
.outcome h3 { font-size: 22px; margin-top: 14px; letter-spacing: -0.02em; }
.outcome__debrief { font-size: 14.5px; color: var(--muted); margin-top: 12px; line-height: 1.65; }
.outcome__rule {
  margin-top: 16px; padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctrl);
  font-size: 12.5px; color: var(--muted);
}
.outcome__rule b { color: var(--gold); }
.outcome__foot { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.trace { margin-top: 22px; }
.trace h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); margin-bottom: 10px; font-family: var(--body); font-weight: 800; }
.trace__row {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.trace__row:last-child { border-bottom: 0; }
.trace__t { color: var(--faint); font-family: var(--display); font-size: 11px; font-weight: 700; }

/* ============ Ночная смена: выбор кейса и геймификация ============ */

.rankbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px 24px;
  align-items: center;
  padding: 20px 24px;
  margin-bottom: 22px;
}
.rankbar__rank { font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--gold); }
.rankbar__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.rankbar__stats { display: flex; gap: 22px; }
.rankbar__stat { text-align: center; }
.rankbar__stat b { font-family: var(--display); font-size: 22px; font-weight: 800; display: block; letter-spacing: -0.02em; }
.rankbar__stat span { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.rankbar__track { grid-column: 1 / -1; height: 7px; border-radius: 999px; background: var(--input-bg); overflow: hidden; }
.rankbar__track span { display: block; height: 100%; border-radius: 999px; background: var(--cta-grad); transition: width 0.6s var(--ease); }

.gcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr));
  gap: 15px;
}
.gcard {
  --accent: var(--gold);
  text-align: left;
  padding: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 3px solid var(--accent);
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease);
}
.gcard:hover { transform: translateY(-4px); }
.gcard__top { display: flex; align-items: center; justify-content: space-between; }
.gcard__ico { font-size: 26px; line-height: 1; }
.gcard__diff { display: inline-flex; gap: 4px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.dot--on { background: var(--accent); }
.gcard__cat { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 700; margin-top: 4px; }
.gcard__t { font-size: 16px; letter-spacing: -0.01em; }
.gcard__sub { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.gcard__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.gcard__go { font-size: 12px; font-weight: 700; color: var(--gold); }

.star { color: var(--line-strong); font-size: 15px; letter-spacing: 1px; }
.star--on { color: var(--gold-soft); }
html[data-theme="light"] .star--on, html[data-theme="paper"] .star--on { color: var(--gold); }
.gcard__stars { line-height: 1; }

/* Карточка пациента над сценарием */
.shift__topline { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.shift__back {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--r-ctrl);
  border: 1px solid var(--line); background: var(--input-bg);
  display: grid; place-items: center; font-size: 16px; color: var(--text);
}
.shift__back:hover { border-color: var(--line-strong); }
.shift__case { --accent: var(--gold); font-family: var(--display); font-weight: 700; font-size: 14.5px; color: var(--text); }

.patient {
  display: flex; align-items: center; gap: 15px;
  padding: 15px 18px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--glass-bg);
}
.patient__ava {
  --accent: var(--gold);
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 13px;
  display: grid; place-items: center; font-size: 24px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border: 1px solid var(--accent);
}
.patient__name { font-family: var(--display); font-weight: 700; font-size: 15px; }
.patient__dx { font-size: 12.5px; color: var(--gold); font-weight: 600; margin-top: 2px; }
.patient__adm { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

/* Риск-кодировка выбора: тонкий сигнал, не подсказка правильного ответа */
.choice--safe:hover { border-color: var(--ok); }
.choice--caution:hover { border-color: var(--warn); }
.choice--danger:hover { border-color: var(--risk); }

.outcome__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.outcome__stars .star { font-size: 20px; }
.outcome__foot { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

@media (max-width: 560px) {
  .rankbar { grid-template-columns: 1fr; }
  .rankbar__stats { justify-content: flex-start; }
}

/* ============ Скетч-арт сцены игры ============ */

.scene { color: var(--accent, var(--gold)); }
.scene__svg { width: 100%; height: 100%; display: block; }
.scene__ecg { color: var(--accent, var(--gold)); }

/* Генерированная гравюра (assets/scenes/*.webp): заполняет контейнер целиком,
   поверх — лёгкая тонировка акцентом кейса, чтобы сцены жили в палитре сайта. */
.scene__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(0.12) saturate(0.92);
  transition: transform 0.5s var(--ease);
}
html[data-theme="midnight"] .scene__img { filter: sepia(0.15) saturate(0.85) brightness(0.88); }
.scene__fb { position: absolute; inset: 10px; display: grid; place-items: center; }

/* Баннер иллюстрации на карточке выбора кейса */
.gcard__art {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--r-card) - 1px) calc(var(--r-card) - 1px) 0 0;
  margin: -20px -20px 8px;
  padding: 14px 20px 6px;
  height: 138px;
  background:
    radial-gradient(120% 90% at 78% 10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent);
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.gcard__art .scene__svg { max-height: 100px; filter: drop-shadow(0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent)); }

/* Широкая сцена на экране кейса */
.scene--wide {
  position: relative;
  overflow: hidden;
  height: 190px;
  margin-bottom: 14px;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background:
    radial-gradient(90% 120% at 82% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    var(--glass-bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.scene--wide .scene__svg { max-height: 128px; }

@media (prefers-reduced-motion: no-preference) {
  .gcard:hover .scene__svg { transform: scale(1.04) rotate(-0.5deg); transition: transform 0.4s var(--ease); }
  .gcard:hover .scene__img { transform: scale(1.06); }
}

/* ============ Гравюры разделов ============ */

.home-art {
  position: relative;
  overflow: hidden;
  height: clamp(170px, 30vw, 300px);
  margin-top: 26px;
  padding: 0;
}
.home-art__cap {
  position: absolute;
  left: 14px;
  bottom: 12px;
  max-width: calc(100% - 28px);
  padding: 8px 14px;
  border-radius: var(--r-ctrl);
  background: rgba(8, 6, 3, 0.66);
  color: #f3ead7;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(244, 210, 122, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.d-hero { display: grid; grid-template-columns: 1fr; gap: 18px; }
.d-hero__art {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}
@media (min-width: 760px) {
  .d-hero { grid-template-columns: 1fr 260px; align-items: stretch; }
  .d-hero__art { aspect-ratio: auto; min-height: 170px; }
}

/* ============ Блок канала ============ */

.tgcta {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  margin-top: 16px;
}
.tgcta__ico { font-size: 30px; line-height: 1; flex-shrink: 0; }
.tgcta__text { flex: 1; min-width: 0; }
.tgcta h3 { font-size: 16px; letter-spacing: -0.01em; }
.tgcta p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.tgcta__btn { flex-shrink: 0; }

@media (max-width: 560px) {
  .tgcta { flex-wrap: wrap; }
  .tgcta__btn { width: 100%; }
}

/* ============ Подвал ============ */

.foot {
  border-top: 1px solid var(--line);
  padding: 30px clamp(14px, 3vw, 28px);
  color: var(--faint);
  font-size: 12px;
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  max-width: var(--content); margin: 0 auto;
}
.foot a { color: var(--muted); }
.foot a:hover { color: var(--gold); }
.foot__sep { margin-left: auto; }

/* ============ Адаптив ============ */

@media (max-width: 900px) {
  .modal__grid { grid-template-columns: 1fr; }
  .modal__fig img { max-height: 44dvh; }
}

@media (max-width: 720px) {
  .burger { display: grid; place-items: center; margin-left: auto; }
  .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 4px;
    padding: 12px;
    background: var(--panel-solid);
    border-bottom: 1px solid var(--line);
    margin-left: 0;
  }
  .nav[data-open="true"] { display: flex; }
  .topbar { position: relative; flex-wrap: wrap; }
  .reply { grid-template-columns: 56px 1fr; gap: 14px; padding: 18px; }
  .reply__img { width: 52px; height: 52px; }
  .reply__years { font-size: 9.5px; }
  .brand__sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .topbar, .hero__cta, .choices, .ask, .seeds, .picker, .foot { display: none; }
  .stage { background: #fff; }
  body { color: #000; }
}
