:root {
    --bg: #fff;
    --ink: #34495e;
    --text: #757575;
    --muted: #999;
    --bar: #f6f6f6;
    --gold: #fab95b;
    --foot: #34495e;
    --foot-text: #c5c9ce;
    --line: rgba(0, 34, 91, 0.06);
    --hover: rgba(0, 34, 91, 0.05);
    --drop: #fff;
    --field-border: #eee;
    --shadow: 0 8px 18px -6px rgba(24, 39, 75, 0.12);
    --sans: "DM Sans", "Segoe UI", sans-serif;
    --page: 81.25rem;
    --mast-h: 46px;
    --bar-h: 56px;
    --logo-h: 76px;
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #1b232c;
    --ink: #e7ebef;
    --text: #b7bec6;
    --muted: #8b949e;
    --bar: #2a343f;
    --foot: #12181e;
    --foot-text: #c5c9ce;
    --line: rgba(255, 255, 255, 0.08);
    --hover: rgba(255, 255, 255, 0.06);
    --drop: #24303a;
    --field-border: #3a4652;
    --shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}

@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/assets/fonts/dm-sans-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/assets/fonts/dm-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html, body { margin: 0; min-height: 100%; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

main { flex: 1; }

a { color: inherit; text-decoration: none; }

button, input { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

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

.frame {
    width: min(var(--page), calc(100% - 48px));
    margin-inline: auto;
}

.mast {
    height: var(--mast-h);
    background: var(--bar);
}

.mast-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 100%;
}

.mast-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.mast-meta time {
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.mast-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.nav-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg);
    box-shadow: var(--shadow);
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    background: var(--bg);
}

.brand-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.search { position: relative; min-width: 0; }

.search svg {
    position: absolute;
    left: 15px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: var(--ink);
    pointer-events: none;
}

.search input {
    width: 280px;
    max-width: 100%;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--bar);
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    padding: 0 16px 0 45px;
}

.search input::placeholder { color: var(--ink); }

.search input:hover,
.search input:focus {
    background: var(--bg);
    border-color: var(--field-border);
    outline: none;
}

.social {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.social a {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg);
    color: var(--ink);
}

.social svg { width: 16px; height: 16px; fill: currentColor; }

.social a:hover { background: var(--ink); color: var(--bg); }

.logo {
    display: block;
    flex: none;
    line-height: 0;
}

.logo img {
    display: block;
    height: var(--logo-h);
    width: auto;
}

.nav-toggle {
    display: none;
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
    cursor: pointer;
}

.theme-toggle {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: var(--bar);
    color: var(--ink);
    cursor: pointer;
}

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

.theme-toggle .icon-sun { display: none; }

html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.theme-toggle:hover { background: var(--ink); color: var(--bg); }

.menu {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 2px;
    flex: 1;
    min-width: 0;
    width: 100%;
    height: var(--bar-h);
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu > li { position: relative; flex: 1 1 0; }

.menu-bar { background: var(--bar); }

.menu-bar > nav { display: flex; }

.menu > li + li::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1px;
    height: var(--bar-h);
    background: var(--line);
}

.menu > li > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: var(--bar-h);
    padding: 0 10px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.1px;
    white-space: nowrap;
}

.menu > li > a svg { width: 9px; height: 9px; }

.menu > li > a:hover,
.menu > li:hover > a { background: var(--hover); }

.menu > li > ul {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 6;
    min-width: 220px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: var(--drop);
    box-shadow: var(--shadow);
    visibility: hidden;
    opacity: 0;
}

.menu > li:hover > ul,
.menu > li:focus-within > ul { visibility: visible; opacity: 1; }

.menu > li > ul a {
    display: block;
    padding: 10px 18px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.menu > li > ul a:hover { background: var(--hover); }

.nav-bar.is-compact {
    --bar-h: 48px;
    --logo-h: 52px;
}

.nav-bar.is-compact .brand-row { padding: 6px 0; }

.foot {
    background: var(--foot);
    color: var(--muted);
    padding: 48px 0 0;
}

.foot-inner {
    width: min(var(--page), calc(100% - 40px));
    margin-inline: auto;
}

.foot-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px 24px;
}

.foot-col section + section { margin-top: 28px; }

.foot h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.foot-col ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.foot-col li + li { margin-top: 8px; }

.foot-col a { color: var(--foot-text); font-size: 14px; font-weight: 500; }

.foot-col a:hover { color: #fff; }

.foot-col .social { margin-top: 16px; gap: 14px; }

.foot-col .social li + li { margin-top: 0; }

.social--plain a {
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
}

.social--plain svg { width: 18px; height: 18px; }

.social--plain a:hover { background: transparent; color: var(--gold); }

.foot-end {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
    padding: 28px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.foot-end p { margin: 0; color: #fff; font-size: 14px; }

.credit { display: block; line-height: 0; }

.credit img { display: block; height: 28px; width: auto; }

.credit:hover { opacity: 0.8; }

.made {
    display: flex;
    align-items: center;
    gap: 10px;
}

.made-by {
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

@media (max-width: 1280px) {
    .menu > li > a { padding: 0 12px; }
    .search input { width: 210px; }
}

@media (max-width: 1080px) {
    .nav-bar { position: static; }
    .frame { width: min(100% - 32px, var(--page)); }
    .mast { height: auto; }
    .mast-row { height: auto; padding: 10px 0; }
    .mast-meta { flex-wrap: wrap; }
    .brand-row { flex-wrap: wrap; padding: 12px 0; }
    .brand-tools { flex: 1 1 220px; }
    .search { flex: 1 1 140px; }
    .search input { width: 100%; }
    .logo img,
    .nav-bar.is-compact .logo img { height: 72px; }
    .nav-toggle { display: inline-flex; align-items: center; }
    .menu-bar { background: transparent; }
    .menu,
    .nav-bar.is-compact .menu {
        display: none;
        height: auto;
        min-height: 0;
        margin: 0 0 8px;
        padding: 0;
        background: var(--bar);
        border-radius: 8px;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }
    .menu.is-open { display: flex; }
    .menu > li + li::before { display: none; }
    .menu > li > a,
    .nav-bar.is-compact .menu > li > a {
        height: auto;
        padding: 12px 14px;
        font-size: 14px;
    }
    .menu > li > ul {
        position: static;
        visibility: visible;
        opacity: 1;
        min-width: 0;
        box-shadow: none;
        background: transparent;
        padding: 0 0 8px 12px;
    }
    .menu > li > ul a { white-space: normal; }
    .foot-grid { grid-template-columns: 1fr 1fr; }
    .foot-end { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
    .frame { width: min(100% - 24px, var(--page)); }
    .foot-inner { width: min(100% - 24px, var(--page)); }
    .foot-grid { grid-template-columns: 1fr; }
    .mast-meta { flex-direction: column; align-items: flex-start; }
    .social a { width: 34px; height: 34px; }
}
