:root {
  color-scheme: dark;
  --black: #030303;
  --ink: #0b0b0d;
  --white: #f6f5ef;
  --paper: #edeae1;
  --muted: #a6a29a;
  --line: rgba(246, 245, 239, 0.18);
  --cyan: #00e7ff;
  --magenta: #ff2ea6;
  --acid: #d7ff2f;
  --signal: #ff5a1f;
  --blue: #5b6cff;
  --green: #00d084;
  --shadow: rgba(0, 0, 0, 0.62);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --display: "Archivo Black", Impact, sans-serif;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
  color: var(--white);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

html[data-lang-active="ru"] [data-lang="en"],
html:not([data-lang-active="ru"]) [data-lang="ru"] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--sans);
  background:
    linear-gradient(90deg, rgba(255, 46, 166, 0.08), transparent 22%, rgba(0, 231, 255, 0.08) 62%, transparent),
    radial-gradient(circle at 50% 0, rgba(215, 255, 47, 0.08), transparent 32rem),
    var(--black);
  line-height: 1.5;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.24;
  background-image: url("../img/texture-08.png");
  background-size: cover;
  background-position: center;
  mix-blend-mode: screen;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--acid);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 1rem;
  background: rgba(3, 3, 3, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-grid;
  gap: 0.05rem;
  width: fit-content;
  font-family: var(--mono);
  color: var(--white);
}

.brand span {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--acid);
}

.brand small {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.site-nav a,
.language-switch button,
.filter-bar button,
.button {
  border: 1px solid var(--line);
  background: rgba(246, 245, 239, 0.04);
  color: var(--white);
  padding: 0.58rem 0.74rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav .active,
.language-switch button[aria-pressed="true"],
.filter-bar button.is-active,
.button--primary {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--black);
}

.language-switch {
  display: inline-flex;
  justify-content: end;
}

.language-switch button + button {
  border-left: 0;
}

main {
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.55fr);
  min-height: 36rem;
  margin-top: 1rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(110deg, rgba(3, 3, 3, 0.58), rgba(3, 3, 3, 0.96) 58%),
    url("../img/texture-15.png");
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 7px, rgba(0, 231, 255, 0.11) 8px),
    linear-gradient(90deg, rgba(255, 46, 166, 0.32), transparent 30%, rgba(215, 255, 47, 0.16));
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero-text,
.hero-panel,
.entry-hero > *,
.story-card,
.arrival-rival article,
.entry-block,
.foundation-map article,
.cluster-rail,
.sources,
.quick-posts {
  position: relative;
}

.hero-text {
  align-self: end;
  padding: 3.2rem;
}

.kicker {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

.hero-text h1,
.entry-hero h1 {
  max-width: 10ch;
  font-family: var(--display);
  font-size: 5.4rem;
  line-height: 0.88;
  text-transform: uppercase;
  text-shadow: 0.08em 0 var(--magenta), -0.05em 0 var(--cyan);
}

.hero-subtitle,
.entry-lede {
  max-width: 55rem;
  margin: 1.35rem 0 0;
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--paper);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.hero-panel {
  align-self: stretch;
  display: grid;
  align-content: end;
  gap: 0.75rem;
  padding: 1.2rem;
  border-left: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.42);
  font-family: var(--mono);
}

.hero-panel p,
.hero-panel span {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.hero-panel strong {
  display: block;
  max-width: 14ch;
  font-family: var(--display);
  font-size: 2rem;
  line-height: 0.92;
  color: var(--magenta);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.section-head {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  max-width: 18ch;
  font-family: var(--display);
  font-size: 2.4rem;
  line-height: 0.95;
  text-transform: uppercase;
}

.top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 0.35fr);
  gap: 1rem;
  margin-top: 1rem;
}

.top-grid .section-head {
  grid-column: 1 / -1;
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--black);
}

.featured-grid,
.lexicon-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.story-card {
  min-height: 17rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(246, 245, 239, 0.08), rgba(246, 245, 239, 0.02)),
    rgba(0, 0, 0, 0.64);
  box-shadow: 0 22px 60px var(--shadow);
  isolation: isolate;
}

.story-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 0.45rem;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--acid), var(--signal));
}

.story-card a {
  display: grid;
  min-height: inherit;
  padding: 1rem;
}

.story-card__cluster {
  align-self: start;
  width: fit-content;
  padding: 0.24rem 0.34rem;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--cyan);
  text-transform: uppercase;
}

.story-card h3 {
  align-self: end;
  margin-top: 1.8rem;
  font-family: var(--display);
  font-size: 1.85rem;
  line-height: 0.94;
  text-transform: uppercase;
}

.story-card p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.story-card--compact {
  min-height: 12rem;
}

.story-card--compact h3 {
  font-size: 1.35rem;
}

.featured-grid .story-card:first-child {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 26rem;
  background:
    linear-gradient(165deg, rgba(0, 231, 255, 0.2), rgba(255, 46, 166, 0.12) 42%, rgba(0, 0, 0, 0.8)),
    url("../img/texture-02.png");
  background-size: cover;
}

.featured-grid .story-card:first-child h3 {
  font-size: 3.35rem;
}

.quick-posts {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--black);
  padding: 1rem;
}

.quick-posts h2 {
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 0.95;
  text-transform: uppercase;
}

.quick-posts ol {
  display: grid;
  gap: 0;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: quick;
}

.quick-posts li {
  counter-increment: quick;
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.7rem;
  padding: 0.78rem 0;
  border-top: 1px solid rgba(3, 3, 3, 0.18);
}

.quick-posts li::before {
  content: counter(quick, decimal-leading-zero);
  font-family: var(--mono);
  font-weight: 700;
  color: var(--magenta);
}

.quick-posts a {
  font-weight: 900;
}

.quick-posts span {
  grid-column: 2;
  margin-top: -0.4rem;
  color: #58534f;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.arrival-rival {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.arrival-rival article {
  min-height: 22rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.72);
}

.arrival-rival article:first-child {
  border-color: rgba(0, 231, 255, 0.5);
}

.arrival-rival article:last-child {
  border-color: rgba(255, 46, 166, 0.5);
}

.arrival-rival h2 {
  max-width: 12ch;
  font-family: var(--display);
  font-size: 3rem;
  line-height: 0.95;
  text-transform: uppercase;
}

.arrival-rival p:not(.kicker) {
  max-width: 38rem;
  color: var(--paper);
  font-size: 1.1rem;
  font-weight: 700;
}

.arrival-rival a {
  display: inline-flex;
  margin-top: 1rem;
  font-family: var(--mono);
  color: var(--acid);
  text-transform: uppercase;
}

.lexicon-section,
.foundations,
.cluster-stack,
.sources,
.entry-main {
  margin-top: 1rem;
}

.lexicon-section {
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.62);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.story-card.is-hidden {
  display: none;
}

.foundations {
  padding: 1rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(215, 255, 47, 0.1), transparent 36%),
    rgba(246, 245, 239, 0.05);
}

.foundation-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.foundation-map article {
  min-height: 17rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--black);
}

.foundation-map span {
  display: block;
  font-family: var(--mono);
  color: var(--magenta);
  font-weight: 700;
}

.foundation-map h3 {
  margin-top: 0.8rem;
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 0.96;
  text-transform: uppercase;
}

.foundation-map p {
  font-weight: 700;
  color: #363330;
}

.cluster-stack {
  display: grid;
  gap: 1rem;
}

.cluster-rail {
  display: grid;
  grid-template-columns: minmax(15rem, 0.35fr) 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.58);
}

.cluster-rail h3 {
  font-family: var(--display);
  font-size: 1.8rem;
  line-height: 0.95;
  text-transform: uppercase;
}

.cluster-rail p {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.rail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: start;
}

.rail-links a {
  display: inline-flex;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--black);
  font-weight: 900;
}

.sources {
  margin-bottom: 2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--black);
}

.sources ul,
.entry-sources ul {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.2rem;
}

.sources a,
.entry-sources a {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.entry-main {
  max-width: 1260px;
}

.entry-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.33fr);
  gap: 1rem;
  min-height: 30rem;
  padding: 2rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(110deg, rgba(3, 3, 3, 0.56), rgba(3, 3, 3, 0.96)),
    url("../img/texture-01.png");
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.entry-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 231, 255, 0.12), transparent 40%, rgba(255, 46, 166, 0.15));
  pointer-events: none;
}

.entry-hero > div {
  align-self: end;
}

.entry-meta {
  align-self: end;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.72);
}

.entry-meta span,
.entry-meta strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.entry-meta span {
  color: var(--cyan);
}

.entry-meta strong {
  margin-top: 1rem;
  color: var(--acid);
}

.entry-meta p {
  margin: 0.4rem 0 0;
  color: var(--paper);
  font-weight: 700;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.entry-block {
  min-height: 16rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.66);
}

.entry-block:first-child {
  grid-column: span 1;
  background: var(--white);
  color: var(--black);
}

.entry-block h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.entry-block p {
  color: inherit;
  font-size: 1rem;
  font-weight: 750;
}

.related {
  margin-top: 1rem;
}

.related .section-head {
  padding: 1rem;
  border: 1px solid var(--line);
  background: rgba(246, 245, 239, 0.06);
}

.entry-sources {
  margin: 1rem 0 2rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--black);
}

.entry-sources summary {
  padding: 1rem;
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
}

.entry-sources ul {
  padding: 0 1.5rem 1.2rem 2.2rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.site-footer strong {
  display: block;
  color: var(--acid);
}

@media (max-width: 1120px) {
  .featured-grid,
  .lexicon-grid,
  .related-grid,
  .foundation-map,
  .entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entry-block:first-child,
  .featured-grid .story-card:first-child {
    grid-column: span 2;
  }

  .top-grid,
  .hero-shell,
  .entry-hero {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

@media (max-width: 780px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .site-nav {
    justify-content: start;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .language-switch {
    justify-content: start;
  }

  main,
  .site-footer {
    width: min(100% - 1rem, 1440px);
  }

  .hero-text,
  .entry-hero {
    padding: 1rem;
  }

  .hero-shell,
  .hero-text,
  .entry-hero,
  .entry-hero > div,
  .entry-meta {
    min-width: 0;
    max-width: 100%;
  }

  .hero-text h1,
  .entry-hero h1 {
    font-size: 3.3rem;
  }

  .hero-subtitle,
  .entry-lede {
    font-size: 1.02rem;
    max-width: 30ch;
  }

  .hero-panel strong {
    max-width: 100%;
    font-size: 1.68rem;
  }

  .entry-block p,
  .story-card p {
    max-width: 30ch;
  }

  .featured-grid,
  .lexicon-grid,
  .related-grid,
  .foundation-map,
  .arrival-rival,
  .entry-grid,
  .cluster-rail {
    grid-template-columns: 1fr;
  }

  .entry-block:first-child,
  .featured-grid .story-card:first-child {
    grid-column: auto;
  }

  .featured-grid .story-card:first-child h3,
  .arrival-rival h2 {
    font-size: 2.15rem;
  }

  .section-head h2 {
    font-size: 1.95rem;
  }

  .site-footer {
    display: grid;
  }
}
