/* ============================================================
   Отсечка — конкурс в магистратуру ВоГУ 2026
   ============================================================ */

:root {
  --paper:        #e6eaf1;
  --paper-raised: #f6f8fb;
  --paper-sunk:   #dde2ec;
  --ink:          #101620;
  --ink-soft:     #586273;
  --ink-faint:    #8a94a5;
  --rule:         #c6cddb;
  --rule-strong:  #98a3b6;
  --accent:       #2033dc;
  --accent-wash:  #dfe3ff;
  --budget:       #0d6a4e;
  --budget-wash:  #d6ece2;
  --paid:         #8a5f10;
  --paid-wash:    #f0e5cf;

  --grid: 1px solid var(--rule);
  --shadow: 0 1px 0 var(--rule), 0 12px 32px -24px #101620;

  --font-display: "IBM Plex Sans Condensed", "Arial Narrow", Impact, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #0f131a;
    --paper-raised: #171d27;
    --paper-sunk:   #0a0d13;
    --ink:          #e7ecf4;
    --ink-soft:     #98a2b4;
    --ink-faint:    #6b7688;
    --rule:         #262e3c;
    --rule-strong:  #3d4757;
    --accent:       #8896ff;
    --accent-wash:  #1c2340;
    --budget:       #3ac795;
    --budget-wash:  #122a23;
    --paid:         #d8a648;
    --paid-wash:    #2b2314;
    --shadow: 0 1px 0 var(--rule), 0 12px 32px -24px #000;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 88px 88px, 88px 88px;
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, transparent 40%, var(--paper) 100%);
  pointer-events: none;
  z-index: 0;
}

.sheet {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 96px;
}

body { overflow-x: hidden; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- шапка */

.masthead { padding: 56px 0 40px; }

.masthead__meta {
  margin: 0 0 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.masthead__meta .dot { margin: 0 8px; }

.masthead__title {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(64px, 15vw, 148px);
  line-height: 0.86;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.masthead__lede {
  max-width: 56ch;
  margin: 32px 0 0;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--ink-soft);
}

/* ---------------------------------------------------------- направления */

.programs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  border: var(--grid);
  background: var(--rule);
}

.program {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 20px 20px 18px;
  text-align: left;
  font: inherit;
  color: var(--ink-soft);
  background: var(--paper-raised);
  cursor: pointer;
  display: grid;
  gap: 6px;
  transition: background 120ms, color 120ms;
}

.program:hover { background: var(--paper-sunk); }

.program[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper-raised);
}

.program__code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.program[aria-selected="true"] .program__code { color: var(--paper-sunk); opacity: 0.75; }

.program__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.program[aria-selected="true"] .program__name { color: var(--paper-raised); }

.program__stats {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* ---------------------------------------------------------- поиск */

.finder {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 32px;
  align-items: start;
  padding: 44px 0 8px;
}

.finder__field { position: relative; }

.finder__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.finder__input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink);
  background: var(--paper-raised);
  border: 2px solid var(--ink);
  border-radius: 0;
  outline-offset: 2px;
}
.finder__input::placeholder { color: var(--ink-faint); }
.finder__input:focus-visible { outline: 2px solid var(--accent); }

.finder__hint {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--ink-faint);
}

.suggest {
  position: absolute;
  z-index: 20;
  top: calc(100% - 20px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--paper-raised);
  border: 2px solid var(--ink);
  border-top: 0;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.suggest li {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: var(--grid);
}
.suggest li:first-child { border-top: 0; }
.suggest li:hover,
.suggest li[aria-selected="true"] { background: var(--accent-wash); }
.suggest b { font-weight: 600; }
.suggest span { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); }

/* ---------------------------------------------------------- вердикт */

.finder__verdict { min-height: 1px; }

.verdict {
  border: 2px solid var(--ink);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}

.verdict__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  padding: 18px 22px 14px;
  border-bottom: var(--grid);
}

.verdict__place {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.verdict__place small {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-faint);
  margin-left: 6px;
}

.verdict__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.1;
  margin-left: auto;
  text-align: right;
}

.verdict__math {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: var(--grid);
}
.verdict__cell {
  flex: 1 1 90px;
  padding: 12px 22px;
  border-left: var(--grid);
}
.verdict__cell:first-child { border-left: 0; }
.verdict__cell dt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.verdict__cell dd {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
}

.verdict__status {
  padding: 14px 22px 16px;
  font-size: 15.5px;
}
.verdict__status b { font-weight: 600; }
.verdict__status.is-budget { background: var(--budget-wash); color: var(--budget); }
.verdict__status.is-paid   { background: var(--paid-wash); color: var(--paid); }
.verdict__status.is-out    { color: var(--ink-soft); }

.verdict__gap {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: inherit;
  opacity: 0.85;
}

.verdict__link {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.verdict__prio {
  margin: 0;
  padding: 12px 22px 14px;
  border-top: var(--grid);
  font-size: 14.5px;
  color: var(--ink-soft);
}
.verdict__prio b { color: var(--ink); font-weight: 600; font-family: var(--font-mono); }

.verdict--empty {
  border: 1px dashed var(--rule-strong);
  padding: 20px 22px;
  color: var(--ink-faint);
  font-size: 15px;
  background: none;
  box-shadow: none;
}

/* ---------------------------------------------------------- секции */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 18px;
}

.section-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.section-head__note {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-faint);
}

.scale { padding-top: 52px; }
.listing { padding-top: 56px; }

/* ---------------------------------------------------------- шкала */

.scale__plot { overflow-x: auto; padding-bottom: 4px; }
.scale__plot svg { display: block; min-width: 620px; width: 100%; height: auto; }

.sc-tick { fill: var(--rule-strong); }
.sc-tick--budget { fill: var(--budget); }
.sc-tick--paid { fill: var(--paid); }
.sc-tick--me { fill: var(--accent); }

.sc-axis { stroke: var(--rule-strong); stroke-width: 1; }
.sc-axis-text {
  fill: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 11px;
}
.sc-cut { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 4; }
.sc-cut-label {
  fill: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
}
.sc-me-label {
  fill: var(--accent);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
}

/* ---------------------------------------------------------- переключатель */

.controls { margin-bottom: 18px; }

.switch {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  padding: 12px 14px;
  border: 1px dashed var(--rule-strong);
  max-width: 620px;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch__box {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border: 2px solid var(--ink);
  background: var(--paper-raised);
  position: relative;
}
.switch input:checked + .switch__box { background: var(--ink); }
.switch input:checked + .switch__box::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0px;
  width: 6px;
  height: 10px;
  border: solid var(--paper-raised);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.switch input:focus-visible + .switch__box { outline: 2px solid var(--accent); outline-offset: 2px; }

.switch__text { display: grid; gap: 2px; }
.switch__title { font-size: 15px; font-weight: 500; }
.switch__sub { font-size: 13px; color: var(--ink-faint); }

/* ---------------------------------------------------------- таблица */

.table-wrap { overflow-x: auto; }

.rank {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}

.rank thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding: 8px 10px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.col-num, .col-sum, .col-place { text-align: right !important; }
.col-place { width: 76px; }
.col-num { width: 56px; }
.col-sum { width: 78px; }

.rank tbody tr { border-bottom: var(--grid); cursor: pointer; }
.rank tbody tr:hover { background: var(--paper-raised); }

.rank td { padding: 9px 10px; vertical-align: top; }

.r-place {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink-soft);
  white-space: nowrap;
}
.r-fio { font-weight: 500; }

.r-also {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
}

/* ВИ и ИД под фамилией — только на узких экранах */
.r-mini { display: none; }
.r-also i { font-style: normal; color: var(--budget); font-weight: 500; }
.r-also em { font-style: normal; color: var(--ink-soft); font-weight: 500; }

.r-num, .r-sum {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.r-num { color: var(--ink-soft); }
.r-sum { font-weight: 600; font-size: 17px; }
.r-id-zero { color: var(--ink-faint); }

.rank tbody tr.is-me {
  background: var(--accent-wash);
  box-shadow: inset 3px 0 0 var(--accent);
}
.rank tbody tr.is-me:hover { background: var(--accent-wash); }
.rank tbody tr.is-me .r-fio { color: var(--accent); font-weight: 600; }

.rank tbody tr.is-budget .r-place::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 7px;
  vertical-align: 2px;
  background: var(--budget);
}
.rank tbody tr.is-paid .r-place::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 7px;
  vertical-align: 2px;
  background: var(--paid);
  opacity: 0.7;
}

.rank tbody tr.is-drained { opacity: 0.5; }
.rank tbody tr.is-drained .r-sum { font-weight: 400; }

tr.divider { cursor: default; border-bottom: 0 !important; }
tr.divider:hover { background: none !important; }
tr.divider td {
  padding: 12px 10px 6px;
  border-top: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
tr.divider--paid td { border-top: 1px dashed var(--rule-strong); }

/* ---------------------------------------------------------- без ВИ */

.novi { margin-top: 28px; }
.novi h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.novi p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-faint); max-width: 62ch; }
.novi ul { margin: 0; padding: 0; list-style: none; }
.novi li {
  padding: 7px 0;
  border-top: var(--grid);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 15px;
}
.novi li span { font-family: var(--font-mono); color: var(--ink-soft); }

/* ---------------------------------------------------------- подвал */

.colophon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  margin-top: 72px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}

.colophon h3 {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.colophon p { margin: 0; font-size: 14px; color: var(--ink-soft); }

.sources { margin: 0; padding: 0; list-style: none; }
.sources li {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  padding: 3px 0;
  line-height: 1.4;
}

/* ---------------------------------------------------------- карточка ИД */

.detail[hidden] { display: none; }
.detail {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.detail__scrim { position: absolute; inset: 0; background: #101620cc; }

.detail__panel {
  position: relative;
  width: min(680px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  background: var(--paper-raised);
  border: 2px solid var(--ink);
  padding: 26px 28px 28px;
  box-shadow: 0 30px 60px -30px #000;
}

.detail__close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border: var(--grid);
  background: none;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
}
.detail__close:hover { background: var(--paper-sunk); color: var(--ink); }

.detail__name {
  margin: 0 40px 2px 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}
.detail__sub {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
}

.ach { border-top: var(--grid); padding: 12px 0; display: flex; gap: 16px; }
.ach__ball {
  flex: none;
  width: 46px;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  text-align: right;
}
.ach__ball.is-zero { color: var(--ink-faint); font-weight: 400; }
.ach__what { font-size: 14.5px; }
.ach__meta {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
}
.ach__where {
  margin-left: 10px;
  padding: 1px 6px;
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  white-space: nowrap;
}

.ach.is-dup { opacity: 0.5; }
.ach.is-dup .ach__what::after {
  content: " — повтор, не засчитан";
  color: var(--paid);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.detail__total {
  border-top: 2px solid var(--ink);
  margin-top: 4px;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 15px;
}
.detail__total b { font-size: 22px; }
.detail__capped { color: var(--paid); font-size: 12.5px; margin-top: 6px; }
.detail__none { color: var(--ink-faint); font-size: 15px; }

/* ---------------------------------------------------------- адаптив */

@media (max-width: 780px) {
  .masthead { padding: 36px 0 28px; }
  .finder { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .verdict__name { margin-left: 0; text-align: left; width: 100%; }
  .rank { font-size: 14.5px; }
  .rank td { padding: 8px 6px; }
  .col-place { width: 62px; }
  .col-num { width: 42px; }
  .col-sum { width: 60px; }
  .r-sum { font-size: 15.5px; }
  .switch { padding: 10px 12px; }
  .detail__panel { padding: 22px 18px 24px; }
}

@media (max-width: 560px) {
  .rank th.col-num, .rank td.r-num { display: none; }
  .col-place { width: 56px; }
  .col-sum { width: 54px; }
  .rank { font-size: 14px; }
  .r-mini {
    display: block;
    margin-top: 2px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--ink-soft);
  }
  .r-sum { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
