:root {
  --bg: #0b0320;
  --panel: rgba(20, 6, 46, 0.9);
  --border: rgba(255, 43, 214, 0.32);
  --text: #f3e9ff;
  --muted: #b8a2da;
  --pink: #ff2bd6;
  --cyan: #20f0ff;
  --yellow: #ffd319;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font: 16px/1.6 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
}

/* Тот же неоновый город, что и в панели; затемнён — текст читается */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(rgba(8, 2, 24, 0.72), rgba(8, 2, 24, 0.86)), url('/sw-city.webp?v=2') center / cover no-repeat;
}

a { color: var(--cyan); }

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.5rem;
  background: rgba(14, 4, 34, 0.92);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.brand {
  margin: 0;
  font: italic 900 1.35rem/1.2 'Segoe UI', sans-serif;
  white-space: nowrap;
}

.brand-name {
  background: linear-gradient(180deg, #fff 0%, #ffd6f8 32%, #ff5ce1 58%, #b01ec8 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-dot { color: var(--yellow); text-shadow: 0 0 8px var(--yellow); }

.brand-app {
  color: transparent;
  -webkit-text-stroke: 1.1px #aefaff;
  letter-spacing: 0.05em;
  filter: drop-shadow(0 0 4px rgba(32, 240, 255, 0.9));
}

.brand small {
  margin-left: 0.6rem;
  font: 600 0.95rem 'Segoe UI', sans-serif;
  color: var(--muted);
  -webkit-text-stroke: 0;
}

.back {
  padding: 0.45rem 1rem;
  border: 1px solid rgba(32, 240, 255, 0.5);
  border-radius: 8px;
  color: #bdfcff;
  text-decoration: none;
  white-space: nowrap;
}

.back:hover { background: rgba(32, 240, 255, 0.15); }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

h1.hero {
  margin: 1rem 0 0.4rem;
  font: italic 900 2.2rem/1.2 'Segoe UI', sans-serif;
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 43, 214, 0.8);
}

.lead { margin: 0 0 1.25rem; color: var(--muted); font-size: 1.05rem; }

.video {
  margin: 0 0 1.5rem;
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 30px rgba(255, 43, 214, 0.3);
}

.video video { display: block; width: 100%; height: auto; }

.toc {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.5rem;
  margin: 0 0 2rem;
  padding: 1rem;
  list-style: none;
  counter-reset: toc;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.toc li { counter-increment: toc; }

.toc a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.toc a::before { content: counter(toc) '. '; color: var(--cyan); font-weight: 700; }
.toc a:hover { background: rgba(255, 43, 214, 0.14); }

section {
  margin: 0 0 1.5rem;
  padding: 1.25rem 1.5rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
}

section h2 {
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 43, 214, 0.75);
}

section h2 span { color: var(--cyan); margin-right: 0.4rem; }

section h3 { margin: 1.2rem 0 0.4rem; color: #9ffbff; font-size: 1.05rem; }

ol, ul { margin: 0.3rem 0 0.8rem; padding-left: 1.4rem; }
li { margin: 0.25rem 0; }

b, strong { color: #fff; }

code {
  padding: 0.05rem 0.4rem;
  border: 1px solid rgba(32, 240, 255, 0.35);
  border-radius: 6px;
  background: rgba(32, 240, 255, 0.08);
  color: #9ffbff;
  font: 0.9em ui-monospace, 'Cascadia Code', Consolas, monospace;
}

figure { margin: 0.9rem 0; }

figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

figcaption { margin-top: 0.4rem; color: var(--muted); font-size: 0.9rem; }

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.note {
  margin: 0.8rem 0;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--yellow);
  border-radius: 8px;
  background: rgba(255, 211, 25, 0.08);
}

.rules { list-style: none; padding: 0; counter-reset: rule; }

.rules li {
  counter-increment: rule;
  position: relative;
  margin: 0.6rem 0;
  padding-left: 2.6rem;
}

.rules li::before {
  content: counter(rule);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  font-weight: 800;
  line-height: 1.8rem;
  text-align: center;
  color: #0b0320;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
}

details {
  margin: 0.5rem 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(32, 240, 255, 0.25);
  border-radius: 10px;
  background: rgba(8, 2, 26, 0.5);
}

summary { cursor: pointer; font-weight: 600; color: #fff; }
details p { margin: 0.5rem 0 0.2rem; }

footer { margin-top: 2rem; text-align: center; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 640px) {
  .top { padding: 0.6rem 0.9rem; }
  .brand small { display: none; }
  h1.hero { font-size: 1.6rem; }
  section { padding: 1rem; }
}
