:root {
  /* layers */
  --bg: #0B0C0F;
  --surface: #17191D;
  --surface-2: #22252A;
  --text: #ECEEF2;
  --text-dim: #A8ADB7;
  --border: #343942;
  /* accents */
  --accent: #F97316;
  --accent-red: #EF4444;
  --accent-yellow: #FFC247;
  /* derived */
  --accent-soft: rgba(249, 115, 22, 0.12);
  --border-soft: rgba(52, 57, 66, 0.9);
  /* type */
  --font-sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  /* spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --radius: 12px;
  --radius-sm: 6px;
  /* misc */
  --nav-height: 64px;
  --container: 1200px;
  --shadow-glow: 0 0 20px rgba(249, 115, 22, 0.10);
}

/* language font adjustments */
html:lang(ru) body { font-stretch: normal; }
html:lang(en) body { letter-spacing: 0.01em; }

/* ============ base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@property --body-scroll { initial-value: 0; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1.1em; }
:lang(ru) h1, :lang(ru) h2 { letter-spacing: 0; }

/* focus / a11y */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 10px 18px; z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ============ layout ============ */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-5); }
.section { padding-block: clamp(56px, 9vh, 112px); }
.section--tight { padding-block: clamp(40px, 7vh, 72px); }
.section--alt { background: linear-gradient(180deg, transparent 0%, var(--surface) 12%, var(--surface) 100%); }
.grid { display: grid; gap: var(--space-5); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1024px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .grid--4, .grid--3, .grid--2 { grid-template-columns: 1fr; } }

/* ============ type helpers ============ */
.eyebrow {
  display: inline-block; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .14em; color: var(--text-dim); margin-bottom: var(--space-3);
}
.kicker-line {
  display: block; width: 48px; height: 2px; margin-top: var(--space-4);
  background: linear-gradient(90deg, var(--accent), transparent); border: 0;
}
.lead { font-size: 1.15rem; color: var(--text-dim); max-width: 62ch; }
.section-head { margin-bottom: var(--space-7); }
.section-head p { color: var(--text-dim); max-width: 70ch; }
.notice {
  display: flex; gap: var(--space-3); align-items: flex-start;
  border: 1px solid var(--border); border-left: 3px solid var(--accent-yellow);
  background: var(--surface); border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4); color: var(--text-dim); font-size: .9rem;
}
.notice code { font-family: var(--font-mono); font-size: .85rem; color: var(--text); }

/* ============ navbar ============ */
.navbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--nav-height);
  display: flex; align-items: center;
  background: rgba(11, 12, 15, 0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  transition: background .25s ease;
}
.navbar.scrolled { background: rgba(11, 12, 15, 0.92); }
.navbar__inner { display: flex; align-items: center; gap: var(--space-6); width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-5); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__logo { width: 34px; height: 34px; flex: none; }
.brand__name { font-size: 1.02rem; }
.brand__name small { display: block; font-size: .62rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--text-dim); margin-top: 1px; }
.nav { display: flex; align-items: center; gap: var(--space-5); margin-left: auto; }
.nav a:not(.btn) { color: var(--text-dim); font-size: .95rem; transition: color .15s ease; }
.nav a:not(.btn):hover { color: var(--text); text-decoration: none; }
.nav__cta { margin-left: var(--space-3); }

/* burger (mobile) */
.burger { display: none; margin-left: auto; background: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); width: 44px; height: 44px; cursor: pointer; padding: 9px; }
.burger span { display: block; height: 2px; background: var(--text); margin: 4px 0; transition: transform .2s ease, opacity .2s ease; }
@media (max-width: 1024px) {
  .burger { display: block; }
  .nav {
    position: fixed; inset: 0; flex-direction: column; justify-content: center;
    background: rgba(11,12,15,.98); gap: var(--space-7); font-size: 1.2rem;
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .nav.open { opacity: 1; pointer-events: auto; }
  .nav a:not(.btn) { font-size: 1.25rem; }
  /* keep logo visible above overlay */
  .navbar__inner { position: relative; z-index: 101; }
  body.menu-open { overflow: hidden; }
}

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600; border: 1px solid transparent;
  cursor: pointer; text-decoration: none !important; transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn--primary { background: var(--accent); color: #14070a; }
.btn--primary:hover { background: #fb8b3c; }
.btn--ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 8px 14px; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ============ hero ============ */
.hero { position: relative; min-height: 92vh; display: flex; align-items: center; overflow: hidden; padding-top: var(--nav-height); border-bottom: 1px solid var(--border-soft); }
.hero__bg { position: absolute; inset: 0; z-index: 0; opacity: .9; pointer-events: none; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 70%; }
.hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,12,15,.82) 0%, rgba(11,12,15,.52) 45%, rgba(11,12,15,.90) 100%); }
.hero__content { position: relative; z-index: 1; max-width: 720px; padding-block: var(--space-8); }
.hero h1 { text-transform: none; }
.hero__slogan-sep { color: var(--accent); font-weight: 400; }
.hero__actions { display: flex; gap: var(--space-4); margin-top: var(--space-6); flex-wrap: wrap; }

/* thin scaffold lines over hero (engineered feel) */
.hero__grid { position: absolute; inset: 0; z-index: 0; pointer-events: none; background-image: linear-gradient(rgba(52,57,66,.28) 1px, transparent 1px), linear-gradient(90deg, rgba(52,57,66,.28) 1px, transparent 1px); background-size: 90px 90px; mask-image: linear-gradient(180deg, transparent 0%, #000 28%, transparent 92%); -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 28%, transparent 92%); }

/* ============ cards ============ */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: rgba(249,115,22,.55); transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.card--active::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent); border-radius: var(--radius) var(--radius) 0 0;
}
.card__icon { width: 40px; height: 40px; color: var(--accent); }
.card__icon svg { width: 100%; height: 100%; }
.card h3 { margin: 0; font-size: 1.06rem; }
.card p { margin: 0; color: var(--text-dim); font-size: .92rem; flex: 1; }
.card__meta { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); font-size: .8rem; color: var(--text-dim); }
.card__link { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* ============ badges ============ */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--border); color: var(--text-dim); background: transparent;
}
.badge--accent { border-color: rgba(249,115,22,.6); color: var(--accent); background: var(--accent-soft); }
.badge--concept { border-color: rgba(255,194,71,.55); color: var(--accent-yellow); }
.badge--dim { opacity: .72; }
.badge--risk { border-color: rgba(239,68,68,.6); color: var(--accent-red); }

/* ============ timeline (roadmap) ============ */
.timeline { position: relative; display: grid; gap: var(--space-5); padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--accent), var(--border)); border-radius: 2px; }
.node { position: relative; }
.node::before { content: ""; position: absolute; left: -26px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--border); }
.node--done::before { background: var(--accent); border-color: var(--accent); }
.node--active::before { border-color: var(--accent); box-shadow: 0 0 10px rgba(249,115,22,.5); }
.node__head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.node__body { color: var(--text-dim); font-size: .94rem; max-width: 72ch; }
.node__gate { margin-top: 6px; font-size: .82rem; color: var(--text-dim); font-family: var(--font-mono); }
.node__gate b { color: var(--text); font-weight: 600; font-family: var(--font-sans); }

/* ============ dashboard ============ */
.statgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-4); }
@media (max-width: 1024px) { .statgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .statgrid { grid-template-columns: 1fr 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4) var(--space-5); }
.stat__value { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 700; font-family: var(--font-mono); color: var(--text); line-height: 1.1; }
.stat__value--nodata { font-size: 1rem; color: var(--text-dim); }
.stat__label { color: var(--text-dim); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; }
.stat--flush { grid-column: span 2; }
@media (max-width: 560px) { .stat--flush { grid-column: span 2; } }
.statlist { margin: 0; padding: 0; list-style: none; color: var(--text-dim); font-size: .9rem; }
.statlist li { padding: 6px 0; border-bottom: 1px dashed var(--border-soft); display: flex; justify-content: space-between; gap: 12px; }
.statlist li:last-child { border-bottom: 0; }
.statlist time { color: var(--text-dim); font-family: var(--font-mono); font-size: .78rem; white-space: nowrap; }

/* ============ city band / split media ============ */
.city-band { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: var(--space-7); }
.city-band img { width: 100%; height: auto; }
.city-band__caption { position: absolute; inset: auto 0 0 0; padding: var(--space-4) var(--space-5); font-size: .82rem; color: var(--text-dim); background: linear-gradient(180deg, transparent, rgba(11,12,15,.9)); }

.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--space-7); align-items: center; }
.split__media { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.split__media img { width: 100%; height: auto; display: block; }
.split__body .eyebrow { margin-bottom: var(--space-3); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: var(--space-5); } }

.featurelist { display: grid; gap: var(--space-3); margin: var(--space-4) 0; padding: 0; list-style: none; }
.featurelist li { display: flex; gap: 10px; color: var(--text-dim); font-size: .95rem; }
.featurelist svg { width: 18px; height: 18px; flex: none; color: var(--accent); margin-top: 4px; }

/* ============ forms ============ */
.form { display: grid; gap: var(--space-4); max-width: 640px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .88rem; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 12px 14px; font: inherit; font-size: .95rem; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: var(--shadow-glow); }
.field .hint { color: var(--text-dim); font-size: .8rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* honeypot */
.form-status { font-size: .9rem; color: var(--accent-yellow); display: none; }
.form-status.show { display: block; }

/* ============ footer ============ */
.footer { border-top: 1px solid var(--border-soft); background: var(--surface); margin-top: var(--space-8); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-6); padding-block: var(--space-7); }
.footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-dim); margin-bottom: var(--space-3); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { color: var(--text-dim); font-size: .9rem; }
.footer a:hover { color: var(--text); }
.footer__about { color: var(--text-dim); font-size: .88rem; max-width: 40ch; }
.footer__brand { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-3); color: var(--text); font-weight: 700; }
.footer__brand svg { width: 30px; height: 30px; }
.footer__bottom { border-top: 1px solid var(--border-soft); padding-block: var(--space-4); display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; color: var(--text-dim); font-size: .8rem; }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }

/* ============ misc ============ */
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; font-size: .78rem; font-weight: 700; }
.lang-switch a { padding: 4px 10px; color: var(--text-dim); }
.lang-switch a[aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.lang-switch a:hover { text-decoration: none; color: var(--text); }

figure { margin: 0; }
figcaption { color: var(--text-dim); font-size: .82rem; padding-top: var(--space-2); }

.prose { max-width: 72ch; }
.prose h2 { scroll-margin-top: calc(var(--nav-height) + 16px); }

.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-6); }
.toc h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-dim); margin-bottom: var(--space-2); }
.toc ul { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: .92rem; }

.filterbar { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-6); align-items: center; }
.filterbar select, .filterbar input {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 10px 12px; font: inherit; font-size: .9rem;
}

/* print */
@media print {
  .navbar, .footer, .hero__bg, .hero__grid, .burger { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .stat, .toc, .city-band { break-inside: avoid; }
}
