/* YXO — dark purple theme */
:root {
    --bg: #0d0618;
    --bg-2: #130a22;
    --surface: #1a0f2e;
    --surface-2: #231541;
    --border: #3a2566;
    --border-soft: #2a1a4a;
    --text: #efe8ff;
    --text-soft: #cbbfe6;
    --muted: #9a8cbb;
    --accent: #b892ff;
    --accent-2: #8a5cff;
    --pink: #e9b8ff;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow: 0 20px 44px -22px rgba(0, 0, 0, .85);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-head: "Unbounded", "Inter", system-ui, sans-serif;
}

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

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

body {
    margin: 0;
    background:
        radial-gradient(1200px 620px at 85% -10%, rgba(138, 92, 255, .16), transparent 60%),
        radial-gradient(900px 520px at -10% 30%, rgba(233, 184, 255, .06), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pink); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 100;
    background: var(--pink); color: #12081f; padding: 10px 16px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(13, 6, 24, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 72px; }

.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-mark { flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-name { font-family: var(--font-head); font-size: 22px; font-weight: 700; letter-spacing: 1.5px; }
.logo-sub { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; }

.main-nav { display: flex; gap: 6px; margin-left: auto; }
.main-nav a {
    color: var(--text-soft); text-decoration: none; font-weight: 600; font-size: 15px;
    padding: 8px 14px; border-radius: 999px;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text); background: var(--surface); }

.lang-switch { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; }
.lang-switch a {
    min-width: 44px; text-align: center; padding: 6px 10px; border-radius: 999px;
    color: var(--text-soft); font-weight: 700; font-size: 13px; letter-spacing: .8px; text-decoration: none; line-height: 1.4;
}
.lang-switch a:hover { color: var(--text); background: var(--surface-2); }
.lang-switch a.active { background: linear-gradient(135deg, var(--accent-2), #6a3de8); color: #fff; }
.lang-switch-lg a { min-width: 56px; padding: 9px 14px; font-size: 14px; }

/* Breadcrumbs */
.breadcrumbs { padding: 26px 0 0; font-size: 14px; color: var(--muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--border); }
.breadcrumbs a { color: var(--text-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

/* Article */
.article { max-width: 860px; margin: 0 auto; padding: 22px 0 40px; }
.article-header { margin-bottom: 28px; }
.kicker {
    display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
    color: var(--pink); border: 1px solid rgba(233, 184, 255, .35); padding: 4px 12px; border-radius: 999px;
}
.article h1 {
    font-family: var(--font-head); font-weight: 700; font-size: clamp(26px, 4vw, 42px);
    line-height: 1.22; margin: 18px 0 20px; letter-spacing: -.3px; overflow-wrap: break-word;
}
.meta { list-style: none; margin: 0; padding: 14px 0 0; display: flex; flex-wrap: wrap; gap: 10px 28px; border-top: 1px solid var(--border-soft); font-size: 14.5px; color: var(--text-soft); }
.meta-label { color: var(--muted); margin-right: 4px; }
.meta-label::after { content: ":"; }

/* Image frames: fixed 16:9 box, image centred and scaled proportionally — never stretched */
.frame {
    margin: 34px 0;
    padding: 10px;
    background: linear-gradient(160deg, var(--surface-2), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.frame-hero { margin-top: 0; }
.frame-media {
    position: relative; display: block; overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    background: var(--bg-2);
}
.frame-media img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; object-position: center;
}
.frame figcaption { padding: 10px 6px 2px; font-size: 14px; line-height: 1.5; color: var(--muted); text-align: center; }

/* Body copy */
.article-body > :first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.2em; color: var(--text-soft); }
.article-body p strong, .article-body li strong { color: var(--text); }
.article-body h2 {
    font-family: var(--font-head); font-weight: 600; font-size: clamp(21px, 2.8vw, 28px); line-height: 1.3;
    margin: 1.9em 0 .7em; color: var(--text); position: relative; padding-left: 18px;
}
.article-body h2::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 4px; background: linear-gradient(var(--pink), var(--accent-2)); }
.article-body h3 { font-size: 20px; line-height: 1.35; margin: 1.6em 0 .5em; color: var(--text); }
.article-body ul, .article-body ol { margin: 0 0 1.4em; padding: 0; list-style: none; color: var(--text-soft); }
.article-body li { position: relative; padding: 14px 18px 14px 50px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.article-body ul li::before {
    content: ""; position: absolute; left: 20px; top: 24px; width: 12px; height: 12px; border-radius: 3px;
    background: var(--accent-2); box-shadow: 0 0 0 4px rgba(138, 92, 255, .22); transform: rotate(45deg);
}
.article-body ol { counter-reset: item; }
.article-body ol li { counter-increment: item; }
.article-body ol li::before {
    content: counter(item); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%;
    background: var(--accent-2); color: #fff; font-weight: 700; font-size: 13.5px; line-height: 26px; text-align: center;
}
.article-body blockquote {
    margin: 30px 0; padding: 22px 26px 22px 30px; position: relative;
    background: linear-gradient(135deg, rgba(138, 92, 255, .16), rgba(233, 184, 255, .06));
    border: 1px solid var(--border); border-left: 4px solid var(--pink); border-radius: var(--radius-sm);
}
.article-body blockquote p { margin: 0; font-size: 18.5px; font-style: italic; color: var(--text); }
.table-wrap { overflow-x: auto; margin: 0 0 1.6em; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.article-body table { width: 100%; border-collapse: collapse; margin: 0; font-size: 15.5px; }
.article-body th, .article-body td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.article-body th { background: var(--surface-2); color: var(--text); font-weight: 700; }
.article-body td { color: var(--text-soft); }
.article-body tr:last-child td { border-bottom: 0; }
.note {
    padding: 18px 22px; margin: 0 0 1.4em; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
.note p:last-child { margin-bottom: 0; }

/* Related: four vertical blocks */
.related { padding: 30px 0 70px; border-top: 1px solid var(--border-soft); }
.section-head { text-align: center; margin: 20px auto 34px; max-width: 640px; }
.section-head h2 { font-family: var(--font-head); font-weight: 600; font-size: clamp(22px, 3vw, 30px); margin: 0 0 6px; }
.section-head p { margin: 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent-2); box-shadow: var(--shadow); }
.card-media img { transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 8px 8px; }
.badge {
    align-self: flex-start; font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--accent); background: rgba(184, 146, 255, .12); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.card h3 { font-size: 17px; line-height: 1.4; margin: 0 0 10px; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 16px; flex: 1; }
.card-more { font-weight: 700; font-size: 14.5px; text-decoration: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); }
.footer-top { border-bottom: 1px solid var(--border-soft); background: linear-gradient(180deg, var(--surface), var(--bg-2)); }
.footer-top-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 30px; padding-top: 34px; padding-bottom: 34px; }
.footer-heading { display: block; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; color: var(--pink); margin-bottom: 12px; }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 30px; max-width: 760px; }
.footer-links a { color: var(--text-soft); text-decoration: none; font-size: 15px; line-height: 1.5; }
.footer-links a:hover, .footer-links a[aria-current="page"] { color: var(--accent); }
.footer-bottom-inner { padding-top: 30px; padding-bottom: 34px; text-align: center; max-width: 860px; }
.footer-bottom p { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.footer-bottom .footer-note { font-size: 13.5px; }
.footer-bottom .copyright { color: var(--text-soft); font-size: 14px; margin-top: 16px; }
.logo-sm .logo-name { font-size: 24px; }

/* 404 */
.error-page { text-align: center; padding: 90px 0 110px; }
.error-page h1 { font-family: var(--font-head); font-size: 64px; margin: 0; color: var(--accent); }
.error-page p { color: var(--text-soft); }
.error-page .links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.error-page .links a { padding: 10px 18px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; }

/* Responsive */
@media (max-width: 1080px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .main-nav { display: none; }
    .lang-switch:not(.lang-switch-lg) { margin-left: auto; }
}
@media (max-width: 600px) {
    body { font-size: 16px; }
    .container { padding: 0 16px; }
    .header-inner { min-height: 64px; gap: 12px; }
    .logo-sub { display: none; }
    .logo-name { font-size: 19px; }
    .lang-switch a { min-width: 38px; padding: 5px 8px; }
    .cards { grid-template-columns: minmax(0, 1fr); }
    .frame { padding: 6px; margin: 26px 0; }
    .article-body li { padding: 12px 14px 12px 44px; }
    .article-body ul li::before { left: 17px; top: 22px; }
    .article-body blockquote { padding: 18px 18px 18px 20px; }
    .footer-links ul { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .card, .card-media img { transition: none; }
}
