/* Top Steli — palette follows cosmobet.ua: graphite backgrounds, cyan brand, graphite→blue gradient, space accents */
:root {
  --bg: #08080a;
  --bg-1: #101113;
  --bg-2: #18191d;
  --bg-3: #202126;
  --line: #2e3037;
  --line-2: #363840;
  --text: #ffffff;
  --muted: #aaa7a8;
  --muted-2: #8b898a;
  --brand: #9afffd;
  --brand-2: #00ffff;
  --brand-3: #00bbc2;
  --blue: #173d85;
  --yellow: #efc223;
  --purple: #9258ff;
  --red: #d30000;
  --radius: 8px;
  --radius-lg: 16px;
  --grad: linear-gradient(104.04deg, #202126 0.03%, #173d85 100.03%);
  --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.7 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; transition: color .2s, background-color .2s, border-color .2s, transform .2s; }
a:hover { color: var(--brand-2); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 800; letter-spacing: -.01em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--brand); color: #000; padding: 8px 14px; border-radius: var(--radius); font-weight: 700; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: rgba(16, 17, 19, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 20px; letter-spacing: .04em; flex-shrink: 0; }
.logo:hover { color: var(--text); }
.logo img { width: 36px; height: 36px; }
.logo b { color: var(--brand); font-weight: 800; margin-left: 4px; }

.nav { margin-left: auto; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav a { display: block; padding: 8px 12px; border-radius: var(--radius); color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--bg-3); }
.nav a[aria-current="page"] { color: var(--brand); background: rgba(154, 255, 253, .08); }

.lang { display: inline-flex; padding: 3px; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 999px; flex-shrink: 0; }
.lang__item { display: inline-block; min-width: 42px; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; text-align: center; color: var(--muted); line-height: 1.4; }
.lang__item:hover { color: var(--text); }
.lang__item.is-active { background: var(--brand); color: #000; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.burger { display: none; width: 42px; height: 42px; border-radius: var(--radius); background: var(--bg-3); border: 1px solid var(--line-2); cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.burger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }

@media (max-width: 1100px) {
  .header__inner { gap: 12px; }
  .burger { display: flex; order: 3; }
  .header .lang { order: 2; margin-left: auto; }
  .nav { order: 4; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-1); border-bottom: 1px solid var(--line); display: none; margin: 0; }
  .nav ul { flex-direction: column; padding: 12px 16px 16px; }
  .nav a { padding: 12px; font-size: 16px; white-space: normal; }
  .nav-toggle:checked ~ .nav { display: block; }
  .nav-toggle:checked + .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked + .burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked + .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Hero ---------- */
.hero { background: var(--grad); border-bottom: 1px solid var(--line); padding: 28px 0 40px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff, transparent),
    radial-gradient(1px 1px at 28% 70%, #9afffd, transparent),
    radial-gradient(1.5px 1.5px at 46% 18%, #fff, transparent),
    radial-gradient(1px 1px at 63% 82%, #efc223, transparent),
    radial-gradient(1.5px 1.5px at 78% 34%, #fff, transparent),
    radial-gradient(1px 1px at 90% 66%, #9afffd, transparent);
}
.hero::after { content: ""; position: absolute; right: -120px; top: -160px; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(154, 255, 253, .18), transparent 65%); pointer-events: none; }
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(28px, 4.4vw, 48px); max-width: 960px; margin: 14px 0 18px; }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--muted-2); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs [aria-current] { color: var(--text); }

.chip { display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(154, 255, 253, .12); border: 1px solid rgba(154, 255, 253, .35); color: var(--brand); font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; line-height: 1.4; }
.chip--sm { font-size: 11px; padding: 3px 10px; }

.meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 14px; }
.meta span { display: inline-flex; align-items: center; gap: 8px; }
.meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-3); }
.meta time { color: var(--text); font-weight: 600; }

/* ---------- Frames (all images): fixed 16:9 box, image centred and never stretched ---------- */
.frame {
  position: relative;
  margin: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 6px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(154, 255, 253, .55), rgba(23, 61, 133, .9) 45%, rgba(146, 88, 255, .55));
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: calc(var(--radius-lg) - 5px);
  background: var(--bg-2);
}

/* ---------- Article layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding-top: 40px; padding-bottom: 56px; align-items: start; }
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.article { min-width: 0; max-width: 820px; }

.prose { margin-top: 32px; }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose p { color: #e6e6e8; }
.prose > p:first-child { font-size: 1.12em; color: var(--text); }
.prose h2 { font-size: clamp(23px, 2.6vw, 30px); margin-top: 1.8em; padding-left: 16px; border-left: 4px solid var(--brand); }
.prose h3 { font-size: 21px; margin-top: 1.5em; color: var(--brand); }
.prose strong { color: var(--text); font-weight: 700; }
.prose ul, .prose ol { margin: 1.1em 0 0; padding: 0; list-style: none; counter-reset: li; }
.prose li { position: relative; padding: 16px 18px 16px 58px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; color: #e6e6e8; }
.prose li + li { margin-top: 12px; }
.prose ol > li::before { counter-increment: li; content: counter(li); position: absolute; left: 16px; top: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #000; font-weight: 800; font-size: 14px; line-height: 28px; text-align: center; }
.prose ul > li::before { content: ""; position: absolute; left: 24px; top: 26px; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); transform: rotate(45deg); }
.prose blockquote { margin: 1.6em 0 0; padding: 22px 24px 22px 28px; background: var(--grad); border: 1px solid var(--line-2); border-left: 4px solid var(--brand); border-radius: 12px; font-size: 1.05em; font-style: italic; }
.prose blockquote p { color: var(--text); }
.prose .frame { margin: 1.8em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--brand); background: var(--bg-2); font-weight: 700; }
.prose .note { padding: 18px 20px; border-radius: 12px; background: rgba(239, 194, 35, .08); border: 1px solid rgba(239, 194, 35, .35); color: #f3e3a8; }

/* ---------- Sidebar ---------- */
.sidebar { position: sticky; top: 92px; display: grid; gap: 20px; }
@media (max-width: 960px) { .sidebar { position: static; } }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.card__title { margin: 0 0 12px; font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.toc ol { margin: 0; padding: 0 0 0 20px; display: grid; gap: 8px; font-size: 15px; line-height: 1.45; }
.toc li::marker { color: var(--brand-3); font-weight: 700; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--text); }
.adult { display: flex; gap: 14px; align-items: flex-start; }
.adult .age { flex-shrink: 0; }
.adult .card__title { color: var(--text); margin-bottom: 4px; }
.adult p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }

/* ---------- Posts (4 vertical blocks) ---------- */
.posts { background: var(--bg-1); border-top: 1px solid var(--line); padding: 56px 0 64px; }
.posts__head { margin-bottom: 28px; }
.posts__head h2 { font-size: clamp(24px, 3vw, 34px); }
.posts__head p { margin: 6px 0 0; color: var(--muted); }
.posts__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1060px) { .posts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .posts__grid { grid-template-columns: minmax(0, 1fr); } }
.post { display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: transform .25s, border-color .25s, box-shadow .25s; }
.post:hover { transform: translateY(-4px); border-color: rgba(154, 255, 253, .45); box-shadow: 0 16px 36px rgba(0, 0, 0, .5); }
.post__img.frame { border-radius: 0; padding: 0 0 3px; box-shadow: none; }
.post__img.frame img { border-radius: 0; transition: transform .4s; }
.post:hover .post__img img { transform: scale(1.04); }
.post__body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px 18px 20px; flex: 1; }
.post h3 { font-size: 18px; line-height: 1.35; }
.post h3 a { color: var(--text); }
.post h3 a:hover { color: var(--brand); }
.post p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 10px 16px; border-radius: var(--radius); background: var(--brand); color: #000; font-weight: 700; font-size: 14px; }
.btn:hover { background: var(--brand-2); color: #000; }

/* ---------- Footer ---------- */
.footer { background: var(--bg); }
.footer__top { background: var(--bg-3); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.footer__top-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; padding-top: 24px; padding-bottom: 24px; }
.footer__tagline { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer__nav a { color: var(--muted); font-size: 15px; font-weight: 600; }
.footer__nav a:hover { color: var(--brand); }
.lang--footer { background: var(--bg-1); }

.footer__bottom { padding: 36px 0 24px; }
.footer__bottom-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; }
@media (max-width: 860px) { .footer__bottom-inner { grid-template-columns: minmax(0, 1fr); } }
.footer__title { margin: 0 0 8px; font-weight: 800; color: var(--text); }
.footer__about p:last-child { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.footer__adult { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: var(--radius-lg); background: rgba(211, 0, 0, .08); border: 1px solid rgba(211, 0, 0, .4); }
.footer__adult .age { flex-shrink: 0; }
.footer__adult p { margin: 0; font-size: 14px; line-height: 1.6; color: #e6e6e8; }
.footer__copy { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.footer__copy p { margin: 0; color: var(--muted-2); font-size: 13px; }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 64px 16px; }
.notfound h1 { font-size: clamp(56px, 12vw, 120px); color: var(--brand); }
.notfound p { color: var(--muted); }
.notfound .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
