/* ============================================================
   Вайбкодинг: программирование по настроению — тёмная тема
   Звёздное небо · оранжевые акценты
   ============================================================ */

:root {
  --bg: #070a11;
  --card: #131a29;
  --card-2: #172033;
  --ink: #f5f2ec;
  --muted: #9aa4b8;
  --faint: #5f6a80;
  --line: #263047;
  --orange: #ff9f2e;
  --orange-deep: #f0701c;
  --ember: #ff5d3a;
  --light: #ffb45c;
  --violet: #a78bfa;
  --green: #3ddc8f;
  --pink: #ff7a59;
  --term: #0c1120;

  --serif: "Playfair Display", "Georgia", "Times New Roman", serif;
  --sans: "Golos Text", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "Consolas", monospace;

  --rad: 20px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, .65);
  --wrap: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(255, 159, 46, .35); }

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

img { max-width: 100%; display: block; }

.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }

/* ===== Звёздное небо ===== */
.starfield {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 12% -6%, rgba(255, 159, 46, .15), transparent 60%),
    radial-gradient(800px 520px at 96% 6%, rgba(167, 139, 250, .13), transparent 60%),
    radial-gradient(1100px 640px at 50% 118%, rgba(240, 112, 28, .12), transparent 62%),
    url("../img/stars.svg");
  background-size: auto, auto, auto, 260px 260px;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
}
.starfield i {
  position: absolute; width: var(--s, 2px); height: var(--s, 2px); border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 9px 1px rgba(255, 186, 110, .95);
  animation: twinkle 3.6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: .12; transform: scale(.65); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ===== Верхняя панель ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 10, 17, .62);
  border-bottom: 1px solid var(--line-solid);
}
.topbar-in {
  height: 68px; display: flex; align-items: center; gap: 24px;
}
.brand {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 10px; color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .dot {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--orange), var(--ember));
  display: grid; place-items: center;
  font-size: 13px; line-height: 1; color: #1a1306;
  box-shadow: 0 0 14px rgba(255, 159, 46, .6);
}
.brand .tilda { color: var(--orange); }
.topnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.topnav a {
  font-family: var(--mono); font-size: 13.5px; font-weight: 600;
  color: #dbe2f0; padding: 7px 12px; border-radius: 999px; transition: .18s;
}
.topnav a:hover {
  color: var(--light); background: rgba(255, 159, 46, .13); text-decoration: none;
}
.topnav a.active {
  color: var(--light); background: rgba(255, 159, 46, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 159, 46, .4), 0 0 16px rgba(255, 159, 46, .25);
}

/* ===== Герой ===== */
.hero { padding: 72px 0 40px; position: relative; }
.hero-in { display: grid; grid-template-columns: 1.06fr .94fr; gap: 48px; align-items: center; }
.kicker {
  font-family: var(--mono); font-size: 13.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--orange); font-weight: 600;
}
.kicker::before { content: "~/ "; color: var(--faint); }
.hero h1 {
  font-family: var(--serif); font-weight: 800; font-size: clamp(40px, 6vw, 66px);
  line-height: 1.04; letter-spacing: -.01em; margin: 18px 0 22px;
}
.hero h1 .grad {
  background: linear-gradient(92deg, var(--light) 5%, var(--orange) 48%, var(--pink) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.standfirst {
  font-size: 20px; line-height: 1.6; color: var(--muted);
  max-width: 34em; border-left: 3px solid var(--orange);
  padding-left: 20px; font-style: italic;
}
.hero-meta { display: flex; gap: 28px; margin-top: 30px; flex-wrap: wrap; }
.hero-meta .m b { font-family: var(--mono); font-size: 20px; color: var(--light); display: block; }
.hero-meta .m span { font-size: 13.5px; color: var(--muted); }
.hero-media { position: relative; }
.hero-media svg { width: 100%; height: auto; filter: drop-shadow(0 30px 46px rgba(255, 159, 46, .16)); }

/* ===== Баннер фактов ===== */
.facts { padding: 26px 0 8px; }
.facts-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  background: rgba(19, 26, 41, .75);
  border: 1px solid var(--line-solid); border-radius: var(--rad);
  padding: 26px 14px; box-shadow: 0 10px 34px -24px rgba(0, 0, 0, .8);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.fact { text-align: center; padding: 6px 10px; }
.fact b {
  font-family: var(--serif); font-weight: 800; font-size: 40px;
  display: block; line-height: 1.05;
}
.fact:nth-child(1) b { color: var(--orange); }
.fact:nth-child(2) b { color: var(--green); }
.fact:nth-child(3) b { color: var(--pink); }
.fact:nth-child(4) b { color: var(--light); }
.fact span { font-size: 13.5px; color: var(--muted); display: block; margin-top: 4px; }
.fact .num-src { font-family: var(--mono); font-size: 11px; color: var(--faint); display: block; margin-top: 2px; }

/* ===== Главы ===== */
.chapter { padding: 84px 0 8px; }

/* Обтекание картинок текстом: компактная колонка, иллюстрации в потоке */
.art { max-width: 1020px; margin-inline: auto; }
.art-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 22px; }
.art-prose { max-width: 720px; }
.art-fig { float: right; width: 320px; margin: 10px 0 18px 36px; }
.art-fig.float-left { float: left; margin: 10px 36px 18px 0; }
.art-fig img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--rad); background: var(--card); box-shadow: 0 18px 44px -30px rgba(0, 0, 0, .9); }
.clear { clear: both; }
.chap-num {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  color: var(--light); background: rgba(255, 159, 46, .14);
  border: 1px solid rgba(255, 159, 46, .35);
  border-radius: 10px; padding: 4px 11px;
  box-shadow: 0 0 14px rgba(255, 159, 46, .18);
}
.chapter h2 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(28px, 3.4vw, 38px); line-height: 1.1;
}
.chapter h2 .n { color: var(--faint); margin-right: 10px; font-family: var(--mono); font-size: .7em; }
.prose p { margin: 0 0 1.15em; }
.prose p.lead::first-letter {
  font-family: var(--serif); font-weight: 800; font-size: 58px;
  float: left; line-height: .82; margin: 8px 10px 0 0; color: var(--orange);
}
.prose em { color: var(--light); font-style: normal; }

/* ===== Разбивка «За / Против» ===== */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 34px; }
.split .side {
  background: rgba(19, 26, 41, .72);
  border: 1px solid var(--line-solid);
  border-radius: var(--rad); padding: 30px 30px 24px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.side h3 { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 15px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }
.side .tag {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 17px;
}
.side.pro { border-top: 3px solid var(--green); }
.side.pro .tag { background: linear-gradient(135deg, var(--green), #1fae74); }
.side.contra { border-top: 3px solid #ff6b5e; }
.side.contra .tag { background: linear-gradient(135deg, #ff6b5e, #e0483b); }
.side p { font-size: 16px; color: #c8cfdd; }
.side p b { color: var(--ink); }

/* ===== Глава 03: полновесная раскладка ===== */
.chap-wide { max-width: 1060px; margin-inline: auto; }
.chap-wide .chap-full-head { margin-bottom: 30px; }
.chap-wide .prose { max-width: 840px; margin-inline: auto; }
.chap-wide .split { grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 8px; }
.scale-fig { max-width: 190px; margin: 10px auto 38px; }
.scale-fig img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--rad); background: var(--card); box-shadow: 0 18px 44px -30px rgba(0, 0, 0, .9); }
@media (max-width: 920px) {
  .chap-wide .split { grid-template-columns: 1fr; }
}

/* ===== Цитаты ===== */
.pullquote {
  margin: 44px 0 8px; padding: 6px 0 6px 26px;
  border-left: 4px solid var(--orange); font-style: italic;
  font-size: clamp(20px, 2.4vw, 24px); line-height: 1.5; color: #e9cdb8;
}
.pullquote small { display: block; margin-top: 10px; font-style: normal; font-family: var(--mono); font-size: 12.5px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.pullquote small::before { content: "— "; color: var(--orange); }

/* Заголовок по центру (глава «За/против») */
.chap-full-head { display: flex; align-items: baseline; justify-content: center; gap: 18px; margin-bottom: 34px; text-align: center; }

/* ===== Финальная цитата ===== */
.outro {
  padding: 96px 0 60px; margin-bottom: 70px;
  background: linear-gradient(160deg, #111827, #0b101c);
  border: 1px solid var(--line-solid); border-radius: var(--rad);
  color: #e3e6ef; position: relative; overflow: hidden;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9);
}
.outro::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 12% 0%, rgba(255, 159, 46, .16), transparent 60%),
              radial-gradient(500px 280px at 92% 100%, rgba(255, 90, 60, .14), transparent 60%);
  pointer-events: none;
}
.outro-in { position: relative; padding: 30px 44px; }
.outro .kicker { color: var(--orange); }
.outro .kicker::before { content: "$ "; }
.outro blockquote {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(24px, 3.4vw, 34px); line-height: 1.42;
  max-width: 19em; margin: 18px 0 26px;
}
.outro blockquote .accent {
  background: linear-gradient(92deg, var(--light), var(--orange), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.outro .cursor { display: inline-block; width: 10px; height: 24px; background: var(--green); margin-left: 4px; vertical-align: -3px; box-shadow: 0 0 10px rgba(61, 220, 143, .8); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.outro .src { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.outro .src a { color: var(--light); }

/* ===== Подвал ===== */
footer { border-top: 1px solid var(--line-solid); padding: 44px 0 60px; }
.footer-in { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.footer-in .fl b { font-family: var(--serif); font-size: 20px; }
.footer-in .fl p { color: var(--muted); font-size: 14.5px; max-width: 34em; margin-top: 6px; }
.footer-in .fr { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: right; line-height: 2; }
.footer-in .fr a { color: var(--muted); }
.footer-in .fr a:hover { color: var(--light); }
.footer-bottom { margin-top: 30px; padding-top: 18px; border-top: 1px dashed var(--line-solid); color: var(--faint); font-size: 13px; text-align: center; font-family: var(--mono); }

/* ===== Появление при скролле ===== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===== Адаптив ===== */
@media (max-width: 920px) {
  body { font-size: 17px; }
  .hero-in { grid-template-columns: 1fr; gap: 36px; }
  .hero-media { max-width: 520px; margin-inline: auto; }
  .art-prose { max-width: 100%; }
  .art-fig, .art-fig.float-left, .art-fig.float-right { float: none; width: 100%; max-width: 340px; margin: 6px auto 26px; }
  .split { grid-template-columns: 1fr; }
  .facts-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 8px; }
  .topnav { display: none; }
}
@media (max-width: 640px) {
  .hero { padding-top: 44px; }
  .hero h1 { font-size: 38px; }
  .facts-grid { grid-template-columns: 1fr 1fr; }
  .fact b { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}
