/* Silko — main stylesheet */

:root {
  --navy-900: #0b1b3a;
  --navy-800: #12285a;
  --blue-600: #2f6bff;
  --blue-500: #4a83ff;
  --sky-400: #5cc8ff;
  --yellow-400: #ffd23f;
  --ink: #18223a;
  --ink-soft: #4a556f;
  --muted: #6b7690;
  --line: #e2e7f1;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(11, 27, 58, 0.08);
  --shadow-lg: 0 18px 40px rgba(11, 27, 58, 0.14);
  --font-head: "Manrope", "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
  --container: 1200px;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-600); }
a:hover { color: var(--navy-800); }
:focus-visible { outline: 3px solid var(--sky-400); outline-offset: 2px; }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--navy-900); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy-900); flex-shrink: 0; }
.logo__mark { width: 36px; height: 36px; border-radius: 10px; }
.logo__text { font-family: var(--font-head); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.logo__dot { color: var(--blue-600); }
.logo--light { color: #fff; }
.logo--light .logo__dot { color: var(--yellow-400); }
.logo:hover { color: inherit; }

.site-nav { margin-left: auto; }
.site-nav__list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav__link {
  display: block; padding: 8px 12px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  color: var(--ink-soft); text-decoration: none; white-space: nowrap;
  transition: background .2s, color .2s;
}
.site-nav__link:hover { background: var(--bg); color: var(--navy-900); }
.site-nav__link[aria-current="page"] { background: var(--navy-900); color: #fff; }

.lang-switch { display: inline-flex; padding: 4px; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; flex-shrink: 0; }
.lang-switch__btn {
  min-width: 42px; padding: 6px 10px; border-radius: 999px; text-align: center;
  font-family: var(--font-head); font-weight: 700; font-size: 13px; line-height: 1.2; letter-spacing: .04em;
  color: var(--ink-soft); text-decoration: none; transition: background .2s, color .2s;
}
.lang-switch__btn:hover { color: var(--navy-900); background: #fff; }
.lang-switch__btn.is-active { background: var(--blue-600); color: #fff; }

.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; padding: 11px 10px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer;
  flex-direction: column; justify-content: space-between;
}
.nav-toggle__bar { display: block; height: 2px; width: 100%; background: var(--navy-900); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

@media (max-width: 1080px) {
  .site-header__inner { gap: 12px; }
  .nav-toggle { display: flex; order: 3; margin-left: 0; }
  .lang-switch { margin-left: auto; }
  .site-nav {
    order: 4; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav__list { flex-direction: column; padding: 12px 16px 16px; gap: 2px; }
  .site-nav__link { border-radius: var(--radius-sm); padding: 12px 14px; white-space: normal; }
}
@media (max-width: 380px) {
  .logo__text { font-size: 20px; }
  .lang-switch__btn { min-width: 36px; padding: 6px 7px; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { margin: 24px 0 8px; font-size: 14px; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--muted); }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue-600); text-decoration: underline; }

/* ---------- Article ---------- */
.site-main { padding-bottom: 24px; }
.article { padding: 8px 0 40px; }
.article__header { max-width: 900px; margin: 0 auto 28px; text-align: center; }
.article__tag, .card__tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: rgba(47, 107, 255, .1); color: var(--blue-600);
  font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: .03em; text-transform: uppercase;
}
.article__title {
  margin: 16px 0 16px; font-family: var(--font-head); font-weight: 800;
  font-size: clamp(28px, 4.4vw, 46px); line-height: 1.18; letter-spacing: -0.02em; color: var(--navy-900);
  overflow-wrap: break-word;
}
.article__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; font-size: 15px; color: var(--muted); }

.article__layout { display: grid; gap: 32px; margin-top: 40px; }
@media (min-width: 1024px) {
  .article__layout { grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }
}

.toc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
@media (min-width: 1024px) { .toc { position: sticky; top: calc(var(--header-h) + 24px); } }
.toc__title { margin: 0 0 10px; font-family: var(--font-head); font-weight: 800; font-size: 16px; color: var(--navy-900); }
.toc__list { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.45; }
.toc__list li + li { margin-top: 8px; }
.toc__list a { color: var(--ink-soft); text-decoration: none; }
.toc__list a:hover { color: var(--blue-600); text-decoration: underline; }

/* ---------- Image frames: fixed 16:9, centered, never stretched ---------- */
.frame {
  margin: 36px 0; padding: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.frame--hero { max-width: 1040px; margin: 0 auto; padding: 12px; }
.frame__media {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--navy-900);
  display: flex; align-items: center; justify-content: center;
}
.frame__media img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.frame__caption { padding: 10px 6px 2px; font-size: 14px; line-height: 1.5; color: var(--muted); text-align: center; }

/* ---------- Prose ---------- */
.prose {
  min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 20px; box-shadow: var(--shadow);
}
@media (min-width: 768px) { .prose { padding: 44px 52px; } }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose h2 {
  margin: 1.8em 0 .7em; font-family: var(--font-head); font-weight: 800;
  font-size: clamp(23px, 2.6vw, 30px); line-height: 1.25; letter-spacing: -0.01em; color: var(--navy-900);
}
.prose h3 { margin: 1.5em 0 .5em; font-family: var(--font-head); font-weight: 700; font-size: 21px; line-height: 1.3; color: var(--navy-900); }
.prose .lead { font-size: 19px; color: var(--ink-soft); }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 32px; margin-bottom: .6em; }
.prose ul > li::before {
  content: ""; position: absolute; left: 6px; top: .62em; width: 10px; height: 10px; border-radius: 3px;
  background: linear-gradient(135deg, var(--blue-600), var(--sky-400));
}
.prose ol { counter-reset: item; }
.prose ol > li { counter-increment: item; }
.prose ol > li::before {
  content: counter(item); position: absolute; left: 0; top: .15em; width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy-900); color: #fff; font: 700 13px/24px var(--font-head); text-align: center;
}
.prose blockquote {
  margin: 1.6em 0; padding: 22px 26px; border-left: 4px solid var(--yellow-400);
  background: linear-gradient(135deg, #fffaf0, #f3f7ff); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-head); font-weight: 600; font-size: 19px; line-height: 1.55; color: var(--navy-900);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose strong { color: var(--navy-900); }
.prose .note {
  padding: 18px 22px; border-radius: var(--radius-sm); background: #eef4ff; border: 1px solid #d6e3ff; margin: 0 0 1.3em;
}
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; min-width: 520px; }
.prose th, .prose td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { background: var(--navy-900); color: #fff; font-family: var(--font-head); font-weight: 700; }
.prose tbody tr:nth-child(even) { background: var(--bg); }
.prose tbody tr:last-child td { border-bottom: 0; }

/* ---------- Related: 4 vertical article blocks ---------- */
.related { padding: 56px 0 64px; background: linear-gradient(180deg, var(--bg), #e9eef8); border-top: 1px solid var(--line); }
.related__title {
  margin: 0 0 28px; font-family: var(--font-head); font-weight: 800; font-size: clamp(24px, 3vw, 32px); color: var(--navy-900);
}
.cards { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__link { display: flex; flex-direction: column; width: 100%; color: inherit; text-decoration: none; }
.card__media {
  margin: 10px 10px 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--navy-900); display: flex; align-items: center; justify-content: center;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .4s; }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px 20px 22px; flex: 1; }
.card__tag { font-size: 11px; padding: 3px 10px; }
.card__title { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: 18px; line-height: 1.35; color: var(--navy-900); }
.card__excerpt { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.card__more { margin-top: auto; padding-top: 6px; font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--blue-600); }
.card:hover .card__title { color: var(--blue-600); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #c6d0e6; font-size: 15px; }
.site-footer__top { border-bottom: 1px solid rgba(255, 255, 255, .1); }
.site-footer__top-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.lang-switch--footer { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); }
.lang-switch--footer .lang-switch__btn { color: #c6d0e6; }
.lang-switch--footer .lang-switch__btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.lang-switch--footer .lang-switch__btn.is-active { background: var(--yellow-400); color: var(--navy-900); }

.site-footer__grid { display: grid; gap: 32px; padding-top: 36px; padding-bottom: 36px; }
@media (min-width: 900px) { .site-footer__grid { grid-template-columns: 1.3fr 1fr; gap: 64px; } }
.site-footer__heading { margin: 0 0 12px; font-family: var(--font-head); font-weight: 800; font-size: 17px; color: #fff; }
.site-footer__about p:not(.site-footer__heading) { margin: 0 0 10px; line-height: 1.65; }
.site-footer__nav ul { list-style: none; margin: 0; padding: 0; }
.site-footer__nav li + li { margin-top: 10px; }
.site-footer__nav a { color: #c6d0e6; text-decoration: none; line-height: 1.45; }
.site-footer__nav a:hover { color: var(--yellow-400); text-decoration: underline; }

.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; color: #8f9bb8; }
.site-footer__bottom-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; padding-bottom: 18px; }
.site-footer__bottom p { margin: 0; }

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