/* Шрифты лежат локально: shared/assets/fonts, кириллица и латиница, вариативные начертания. */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/onest-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/unbounded-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/unbounded-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: 400 600;
  font-display: swap;
  src: url("/assets/fonts/unbounded-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/fonts/unbounded-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f4efe6;
  --sheet: #fbf8f3;
  --ink: #1a1714;
  --ink-2: #3b352e;
  --muted: #756b5f;
  --line: #e2d9cb;
  --accent: #b8692b;
  --accent-deep: #8a4b1c;
  --accent-soft: #f1dfca;
  --dark: #13110e;
  --cream-text: #f3ece1;
  --display: Unbounded, "Arial Black", sans-serif;
  --text: Onest, "Segoe UI", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(900px 480px at 100% -10%, rgba(184, 105, 43, 0.10), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.62;
}

a {
  color: inherit;
  text-decoration-color: rgba(184, 105, 43, 0.5);
  text-underline-offset: 0.2em;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--accent-soft); }

.wrap { width: min(1080px, calc(100% - 2.6rem)); margin-inline: auto; }

/* Шапка */

.mast {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 88% -30%, rgba(224, 164, 106, 0.22), transparent 62%),
    var(--dark);
  color: var(--cream-text);
}

.mast a { color: var(--cream-text); text-decoration-color: rgba(243, 236, 225, 0.35); }

.mast a:hover { color: #fff; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.35rem 0 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: #a39785;
}

.langs {
  display: flex;
  gap: 0.2rem;
  margin: 0;
  padding: 0.2rem;
  border: 1px solid rgba(243, 236, 225, 0.16);
  border-radius: 999px;
}

.langs a,
.langs span { padding: 0.15rem 0.65rem; border-radius: 999px; text-decoration: none; }

.langs [aria-current="page"] { background: var(--cream-text); color: var(--dark); font-weight: 500; }

.mast-inner { padding: clamp(1.6rem, 5vh, 3.4rem) 0 2.6rem; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  color: #e0a46a;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.eyebrow::before {
  content: "";
  width: 2.2rem;
  height: 1px;
  background: currentColor;
}

.eyebrow a { text-decoration: none; }

h1 {
  margin: 1.1rem 0 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 6.2vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.94;
}

.role {
  margin: 1rem 0 0;
  color: #c9bdaa;
  font-size: 1.05rem;
}

main.wrap { flex: 1 0 auto; padding: 2.9rem 0 3.4rem; }

.lead {
  max-width: 40rem;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.intro p,
.prose p { max-width: 42rem; margin: 0.85rem 0 0; color: var(--ink-2); }

h2 {
  margin: 0 0 0.9rem;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

/* Карточки разделов и тестов */

.cards,
.tests {
  display: grid;
  gap: 0.85rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.card,
.test {
  display: block;
  padding: 1.25rem 1.4rem 1.4rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 12px;
}

a.card,
.test h2 a { color: inherit; text-decoration: none; }

a.card:hover,
.test:hover { border-color: #d3b596; }

a.card:hover h2,
.test:hover h2 { color: var(--accent-deep); }

.label {
  display: block;
  margin: 0 0 0.45rem;
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.card h2,
.test h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.75rem); }

.card p,
.test p { margin: 0.45rem 0 0; color: var(--ink-2); }

.card.is-disabled { background: transparent; border-style: dashed; color: var(--muted); }

.card.is-disabled .label,
.card.is-disabled h2 { color: var(--muted); }

.more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  color: var(--accent-deep);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.more::after { content: "→"; transition: transform 0.25s ease; }

.more:hover::after { transform: translateX(0.25rem); }

/* Очередь */

.queue { margin-top: 3rem; }

.queue ul {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: queue;
  border-top: 1px solid var(--line);
}

.queue li {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  counter-increment: queue;
}

.queue li::before {
  content: counter(queue, decimal-leading-zero);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.note { margin: 0.4rem 0 0.9rem; color: var(--muted); }

.when {
  margin: 0 0 0.45rem;
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
}

/* Инструкция */

.instruction {
  margin-top: 1.8rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.instruction summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
}

.instruction summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 12px;
}

.instruction .file-link { margin: 0; padding: 0 1.25rem; font-family: var(--mono); font-size: 0.82rem; }

.instruction pre {
  margin: 0.9rem 0 0;
  padding: 1.1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
}

/* Результаты */

.results { margin-top: 2.8rem; }

.result {
  margin-top: 1rem;
  padding: 1.25rem 1.4rem 1.45rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.result h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin: 1.1rem 0 0;
}

.shots figure { margin: 0; }

.shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #000;
}

.shot-slot {
  display: grid;
  place-items: center;
  min-height: 9.5rem;
  padding: 1rem;
  border: 1px dashed #d7c7b2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.shots figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.run-meta {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 0.85rem 2rem;
  margin: 1.2rem 0 0;
}

.run-meta div { margin: 0; }

.run-meta dt {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.run-meta dd { margin: 0.2rem 0 0; font-variant-numeric: tabular-nums; }

.impression { margin: 1.1rem 0 0; color: var(--ink-2); }

.play {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.2rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--dark);
  color: var(--cream-text);
  font-weight: 600;
  text-decoration: none;
}

.play::after { content: "→"; }

.play:hover { background: var(--accent); color: #fff; }

footer {
  padding: 0 0 2.6rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

footer .wrap {
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 700px) {
  .mast-inner { padding-top: 1.6rem; }

  main.wrap { padding-top: 2.1rem; }

  .shots,
  .run-meta { grid-template-columns: 1fr; }
}

/* Страница 404 */

body.notfound {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2.5rem 1.5rem;
}

.nf { width: min(34rem, 100%); }

.nf-code {
  margin: 0;
  color: var(--accent);
  font-family: var(--display);
  font-size: clamp(4rem, 18vw, 8rem);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 0.84;
}

.nf h1 { margin: 1.1rem 0 0; font-size: clamp(1.4rem, 4vw, 2rem); }

.nf p { margin: 0.7rem 0 0; color: var(--ink-2); }

.nf .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}

/* Главная: тёмная «табличка» с крупной типографикой и пронумерованным указателем разделов. */

body.home {
  --h-bg: #12100d;
  --h-ink: #f3ece1;
  --h-dim: #a39785;
  --h-faint: #5c5246;
  --h-rule: rgba(243, 236, 225, 0.12);
  --h-accent: #e0a46a;

  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(1100px 620px at 88% -8%, rgba(224, 164, 106, 0.16), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(196, 127, 62, 0.08), transparent 60%),
    var(--h-bg);
  color: var(--h-ink);
  font-size: 17px;
}

.home ::selection { background: var(--h-accent); color: var(--h-bg); }

.home a { text-decoration-color: rgba(224, 164, 106, 0.5); }

.home a:hover { color: var(--h-accent); }

.home a:focus-visible { outline-color: var(--h-accent); }

.home-bar,
.home-main,
.home-foot { width: min(1120px, calc(100% - 3rem)); margin-inline: auto; }

.home-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.4rem 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--h-dim);
}

.home-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--h-accent);
  border-radius: 50%;
  color: var(--h-accent);
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.home-langs {
  display: flex;
  gap: 0.2rem;
  margin: 0 0 0 auto;
  padding: 0.2rem;
  border: 1px solid var(--h-rule);
  border-radius: 999px;
}

.home-langs a,
.home-langs span { padding: 0.2rem 0.65rem; border-radius: 999px; text-decoration: none; }

.home-langs [aria-current="page"] { background: var(--h-ink); color: var(--h-bg); font-weight: 500; }

.home-main { flex: 1; padding: clamp(2.5rem, 9vh, 6.5rem) 0 3rem; }

.kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  color: var(--h-accent);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.kicker::before { content: ""; width: 2.5rem; height: 1px; background: currentColor; }

.home h1 {
  margin: 1.4rem 0 0;
  font-size: clamp(3rem, 11.5vw, 9.5rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.88;
}

.home h1 span { display: inline-block; }

.home h1 .accent { color: var(--h-accent); }

.home h1 .accent::after { content: "."; color: var(--h-ink); }

.hero-role {
  margin: 1.6rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-lead {
  max-width: 38rem;
  margin: 0.9rem 0 0;
  color: var(--h-dim);
  font-size: 1.08rem;
  line-height: 1.6;
}

.hero-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.8rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.hero-stack li {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--h-rule);
  border-radius: 999px;
  background: rgba(243, 236, 225, 0.03);
}

.hero-stack li:last-child { border-color: rgba(224, 164, 106, 0.45); color: var(--h-accent); }

.index { margin-top: clamp(3.5rem, 10vh, 6rem); }

.index-title {
  margin: 0 0 0.9rem;
  color: var(--h-faint);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.index-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--h-rule); }

.index-list > li { border-bottom: 1px solid var(--h-rule); }

.index-row {
  position: relative;
  display: grid;
  grid-template-columns: 3.2rem 1fr auto 4rem;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 0.25rem;
  color: inherit;
  text-decoration: none;
  isolation: isolate;
}

a.index-row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(224, 164, 106, 0.14), rgba(224, 164, 106, 0));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

a.index-row:hover::before,
a.index-row:focus-visible::before { transform: scaleX(1); }

.home a.index-row:hover { color: inherit; }

.home a.index-row:focus-visible { outline-offset: -2px; border-radius: 0; }

.index-num { color: var(--h-faint); font-family: var(--mono); font-size: 0.85rem; }

.index-body { display: grid; gap: 0.3rem; min-width: 0; }

.index-name {
  font-family: var(--display);
  font-size: clamp(1.3rem, 3.2vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.index-desc { color: var(--h-dim); font-size: 0.98rem; }

.index-host { color: var(--h-faint); font-family: var(--mono); font-size: 0.78rem; }

.index-arrow { justify-self: end; color: var(--h-accent); font-size: 1.5rem; transition: transform 0.3s ease; }

a.index-row:hover .index-num,
a.index-row:hover .index-host { color: var(--h-accent); }

a.index-row:hover .index-arrow { transform: translateX(0.35rem); }

.index-row.is-soon .index-name,
.index-row.is-soon .index-desc { color: var(--h-faint); }

.index-badge {
  justify-self: end;
  grid-column: 4;
  padding: 0.15rem 0.5rem;
  border: 1px dashed var(--h-faint);
  border-radius: 999px;
  color: var(--h-dim);
  font-family: var(--mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

.home-foot {
  padding: 1.6rem 0 2.2rem;
  border-top: 1px solid var(--h-rule);
  color: var(--h-dim);
  font-family: var(--text);
  font-size: 0.92rem;
}

.home-foot p { margin: 0; }

@media (max-width: 760px) {
  .home-bar,
  .home-main,
  .home-foot { width: calc(100% - 2.2rem); }

  .index-row {
    grid-template-columns: 2.2rem 1fr auto;
    gap: 0.4rem 0.9rem;
    align-items: start;
  }

  .index-num { padding-top: 0.35rem; }

  .index-host { grid-column: 2; grid-row: 2; }

  .index-arrow,
  .index-badge { grid-column: 3; grid-row: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  a.index-row::before,
  .index-arrow,
  .more::after { transition: none; }
}
