/* =========================================================
   BijBox — main stylesheet
   ========================================================= */
:root {
  --ink: #0c1a33;
  --ink-2: #26344f;
  --muted: #5b6b85;
  --line: #e3e8f0;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --brand: #1f5eff;
  --brand-dark: #1446c7;
  --gold: #f5b700;
  --soft: #eef3ff;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(12, 26, 51, .06), 0 2px 8px rgba(12, 26, 51, .05);
  --shadow: 0 10px 30px -12px rgba(12, 26, 51, .22);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Manrope", "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.25; letter-spacing: -.015em; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }
.wide-figure { max-width: 1040px; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 22px; letter-spacing: -.02em; color: var(--ink); }
.brand-name b { color: var(--brand); font-weight: 800; }
.brand-tag { font-size: 12px; color: var(--muted); margin-top: 3px; }
.main-nav { display: flex; gap: 6px; margin-left: auto; }
.main-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 10px; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--soft); color: var(--brand); }

/* ---------- Language switcher ---------- */
.lang-switch ul { list-style: none; margin: 0; padding: 4px; display: flex; gap: 2px; background: var(--soft); border-radius: 999px; }
.lang-switch a {
  display: block; min-width: 42px; text-align: center; padding: 6px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-decoration: none; color: var(--ink-2);
}
.lang-switch a:hover { color: var(--brand); background: #fff; }
.lang-switch a.is-active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px -4px rgba(31, 94, 255, .6); }
.lang-switch--footer ul { background: rgba(255, 255, 255, .08); }
.lang-switch--footer a { color: #cdd6e6; }
.lang-switch--footer a:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* ---------- Article ---------- */
.post { padding: 48px 0 24px; }
.post-head { text-align: left; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.tag {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand); background: var(--soft); padding: 5px 12px; border-radius: 999px;
}
.post-head h1 { font-size: clamp(28px, 4.2vw, 46px); font-weight: 800; margin: 16px 0 18px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.post-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: #b4bfd0; }

/* ---------- Framed images (never stretched, always centred) ---------- */
.frame {
  margin: 36px auto;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
}
.frame-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #e9eef7;
}
.frame-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center center;
}
.frame figcaption { text-align: center; font-size: 14px; color: var(--muted); padding: 12px 12px 4px; line-height: 1.5; }
@supports not (aspect-ratio: 16 / 9) {
  .frame-media { height: 0; padding-top: 56.25%; }
}

/* ---------- Prose ---------- */
.prose { padding-bottom: 24px; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-size: clamp(23px, 2.6vw, 30px); font-weight: 800; margin: 2em 0 .7em; padding-top: .2em; }
.prose h3 { font-size: 20px; margin: 1.6em 0 .5em; }
.prose .lead { font-size: 20px; line-height: 1.65; color: var(--ink); }
.prose .callout {
  position: relative; padding: 22px 26px 22px 30px; border-radius: var(--radius);
  background: linear-gradient(135deg, #0c1a33, #1b3a78); color: #e8eeff; font-weight: 500;
  box-shadow: var(--shadow);
}
.prose .callout::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 4px; background: var(--gold); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: .45em 0; }
.prose li::marker { color: var(--brand); font-weight: 700; }
.prose ul.checklist { list-style: none; padding: 0; display: grid; gap: 12px; }
.prose ul.checklist li {
  margin: 0; padding: 16px 18px 16px 54px; position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.prose ul.checklist li::before {
  content: ""; position: absolute; left: 18px; top: 19px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.prose strong { color: var(--ink); }
.prose blockquote {
  margin: 2em 0; padding: 28px 32px; border-radius: var(--radius); background: var(--soft);
  border-left: 5px solid var(--brand); font-family: var(--font-head); font-size: 20px; font-weight: 600;
  line-height: 1.55; color: var(--ink);
}
.prose blockquote p { margin: 0; }
.prose .small { font-size: 14px; color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.prose th, .prose td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: #f1f5fc; color: var(--ink); font-weight: 700; font-size: 14px; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 600; color: var(--ink); }

/* ---------- FAQ ---------- */
.faq { margin-top: 2.4em; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin: 12px 0; box-shadow: var(--shadow-sm); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 56px 18px 22px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 18px; line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq summary h3 { margin: 0; font-size: 17px; }
.faq details p { margin: 0; padding: 0 22px 20px; color: var(--ink-2); }

.note { margin: 2.2em 0 0; padding: 16px 20px; border-radius: 14px; background: #fff8e1; border: 1px solid #f6e3a1; font-size: 14.5px; color: #5c4a10; }

/* ---------- Article cards ---------- */
.articles { padding: 64px 0 80px; background: linear-gradient(180deg, var(--bg), #eaf0fb); border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; margin: 10px 0 8px; }
.section-head p { color: var(--muted); margin: 0; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.cards { display: grid; gap: 24px; }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px); padding: 10px; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: #e9eef7; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 10px 8px; }
.card-body .tag { align-self: flex-start; font-size: 11px; }
.card-title { font-size: 17px; line-height: 1.35; margin: 12px 0 8px; font-weight: 700; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--brand); }
.card-text { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 0 0 16px; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.card-link { font-weight: 700; text-decoration: none; white-space: nowrap; }
.back-home { margin: 36px 0 0; text-align: center; }
.btn { display: inline-block; padding: 12px 22px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; font-weight: 600; }
.btn:hover { background: var(--brand); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: #0a1630; color: #b8c3d9; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1.2fr 1fr; gap: 48px; padding-top: 56px; padding-bottom: 40px; }
.brand--light .brand-name { color: #fff; }
.brand--light .brand-name b { color: #7aa2ff; }
.footer-title { color: #fff; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; margin: 22px 0 14px; }
.footer-col:not(.footer-about) .footer-title { margin-top: 6px; }
.site-footer p { margin: 0 0 12px; line-height: 1.7; }
.footer-links, .contact-list { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: 0 0 10px; }
.footer-links a { color: #cdd6e6; text-decoration: none; line-height: 1.45; display: inline-block; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.contact-list li { display: flex; flex-direction: column; margin-bottom: 14px; color: #e6ecf7; }
.contact-list span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #7f8ca6; }
.contact-list a { color: #9db8ff; text-decoration: none; font-weight: 600; }
.contact-list a:hover { color: #fff; }
.footer-small { font-size: 13.5px; color: #8e9ab3; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.footer-bottom p { margin: 0; font-size: 14px; color: #8e9ab3; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .main-nav { display: none; }
  .lang-switch--top { margin-left: auto; }
  .cards--3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .header-inner { min-height: 62px; gap: 12px; }
  .brand-tag { display: none; }
  .lang-switch a { min-width: 36px; padding: 5px 8px; font-size: 12px; }
  .post { padding-top: 28px; }
  .prose .lead { font-size: 18px; }
  .prose blockquote { padding: 20px; font-size: 18px; }
  .frame { padding: 6px; margin: 26px auto; border-radius: 18px; }
  .frame-media { border-radius: 13px; }
  .cards--4, .cards--3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
