:root {
    color-scheme: dark;
    --bg-primary: #0d1329;
    --bg-deep: #0a0f1f;
    --bg-surface: #1e2643;
    --bg-card: #252b4a;
    --accent: #ec494f;
    --accent-pink: #ff3b6f;
    --accent-blue: #4a6cf7;
    --accent-mint: #2ee6a6;
    --accent-orange: #ffb14a;
    --text-primary: #ffffff;
    --text-secondary: #b8c2dd;
    --text-muted: #8d98b8;
    --line: rgba(255, 255, 255, 0.13);
    --line-strong: rgba(255, 255, 255, 0.22);
    --shadow-card: 0 20px 48px rgba(0, 0, 0, 0.28);
    --shadow-accent: 0 12px 34px rgba(255, 59, 111, 0.28);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    --font-display: "Unbounded", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        linear-gradient(180deg, rgba(13, 19, 41, 0.96) 0%, rgba(10, 15, 31, 1) 52%, rgba(13, 19, 41, 1) 100%),
        var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.64;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 86%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(74, 108, 247, 0.13) 0%, transparent 34%),
        linear-gradient(245deg, rgba(236, 73, 79, 0.13) 0%, transparent 36%);
}

a {
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

:focus-visible {
    outline: 3px solid rgba(46, 230, 166, 0.88);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    transform: translateY(-150%);
    padding: 10px 14px;
    color: var(--bg-deep);
    background: var(--accent-mint);
    border-radius: 999px;
    font-weight: 900;
    text-decoration: none;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 22px;
    padding: 12px clamp(16px, 4vw, 56px);
    background: rgba(13, 19, 41, 0.84);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: auto;
    height: clamp(42px, 4.8vw, 56px);
}

.top-nav {
    display: flex;
    justify-content: center;
    gap: clamp(16px, 3vw, 36px);
    color: var(--text-secondary);
    font-size: 0.94rem;
    font-weight: 650;
}

.top-nav a,
.footer nav a {
    text-decoration: none;
}

.top-nav a:hover,
.footer nav a:hover {
    color: var(--text-primary);
}

.language-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: stretch;
    min-width: 94px;
    min-height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.065);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.language-switcher::after {
    content: "";
    position: absolute;
    right: 13px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.78);
    pointer-events: none;
    transform: translateY(-35%);
}

.language-switcher:focus-within {
    border-color: rgba(255, 59, 111, 0.62);
    box-shadow: 0 0 0 4px rgba(255, 59, 111, 0.14);
}

.language-current {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 32px 0 14px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    pointer-events: none;
}

.language-current-flag {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1rem;
    line-height: 1;
}

.language-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 999px;
    appearance: none;
    background: transparent;
    color: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0;
    outline: 0;
    opacity: 0;
    text-transform: uppercase;
}

.language-select option {
    color: #17111f;
    background: #ffffff;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif;
}

.header-cta,
.btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.18s var(--ease-out), border-color 0.18s var(--ease-out), background 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
    white-space: nowrap;
}

.header-cta {
    padding: 0 20px;
    color: var(--text-primary);
    background: var(--accent);
    box-shadow: 0 10px 28px rgba(236, 73, 79, 0.28);
}

.btn {
    padding: 0 22px;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-pink));
    box-shadow: var(--shadow-accent);
}

.btn-secondary {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.065);
    border-color: var(--line-strong);
}

.btn:hover,
.header-cta:hover,
.post-card:hover,
.related-link:hover {
    transform: translateY(-2px);
}

.btn:active,
.header-cta:active,
.post-card:active,
.related-link:active {
    transform: translateY(1px) scale(0.99);
}

.blog-hero,
.article-hero {
    padding: 118px clamp(18px, 5vw, 72px) 54px;
    border-bottom: 1px solid var(--line);
}

.blog-hero-inner,
.article-hero-inner,
.blog-shell,
.article-shell,
.footer {
    width: min(1180px, calc(100% - 36px));
    margin-left: auto;
    margin-right: auto;
}

.blog-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.6fr);
    align-items: center;
    gap: clamp(28px, 5vw, 64px);
}

.article-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(300px, 0.62fr);
    align-items: center;
    gap: clamp(28px, 5vw, 58px);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent-mint);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 850px;
    margin-bottom: 20px;
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 4.8vw, 4.4rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
    overflow-wrap: break-word;
}

.mobile-line {
    display: inline;
}

.article-hero h1 {
    font-size: clamp(2rem, 4.35vw, 4.05rem);
}

h2 {
    margin-bottom: 16px;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.6vw, 2.3rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 8px;
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 750;
    letter-spacing: 0;
}

.lead {
    max-width: 710px;
    color: var(--text-secondary);
    font-size: clamp(1.04rem, 1.65vw, 1.22rem);
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 720;
}

.meta-row span {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
}

.hero-art {
    position: relative;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    box-shadow: var(--shadow-card);
}

.hero-art img,
.post-card img,
.article-cover {
    display: block;
    width: 100%;
    height: auto;
    background: var(--bg-card);
}

.blog-shell {
    padding: clamp(44px, 7vw, 82px) 0;
}

.section-head {
    max-width: 780px;
    margin-bottom: 30px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.post-grid-wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.post-card {
    min-height: 100%;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    background: rgba(30, 38, 67, 0.76);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    text-decoration: none;
    transition: transform 0.18s var(--ease-out), border-color 0.18s var(--ease-out), background 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}

.post-card:hover {
    border-color: rgba(255, 59, 111, 0.55);
    background: #252b4a;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.post-card-content {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 20px;
}

.tag {
    width: max-content;
    max-width: 100%;
    padding: 5px 9px;
    color: #b7f3bd;
    background: rgba(27, 94, 32, 0.28);
    border: 1px solid rgba(129, 199, 132, 0.28);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.post-card p,
.article-body p,
.article-body li,
.answer-box,
.related-link p {
    color: var(--text-secondary);
}

.article-shell {
    display: grid;
    grid-template-columns: minmax(0, 760px) minmax(240px, 320px);
    gap: clamp(28px, 5vw, 58px);
    align-items: start;
    padding: clamp(42px, 7vw, 82px) 0;
}

.article-body {
    min-width: 0;
}

.article-body a {
    color: #9ed9ff;
    font-weight: 800;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
}

.article-body a:hover {
    color: #ffffff;
}

.answer-box,
.cta-band,
.toc,
.related-box {
    background: rgba(30, 38, 67, 0.76);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.answer-box {
    margin: 0 0 30px;
    padding: 20px;
    border-left: 4px solid var(--accent-mint);
}

.matrix-card {
    display: grid;
    gap: 18px;
    margin: 0 0 34px;
    padding: 22px;
    background:
        linear-gradient(135deg, rgba(46, 230, 166, 0.11), rgba(74, 108, 247, 0.09)),
        rgba(30, 38, 67, 0.76);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.matrix-card h2 {
    margin-bottom: 0;
}

.matrix-card p {
    margin-bottom: 0;
    color: var(--text-secondary);
}

.matrix-formula,
.keyword-list,
.matrix-axis div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.matrix-formula span,
.matrix-axis span,
.keyword-list code {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 999px;
}

.matrix-formula b {
    color: var(--accent-mint);
    font-size: 1.12rem;
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.matrix-axis {
    display: grid;
    gap: 9px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.matrix-axis strong {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.keyword-list code {
    color: #17111f;
    background: rgba(46, 230, 166, 0.92);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
    font-weight: 800;
}

.answer-box strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1rem;
}

.article-body section {
    margin-bottom: 34px;
}

.article-body ul,
.article-body ol {
    display: grid;
    gap: 10px;
    padding-left: 22px;
}

.recommendation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mini-card {
    display: grid;
    gap: 6px;
    min-height: 112px;
    padding: 16px;
    color: inherit;
    background: rgba(30, 38, 67, 0.76);
    border: 1px solid var(--line);
    border-radius: 16px;
    text-decoration: none;
    transition: transform 0.18s var(--ease-out), border-color 0.18s var(--ease-out), background 0.18s var(--ease-out);
}

.mini-card:hover {
    transform: translateY(-2px);
    background: #252b4a;
    border-color: rgba(46, 230, 166, 0.45);
}

.mini-card strong {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.96rem;
}

.mini-card span {
    color: var(--text-secondary);
    font-size: 0.94rem;
}

.launch-list {
    counter-reset: launch;
    list-style: none;
    padding-left: 0 !important;
}

.launch-list li {
    position: relative;
    padding-left: 42px;
}

.launch-list li::before {
    counter-increment: launch;
    content: counter(launch);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #08101d;
    background: var(--accent-mint);
    border-radius: 999px;
    font-weight: 900;
}

.article-body li::marker {
    color: var(--accent-mint);
    font-weight: 900;
}

.cta-band {
    display: grid;
    gap: 14px;
    margin-top: 40px;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(236, 73, 79, 0.18), rgba(74, 108, 247, 0.12)),
        rgba(30, 38, 67, 0.76);
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.sidebar {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 14px;
}

.toc,
.related-box {
    padding: 18px;
}

.toc strong,
.related-box strong {
    display: block;
    margin-bottom: 12px;
    font-family: var(--font-display);
    font-size: 0.92rem;
}

.toc a {
    display: block;
    padding: 9px 0;
    color: var(--text-secondary);
    text-decoration: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.toc a:hover {
    color: var(--text-primary);
}

.related-link {
    display: block;
    padding: 13px 0;
    text-decoration: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

.related-link span {
    display: block;
    color: var(--text-primary);
    font-weight: 850;
}

.related-link p {
    margin: 3px 0 0;
    font-size: 0.9rem;
}

.breadcrumbs {
    margin-bottom: 18px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 720;
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--text-primary);
}

.footer-wrap {
    background: #080d1d;
    border-top: 1px solid var(--line);
}

.footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 28px 0;
}

.footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    color: var(--text-secondary);
    font-size: 0.94rem;
}

.footer-copy {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.94rem;
    font-weight: 700;
}

@media (max-width: 980px) {
    .site-header {
        grid-template-columns: auto auto auto;
    }

    .top-nav {
        display: none;
    }

    .blog-hero-inner,
    .article-hero-inner,
    .article-shell {
        grid-template-columns: 1fr;
    }

    .post-grid {
        grid-template-columns: 1fr 1fr;
    }

    .post-grid-wide {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .site-header {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
    }

    .brand {
        flex: 0 1 auto;
    }

    .brand-logo {
        height: 42px;
    }

    .header-cta {
        display: none;
    }

    .blog-hero,
    .article-hero {
        padding: 92px 16px 40px;
    }

    .blog-shell,
    .article-shell,
    .footer {
        width: min(322px, calc(100vw - 32px));
    }

    .blog-hero-inner,
    .article-hero-inner {
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    h1 {
        font-size: clamp(1.72rem, 7vw, 2.28rem);
        line-height: 1.14;
    }

    .article-hero h1 {
        font-size: clamp(1.48rem, 6vw, 1.92rem);
    }

    .mobile-line {
        display: block;
    }

    h2 {
        font-size: clamp(1.36rem, 6vw, 1.82rem);
    }

    .lead {
        font-size: 1rem;
        max-width: 288px;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .matrix-grid,
    .recommendation-grid,
    .post-grid-wide {
        grid-template-columns: 1fr;
    }

    .cta-actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}
