/* InWeb — main stylesheet */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #141a2e;
  --ink-soft: #46506a;
  --muted: #6b7591;
  --line: #e3e8f2;
  --brand: #3b6cf6;
  --brand-dark: #2a50c4;
  --accent: #14a88d;
  --navy: #0d1530;
  --navy-2: #16214a;
  --danger: #ff5a5f;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 48, .05), 0 8px 28px rgba(16, 24, 48, .07);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.7 var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid #8fb0ff; outline-offset: 2px; border-radius: 6px; }

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: 10px;
  box-shadow: var(--shadow); font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 21, 48, .94);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__mark { display: inline-flex; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font: 800 21px/1.1 var(--font-head); letter-spacing: -.02em; }
.brand__tagline { font-size: 12.5px; color: #a9b5d6; }
@media (max-width: 480px) { .brand__tagline { display: none; } }

/* ---------- Language switcher ---------- */

.lang ul { display: flex; gap: 4px; margin: 0; padding: 4px; list-style: none; border-radius: 999px; }
.lang a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 36px; padding: 0 12px; border-radius: 999px;
  font: 700 13px/1 var(--font-head); letter-spacing: .06em; text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.lang--header ul { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); }
.lang--header a { color: #c9d3ef; }
.lang--header a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.lang--header a.is-active { color: var(--navy); background: #fff; }
.lang--footer ul { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.lang--footer a { color: #a9b5d6; }
.lang--footer a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.lang--footer a.is-active { color: #fff; background: var(--brand); }

/* ---------- Layout ---------- */

.layout { display: grid; gap: 32px; padding-top: 32px; padding-bottom: 64px; }
@media (min-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; padding-top: 44px; align-items: start; }
  .sidebar { position: sticky; top: 92px; }
}

/* ---------- Article ---------- */

.post {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px 32px;
}
@media (min-width: 768px) { .post { padding: 40px 48px 52px; } }

.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: #b5bdd2; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); }

.post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.post__meta .dot { color: #b5bdd2; }
@media (max-width: 520px) { .post__meta .dot { display: none; } }

.chip {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px;
  background: #eef2fb; color: var(--ink-soft); font: 700 12px/1 var(--font-head); letter-spacing: .02em; white-space: nowrap;
}
.chip--accent { background: rgba(59, 108, 246, .1); color: var(--brand-dark); }

.post__title {
  margin: 0 0 26px;
  font: 800 clamp(26px, 4.2vw, 40px)/1.18 var(--font-head);
  letter-spacing: -.025em;
  color: var(--ink);
  overflow-wrap: break-word;
}

/* ---------- Framed images (no stretching, centred, fixed ratio) ---------- */

.frame {
  margin: 28px 0;
  padding: 8px;
  background: linear-gradient(145deg, #ffffff, #eef2fa);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.frame__media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: calc(var(--radius) - 8px);
  background: var(--navy);
}
.frame__media img {
  position: absolute; inset: 0;
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}
.frame figcaption { padding: 10px 8px 4px; font-size: 14px; color: var(--muted); text-align: center; }
.post > .frame { margin-top: 0; }

/* ---------- Prose ---------- */

.prose { color: #222a40; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose .lead { font-size: 1.1em; color: var(--ink); }
.prose h2 {
  margin: 1.9em 0 .7em;
  font: 800 clamp(22px, 2.8vw, 28px)/1.25 var(--font-head);
  letter-spacing: -.02em;
  color: var(--ink);
}
.prose h3 { margin: 1.5em 0 .5em; font: 700 20px/1.3 var(--font-head); color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.prose li { margin: .45em 0; padding-left: .2em; }
.prose li::marker { color: var(--brand); font-weight: 700; }
.prose strong { color: var(--ink); font-weight: 600; }

.prose .key-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.prose .key-list li {
  margin: 0; padding: 16px 18px 16px 52px; position: relative;
  background: #f6f8fd; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.prose .key-list li::before {
  content: ""; position: absolute; left: 18px; top: 22px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

.prose .callout {
  margin: 1.6em 0; padding: 18px 20px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(59, 108, 246, .08), rgba(20, 168, 141, .08));
  border: 1px solid rgba(59, 108, 246, .18);
}
.prose .callout p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose thead th { background: #f1f4fb; font: 700 14px/1.4 var(--font-head); color: var(--ink); }
.prose tbody tr:last-child td { border-bottom: 0; }

/* ---------- Sidebar ---------- */

.sidebar { min-width: 0; }
.sidebar__title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px; font: 800 20px/1.2 var(--font-head); letter-spacing: -.01em;
}
.sidebar__title::before { content: ""; width: 6px; height: 22px; border-radius: 3px; background: linear-gradient(var(--brand), var(--accent)); }
.sidebar__list { display: grid; gap: 18px; }
@media (min-width: 640px) and (max-width: 1023px) { .sidebar__list { grid-template-columns: 1fr 1fr; } }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 24, 48, .06), 0 14px 36px rgba(16, 24, 48, .11); }
.card__media.frame { margin: 0; padding: 6px 6px 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.card__media .frame__media { border-radius: 13px; }
.card__media img { transition: transform .35s ease; }
.card:hover .card__media img { transform: scale(1.03); }
.card__body { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px 18px; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.card__title { margin: 0; font: 700 16.5px/1.38 var(--font-head); letter-spacing: -.01em; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--brand); }
.card__excerpt { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }
.card__more { margin-top: 2px; font: 700 14px/1.4 var(--font-head); text-decoration: none; }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy); color: #b9c3e0; font-size: 15px; line-height: 1.65; }
.site-footer a { color: #dfe6fb; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__grid { display: grid; gap: 36px; padding-top: 52px; padding-bottom: 44px; }
@media (min-width: 900px) { .site-footer__grid { grid-template-columns: 1.15fr 1fr 1.15fr; gap: 48px; } }
.site-footer p { margin: 12px 0 0; }
.site-footer__heading { margin: 0 0 12px; font: 700 15px/1.3 var(--font-head); color: #fff; letter-spacing: .02em; }
.site-footer__nav ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.site-footer__nav li { font-size: 14px; line-height: 1.45; }
.brand--footer .brand__name { color: #fff; }

.age-notice { display: flex; gap: 16px; align-items: flex-start; }
.age-notice__badge { flex: none; color: #fff; line-height: 0; }
.age-notice p { margin-top: 0; font-size: 14px; }

.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .08); background: #0a1127; }
.site-footer__bottom-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 16px; padding-bottom: 16px; }
.site-footer__bottom p { margin: 0; font-size: 14px; color: #8d99bd; }
.contacts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-style: normal; font-size: 14px; color: #8d99bd; }
.contacts a { display: inline-flex; align-items: center; gap: 6px; color: #dfe6fb; font-weight: 500; overflow-wrap: anywhere; }
.contacts svg { flex: none; color: var(--accent); }
.footer-contacts { margin-top: 24px; }
.footer-contacts__mail {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; background: rgba(255, 255, 255, .05);
  font-weight: 600; overflow-wrap: anywhere;
}
.footer-contacts__mail svg { flex: none; color: var(--accent); }
.site-footer .footer-contacts__mail:hover { background: rgba(255, 255, 255, .1); text-decoration: none; }

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