:root {
  --bg: #0f1419;
  --surface: #1a222c;
  --surface2: #232d3a;
  --text: #e8ecf1;
  --muted: #9aa5b5;
  --accent: #6eb5ff;
  --accent-soft: rgba(110, 181, 255, 0.12);
  --border: #2d3845;
  --gold: #c9b070;
  --font: "Source Sans 3", system-ui, sans-serif;
  --serif: "Literata", Georgia, serif;
  --max: 48rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
}

a:hover {
  text-decoration: underline;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.top__back {
  font-weight: 600;
  text-decoration: none;
}

.top__meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.sonifier-tabs {
  display: flex;
  gap: 0.5rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem 0;
}

.sonifier-tabs__link {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--muted);
}

.sonifier-tabs__link:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.sonifier-tabs__link--active {
  color: var(--bg);
  background: var(--accent);
}

.doc {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.doc__hero {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.doc__kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.75rem;
}

.doc h1 {
  font-family: var(--serif);
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.doc__lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.toc {
  margin-bottom: 2.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.toc h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.toc li + li {
  margin-top: 0.35rem;
}

.toc a {
  text-decoration: none;
  font-weight: 500;
}

.toc a:hover {
  text-decoration: underline;
}

section {
  margin-bottom: 2.75rem;
}

section h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
  margin: 0 0 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

section h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.65rem;
  color: var(--accent);
}

section p,
section li {
  color: var(--text);
}

section ul,
section ol {
  padding-left: 1.2rem;
}

section li + li {
  margin-top: 0.4rem;
}

.section__see-also {
  margin: -0.25rem 0 1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.cards {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .cards--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.timeline {
  list-style: none;
  margin: 1.25rem 0 1.5rem;
  padding: 0;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  margin: 0 0 1.1rem;
  padding: 0 0 0 1.35rem;
  font-size: 0.98rem;
  color: var(--muted);
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.timeline li strong {
  color: var(--text);
}

.card {
  padding: 1.15rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--text);
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.pipeline li {
  margin-bottom: 0.5rem;
}

.formula {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  font-family: ui-monospace, monospace;
  font-size: 0.95rem;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--surface2);
  font-weight: 600;
}

.table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.table--method {
  display: block;
  overflow-x: auto;
  margin: 1.25rem 0 1.75rem;
  -webkit-overflow-scrolling: touch;
}

.table--method thead,
.table--method tbody,
.table--method tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.table--method th:first-child,
.table--method td:first-child {
  width: 18%;
}

.table--method th:nth-child(2),
.table--method td:nth-child(2) {
  width: 32%;
}

.audio-section {
  margin-top: 2rem;
}

.audio-demo {
  margin: 1.75rem 0;
  padding: 1.25rem 1.35rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.audio-demo h4 {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.12rem;
  color: var(--text);
}

.audio-demo__meta {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--gold);
}

.audio-demo__desc {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.media-player,
.audio-demo audio,
.audio-demo video {
  display: block;
  width: 100%;
  min-width: 240px;
  min-height: 48px;
  max-width: 100%;
  margin: 0.35rem 0 0.5rem;
  border-radius: 8px;
  background: #0b0f14;
}

video.media-player {
  min-height: 180px;
  max-height: 320px;
  object-fit: contain;
  background: #000;
}

.audio-demo__cite {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

.audio-demo__links {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.2rem;
  font-size: 0.92rem;
}

.audio-demo__links li + li {
  margin-top: 0.35rem;
}

.audio-section__hint {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--gold);
}

.audio-section__note {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: 10px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  font-size: 0.92rem;
  color: var(--muted);
}

.table--media {
  display: table;
  width: 100%;
  table-layout: auto;
  margin: 1rem 0 1.75rem;
}

.table--media th:nth-child(1),
.table--media td:nth-child(1) {
  width: 20%;
  min-width: 7.5rem;
}

.table--media th:nth-child(2),
.table--media td:nth-child(2) {
  width: 28%;
}

.table--media th:nth-child(3),
.table--media td:nth-child(3) {
  width: 52%;
  min-width: 16rem;
}

.table__media {
  padding-top: 0.85rem !important;
  padding-bottom: 0.85rem !important;
}

.media-block__label {
  margin: 0 0 0.25rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.table__media-cite {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.audio-demo__players {
  display: grid;
  gap: 1rem;
  margin: 0.75rem 0;
}

.audio-demo__links-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .table--media,
  .table--media thead,
  .table--media tbody,
  .table--media tr,
  .table--media th,
  .table--media td {
    display: block;
    width: 100%;
  }

  .table--media thead {
    display: none;
  }

  .table--media tr {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .table--media td::before {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gold);
  }

  .table--media td:nth-child(1)::before { content: "Метод"; }
  .table--media td:nth-child(2)::before { content: "Типичный звук"; }
  .table--media td:nth-child(3)::before { content: "Прослушать / посмотреть"; }
}

.figures .fig {
  margin: 2rem 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.figures .fig img {
  display: block;
  width: 100%;
  height: auto;
  background: #0b0f14;
}

.fig--placeholder .fig__note {
  padding: 1.5rem;
  background: var(--surface2);
}

.fig__note p {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.fig__note p:first-child strong {
  color: var(--text);
}

figcaption {
  padding: 1rem 1.15rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid var(--border);
}

.refs {
  font-size: 0.92rem;
}

.refs li {
  margin-bottom: 0.5rem;
}

.bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.bottom a {
  font-weight: 600;
  text-decoration: none;
}

.bottom__cite {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.bottom__manuscript {
  margin: 1.25rem 0 0;
  font-size: 0.72rem;
  color: var(--border);
}

.bottom__manuscript a {
  font-weight: 400;
  color: inherit;
  text-decoration: none;
  opacity: 0.65;
}

.bottom__manuscript a:hover {
  color: var(--muted);
  opacity: 1;
  text-decoration: underline;
}

@media (min-width: 720px) {
  .doc {
    padding: 3rem 2rem 5rem;
  }
}
