:root {
  --bg: #160d07;
  --card: #221810;
  --text: #f7f1e3;
  --muted: #bcaf9c;
  --accent: #efb656;
  --border: #4c4035;
  --ink: #160d07;
  --silver: #c9bba8;
  --bronze: #b08655;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 50% -80px, rgba(239, 182, 86, 0.09), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100px;
  z-index: 50;
  padding: 0.5rem 0.9rem;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  border-radius: 0.5rem;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0.75rem;
  color: var(--ink);
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.pill.is-active:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

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

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
  padding: 1rem 0;
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cookie-banner-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
}
.cookie-banner-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.cookie-banner-actions {
  display: flex;
  flex: none;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cookie-btn {
  appearance: none;
  font: inherit;
  cursor: pointer;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}
.cookie-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(22, 13, 7, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(239, 182, 86, 0.12);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand:hover { text-decoration: none; }

.logo-tile {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}
.logo-tile img,
.logo-tile svg { display: block; width: 2.25rem; height: 2.25rem; }

.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-name { font-weight: 700; letter-spacing: 0.01em; }
.brand-sub { color: var(--muted); font-size: 0.75rem; }

.pill-nav {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.25rem 0;
  -webkit-overflow-scrolling: touch;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: none;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}
.pill:hover { color: var(--text); text-decoration: none; border-color: var(--border); }
.pill.is-active { background: var(--accent); color: var(--ink); font-weight: 600; }
.pill.is-active:hover { color: var(--ink); }
.pill svg { flex: none; }

main { padding: 2rem 0 3rem; }

.kicker {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.kicker-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.kicker-row svg { color: var(--accent); }

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 1.25rem;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.home-intro {
  margin: 0 0 1.5rem;
}
.home-intro .lead {
  max-width: none;
  margin-bottom: 0.85rem;
}
.home-intro p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}
.home-intro p:last-child { margin-bottom: 0; }
.home-intro blockquote {
  margin: 0.85rem 0 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(239, 182, 86, 0.06);
  border-radius: 0 0.85rem 0.85rem 0;
  color: var(--text);
}
.home-intro blockquote p {
  margin: 0;
  color: var(--text);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  background: rgba(34, 24, 16, 0.65);
}
.facts svg { color: var(--accent); flex: none; }

.depth-pills { display: flex; gap: 0.4rem; margin: 0 0 1.5rem; overflow-x: auto; }
.depth-pills .pill { border-color: var(--border); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.25rem 1.35rem;
  box-shadow: inset 0 1px 0 rgba(247, 241, 227, 0.05);
}

.top3 {
  display: grid;
  grid-template-columns: 1fr 1.14fr 1fr;
  gap: 1rem;
  margin: 0 0 1.5rem;
  align-items: end;
}
.place-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 9.5rem;
  position: relative;
}
.place-card[data-p="1"] {
  order: 2;
  min-height: 11.25rem;
  border-color: rgba(239, 182, 86, 0.55);
  background:
    linear-gradient(180deg, rgba(239, 182, 86, 0.12), transparent 42%),
    var(--card);
}
.place-card[data-p="2"] { order: 1; }
.place-card[data-p="3"] { order: 3; }

.place-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.place-num {
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.trophy { color: var(--accent); }
.place-card[data-p="2"] .trophy { color: var(--silver); }
.place-card[data-p="3"] .trophy { color: var(--bronze); }

.place-name { font-size: 1.25rem; font-weight: 700; }
.place-card[data-p="1"] .place-name { font-size: 1.4rem; }
.place-name a { color: inherit; }

.article h2[id],
.article h3[id] {
  scroll-margin-top: 5rem;
}

.medal {
  display: inline-flex;
  color: var(--accent);
}
.medal svg { display: block; }

.place-score {
  margin-top: auto;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.place-card[data-p="1"] .place-score { font-size: 2.55rem; }
.score-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.trust {
  margin: 0 0 1.5rem;
  color: var(--muted);
}
.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
.trust-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0;
}
.trust-item svg { flex: none; color: var(--accent); margin-top: 0.15rem; }
.trust-item p { margin: 0; }

.cards {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.5rem;
}
.desc-card h3 { margin: 0 0 0.5rem; }
.desc-card ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.table-block { margin: 0 0 1.5rem; }
.table-block h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
}
.table-scroll { overflow-x: auto; position: relative; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table caption:not(.visually-hidden) {
  caption-side: top;
  text-align: left;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0 0 0.7rem;
}
th, td { padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}
.rank svg { color: var(--accent); }
tr.is-top td { background: rgba(239, 182, 86, 0.05); }
tr:hover td { background: rgba(239, 182, 86, 0.07); }
tr.is-top td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.table-note { margin: 0.85rem 0 0; color: var(--muted); font-size: 0.88rem; }

.toc-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 0 0 1.5rem;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.link-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.link-ico {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: rgba(239, 182, 86, 0.14);
  color: var(--accent);
}
.link-card h2,
.link-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}
.link-card p { margin: 0; color: var(--muted); }
.link-card .go { margin-left: auto; color: var(--accent); font-size: 1.2rem; }

.method {
  display: grid;
  gap: 1.25rem;
  margin: 0 0 1.5rem;
}
.method h2 {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
}
.method h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: 1.05rem;
}
.method p { margin: 0 0 0.7rem; color: var(--muted); }
.method p:last-child { margin-bottom: 0; }
.method ul, .method ol {
  margin: 0 0 0.7rem;
  padding-left: 1.2rem;
  color: var(--muted);
}

.article,
.authors {
  margin: 0 0 1.5rem;
}
.article h2 {
  margin: 1.4rem 0 0.6rem;
  font-size: 1.35rem;
}
.article h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: 1.1rem;
}
.article p,
.authors p,
.contacts p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}
.article ul, .article ol,
.contacts ul {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
  color: var(--muted);
}
.article blockquote {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(239, 182, 86, 0.06);
  border-radius: 0 0.85rem 0.85rem 0;
  color: var(--text);
}
.article blockquote p:last-child { margin-bottom: 0; }
.article .table-scroll { margin: 0 0 1rem; }
.article table th:last-child,
.article table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.article h3 + p { margin-top: 0; }

.contacts h2 {
  margin: 1.1rem 0 0.4rem;
  font-size: 1.1rem;
}

.formula {
  display: block;
  overflow-x: auto;
  margin: 0.6rem 0 1rem;
  padding: 0.9rem 1rem;
  background: rgba(22, 13, 7, 0.55);
  border-radius: 0.75rem;
  color: var(--text);
  font-family: "Cambria Math", "Times New Roman", serif;
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.45;
  text-align: center;
}
.formula.inline {
  display: inline;
  padding: 0 0.12em;
  margin: 0;
  background: none;
  border-radius: 0;
  font-size: 1.05em;
  white-space: nowrap;
}
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  font-style: italic;
}
.frac-num,
.frac-den {
  padding: 0.05em 0.4em;
  text-align: center;
}
.frac-num { border-bottom: 1px solid currentColor; }
.mathrm { font-style: normal; }
.formula sub { font-size: 0.72em; }
.math-gap { display: inline-block; width: 1.5rem; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
}
.footer-copy {
  margin: 0;
  flex: 0 0 auto;
}
.footer-rest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  min-width: 0;
}
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  min-width: 24px;
  padding: 0.15rem 0;
}

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

@media (max-width: 800px) {
  .top3,
  .toc-grid,
  .link-grid,
  .trust-row {
    grid-template-columns: 1fr;
  }
  .place-card[data-p="1"],
  .place-card[data-p="2"],
  .place-card[data-p="3"] { order: 0; min-height: 8.5rem; }
  .site-header .wrap {
    flex-wrap: wrap;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }
  .pill-nav { width: 100%; }
  .brand-sub { display: none; }
  .cookie-banner-inner { flex-direction: column; align-items: stretch; }
  .cookie-banner-actions { justify-content: flex-start; }
  .site-footer .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}
