:root {
    color-scheme: light dark;
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --ink: #102033;
    --muted: #526273;
    --soft: #f7f8fa;
    --soft-2: #ffffff;
    --cool: #eef2f6;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --line: rgba(25, 55, 86, 0.16);
    --accent: #1e5085;
    --accent-bright: #3882d2;
    --accent-2: #c7650f;
    --deep: #102d4d;
    --deep-2: #1e5085;
    --code: #102033;
    --code-line: #28445f;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --surface-lift: 0 18px 56px rgba(37, 44, 52, 0.08);
    --header-height: 72px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

body.dark-mode {
    --ink: #e0f0ff;
    --muted: #a9bfd4;
    --soft: #0d1117;
    --soft-2: #121a24;
    --cool: #172333;
    --panel: rgba(22, 32, 45, 0.82);
    --panel-strong: rgba(19, 29, 42, 0.96);
    --line: rgba(181, 211, 240, 0.19);
    --accent: #68aeea;
    --accent-bright: #92c8f7;
    --accent-2: #f09a4c;
    --deep: #e0f0ff;
    --deep-2: #b8d7f2;
    --code: #0b1118;
    --code-line: #273342;
    --surface-lift: 0 18px 60px rgba(0, 0, 0, 0.28);
    background: var(--soft);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img,
video,
iframe {
    max-width: 100%;
}

img,
video {
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent), transparent 40%);
    outline-offset: 3px;
}

.site-shell {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
    position: relative;
    z-index: 2;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: var(--header-height);
    color: var(--ink);
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}

.dark-mode .site-header {
    background: rgba(13, 17, 23, 0.82);
}

.site-nav {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 24px;
    min-height: var(--header-height);
    align-items: center;
}

.site-brand,
.footer-brand a {
    display: inline-flex;
    align-items: center;
}

.site-brand img,
.footer-brand img {
    display: block;
    width: auto;
    filter: brightness(0) saturate(100%) invert(9%) sepia(13%) saturate(1095%) hue-rotate(179deg) brightness(91%) contrast(92%);
}

.dark-mode .site-brand img,
.dark-mode .footer-brand img {
    filter: none;
}

.site-links {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(14px, 2vw, 28px);
    align-items: center;
    justify-content: flex-end;
}

.site-links a,
.theme-toggle,
.mobile-panel a,
.mobile-panel button {
    color: color-mix(in srgb, var(--ink), transparent 24%);
    font-weight: 700;
}

.site-links a {
    position: relative;
    font-size: 1rem;
    line-height: 1;
    transition: color 160ms ease;
}

.site-links a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -10px;
    left: 0;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0;
    transform: scaleX(0.72);
    transition: opacity 160ms ease, transform 160ms ease;
}

.site-links a:hover,
.site-links a[aria-current="page"],
.theme-toggle:hover {
    color: var(--ink);
    text-decoration: none;
}

.site-links a:hover::after,
.site-links a[aria-current="page"]::after {
    opacity: 0.42;
    transform: scaleX(1);
}

.theme-toggle {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--panel-strong), transparent 34%);
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    background: var(--panel-strong);
}

.theme-toggle svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

#dark-mode-icon {
    display: inline-block;
}

.dark-mode #dark-mode-icon {
    display: none;
}

#light-mode-icon {
    display: none;
}

.dark-mode #light-mode-icon {
    display: inline-block;
}

.mobile-menu {
    display: none;
    position: relative;
}

.mobile-menu summary {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel-strong), transparent 44%);
    cursor: pointer;
    list-style: none;
}

.mobile-menu summary::-webkit-details-marker {
    display: none;
}

.mobile-menu summary span {
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
}

.mobile-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(320px, calc(100vw - 28px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel-strong);
    box-shadow: var(--surface-lift);
    backdrop-filter: blur(18px);
}

.mobile-panel nav {
    display: grid;
    gap: 4px;
}

.mobile-panel a,
.mobile-panel button {
    display: flex;
    min-height: 44px;
    align-items: center;
    border: 0;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    background: transparent;
    text-align: left;
}

.mobile-panel a:hover,
.mobile-panel button:hover {
    color: var(--ink);
    background: color-mix(in srgb, var(--accent), transparent 92%);
    text-decoration: none;
}

.site-footer {
    position: relative;
    color: #edf6f5;
    background:
        linear-gradient(135deg, #102d4d 0%, #1e5085 100%);
    overflow: hidden;
}

.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/noise.png");
    opacity: 0.05;
    pointer-events: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(130px, max-content));
    gap: clamp(28px, 5vw, 72px);
    padding: 64px 0 32px;
}

.footer-brand p {
    max-width: 320px;
    color: rgba(235, 246, 255, 0.76);
}

.site-footer nav {
    display: grid;
    align-content: start;
    gap: 8px;
}

.site-footer h2 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 0.9rem;
    letter-spacing: 0;
}

.site-footer a {
    color: rgba(235, 246, 255, 0.76);
}

.site-footer a:hover {
    color: #fff;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid rgba(235, 246, 255, 0.18);
    padding: 22px 0 34px;
    color: rgba(235, 246, 255, 0.62);
    font-size: 0.9rem;
}

.action-link,
.article-body a.action-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--accent), transparent 28%);
    border-radius: 999px;
    padding: 9px 16px;
    color: #fff;
    background: var(--accent);
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

.action-link:hover,
.article-body a.action-link:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.secondary-action,
.article-body a.secondary-action {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent), transparent 91%);
}

.responsive-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 1.25rem 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--code);
}

.responsive-media > iframe,
.responsive-media > video,
.responsive-media > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}

.media-block {
    margin: 1.5rem 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel-strong);
    box-shadow: var(--surface-lift);
}

.media-block > img,
.media-block > video,
.media-image {
    display: block;
    width: 100%;
}

.soft-corners {
    border-radius: var(--radius-md);
}

.fit-media {
    width: 100%;
    max-width: 100%;
    object-fit: cover;
}

.media-copy {
    padding: 16px 18px 18px;
}

.caption {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.centered {
    text-align: center;
}

.center-pack {
    display: flex;
    justify-content: center;
    align-items: center;
}

.media-space {
    margin: 1.25rem 0;
    padding: 0.75rem;
}

.media-plain {
    margin: 1.5rem 0;
}

.full-span {
    width: 100%;
}

.clear-flow {
    clear: both;
    padding-top: 0.25rem;
}

pre,
code {
    font-family: var(--font-mono);
}

code:not(pre code) {
    border-radius: 0.35em;
    padding: 0.1em 0.28em;
    color: #17518a;
    background: color-mix(in srgb, var(--accent), transparent 91%);
}

.dark-mode code:not(pre code) {
    color: #92c8f7;
}

pre {
    max-width: 100%;
    overflow-x: auto;
}

.content-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.content-table th,
.content-table td {
    border: 1px solid var(--line);
    padding: 0.32rem 0.58rem;
    vertical-align: top;
}

.content-table th {
    background: color-mix(in srgb, var(--accent), transparent 91%);
    color: var(--ink);
    text-align: left;
}

.publish-date {
    color: var(--muted);
    font-size: 0.92rem;
}

.dark-mode-fill-white {
    fill: white;
}

.dark-mode .img-dark-mode-invert {
    filter: invert(100%);
}

.jangafx-color {
    color: #1b46a4;
}

@media (max-width: 980px) {
    .site-nav {
        grid-template-columns: auto 1fr auto auto;
        gap: 12px;
    }

    .site-links,
    .site-nav > .theme-toggle {
        display: none;
    }

    .mobile-menu {
        display: block;
        justify-self: end;
    }
}

@media (max-width: 720px) {
    .site-shell {
        width: min(100% - 28px, 1180px);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        padding-top: 46px;
    }

    .footer-bottom {
        display: grid;
    }
}
