@font-face {
    font-family: "base_font";
    src: url(/shared/css/fonts/Xolonium-Regular.ttf);
}

@font-face {
    font-family: "title_font";
    src: url(/shared/css/fonts/gearsofpeace.ttf);
}

:root {
    color-scheme: light dark;
    --bg: #f4fcfb;
    --client: #e3eceb;
    --titlebar: #698696;
    --clhigh: #dcce40;
    --chover: #f4fcfb;
    --outline: #243c4c;
    --head: #f4fcfb;
    --ctrlbase: #d1dde8;
    --ctrlitem: #9db6c8;
    --invert: 0%;
    --inverth: 50%;
    --cross: #12191f;
    --surface: #ffffff;
    --surface-soft: #e3eceb;
    --surface-strong: #d1dde8;
    --text: #243c4c;
    --muted: #52708a;
    --accent: #dcce40;
    --accent-strong: #ff5722;
    --border: #abc0d1;
    --shadow: 0 18px 45px rgba(18, 25, 31, 0.12);
    --radius: 8px;
}

:root[data-theme="dark"] {
    --bg: #12191f;
    --client: #243c4c;
    --titlebar: #94acc2;
    --clhigh: #fc9373;
    --chover: #94acc2;
    --outline: #52708a;
    --head: #12191f;
    --ctrlbase: #40576b;
    --ctrlitem: #94acc2;
    --invert: 80%;
    --inverth: 50%;
    --cross: #12191f;
    --surface: #1b252e;
    --surface-soft: #243c4c;
    --surface-strong: #40576b;
    --text: #d1dde8;
    --muted: #abc0d1;
    --accent: #fc9373;
    --accent-strong: #dcce40;
    --border: #52708a;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

body.home-page *,
body.home-page *::before,
body.home-page *::after,
body.sub-page *,
body.sub-page *::before,
body.sub-page *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "base_font", system-ui, sans-serif;
}

body.home-page {
    min-width: 320px;
    margin: 0;
    background:
        linear-gradient(135deg, rgba(220, 206, 64, 0.18), transparent 34%),
        linear-gradient(315deg, rgba(255, 87, 34, 0.12), transparent 36%),
        var(--bg);
    color: var(--text);
    font-family: "base_font", system-ui, sans-serif;
}

body.home-page a {
    color: inherit;
}

body.sub-page {
    min-width: 320px;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "base_font", system-ui, sans-serif;
}

body.sub-page a {
    color: inherit;
}

/* Shared app interface styles. App pages link this file directly. */

.header {
    background-color: var(--head);
    display: flex;
    align-items: center;
    height: 40px;
    padding: 5px;
}

.headertitle {
    display: inline-block;
    margin-left: 10px;
    font-family: "title_font", system-ui, sans-serif;
    font-size: 35px;
    color: var(--text);
}

.container {
    display: flex;
    align-items: center;
    height: 300px;
}

.hand {
    cursor: pointer;
}

.mboverlay {
    visibility: hidden;
    background: #000000e5;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.wintitle {
    background: var(--titlebar);
    color: var(--client);
    padding: 10px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    font-family: "base_font", system-ui, sans-serif;
}

.wintoolbar {
    background: var(--client);
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.winbtnarea {
    background: var(--titlebar);
    color: var(--text);
    padding: 10px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.winclient {
    background: var(--client);
    color: var(--text);
    padding: 10px;
    min-height: 100px;
    font-family: "base_font", system-ui, sans-serif;
}

.winbuttonbar {
    background: var(--client);
    padding: 10px;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.textbtn,
.textbtn200,
.textbtn50 {
    display: inline-block;
    background: var(--client);
    color: var(--text);
    padding: 5px 10px;
    margin-right: 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    font-family: "base_font", system-ui, sans-serif;
    border: 1px solid var(--text);
}

.textbtn {
    width: 100px;
}

.textbtn200 {
    width: 200px;
}

.textbtn50 {
    position: relative;
    width: 50px;
}

.textbtn:hover,
.textbtn200:hover,
.textbtn50:hover {
    background: var(--chover);
    border: 1px solid var(--cross);
    color: var(--cross);
}

.ctextbtn {
    background: var(--client);
    color: var(--text);
    border: 1px solid #6f899f;
    padding: 5px;
    text-align: center;
    vertical-align: middle;
    display: inline-block;
    transition-duration: 0.3s;
    cursor: pointer;
    border-radius: 10px;
    font-family: "base_font", system-ui, sans-serif;
    font-size: 16px;
    margin-left: 2px;
    margin-right: 2px;
}

.ctextbtn:hover {
    background: var(--chover);
    border: 1px solid var(--cross);
    color: var(--cross);
}

/* Main page redesign. */

.site-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.hero {
    min-height: 420px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    gap: 32px;
    align-items: center;
    padding: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: var(--shadow);
}

.mainpanel {
    display: flex;
    align-items: center;
    padding: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-family: "title_font", system-ui, sans-serif;
    font-size: clamp(2.4rem, 5.2vw, 4.5rem);
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}

.hero-lede {
    max-width: 720px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.22rem);
    line-height: 1.7;
}

.mainpanel-lede {
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.22rem);
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.primary-action,
.secondary-action {
    min-height: 44px;
    max-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
    text-align: center;
}

.primary-action {
    background: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 70%, var(--text));
    color: #12191f;
}

.primary-action:visited,
.primary-action:hover,
.primary-action:active {
    color: #12191f;
}

.secondary-action {
    background: var(--surface-soft);
}

.primary-action:hover,
.secondary-action:hover,
.app-card:hover {
    transform: translateY(-2px);
}

.traditional-action a {
    all: unset;
}

.traditional-action {
    display: inline-block;
    background: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 70%, var(--text));
    color: #12191f;
    padding: 5px;
    border-radius: var(--radius);
}

.hero-brand {
    min-height: 270px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 18px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-soft);
    text-align: center;
}

.hero-brand img {
    width: min(170px, 64%);
    height: auto;
}

.hero-brand span,
.hero-brand strong {
    display: block;
}

.hero-brand span {
    color: var(--muted);
    font-size: 0.95rem;
}

.hero-brand strong {
    margin-top: 4px;
    font-family: "title_font", system-ui, sans-serif;
    font-size: 1.65rem;
}

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

.intro-grid article {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.stat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 30px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text);
    font-size: 0.8rem;
}

.intro-grid h2,
.section-heading h2,
.category-heading h3,
.app-card h4 {
    margin: 0;
}

.intro-grid h2 {
    font-size: 1.08rem;
}

.intro-grid p,
.category-heading p,
.app-card p {
    color: var(--muted);
    line-height: 1.6;
}

.intro-grid p {
    margin: 10px 0 0;
    font-size: 0.95rem;
}

.app-directory {
    margin-top: 52px;
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h2 {
    font-family: "title_font", system-ui, sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1;
}

.app-category {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    padding: 26px 0;
    border-top: 1px solid var(--border);
}

.category-heading {
    position: sticky;
    top: 18px;
}

.category-heading h3 {
    font-family: "title_font", system-ui, sans-serif;
    font-size: 2rem;
}

.category-heading p {
    margin: 8px 0 0;
    font-size: 0.95rem;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.app-card {
    min-height: 190px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.app-card:hover {
    border-color: var(--accent-strong);
    box-shadow: 0 14px 32px rgba(18, 25, 31, 0.12);
}

.app-card:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible {
    outline: 3px solid var(--accent-strong);
    outline-offset: 3px;
}

.app-card img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    padding: 9px;
    border-radius: var(--radius);
    background: var(--accent);
}

.app-card-copy {
    min-width: 0;
}

.app-card-title {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.app-card h4 {
    font-family: "title_font", system-ui, sans-serif;
    font-size: 1.65rem;
    line-height: 1;
}

.app-card span {
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.76rem;
    white-space: nowrap;
}

.app-card .requirement {
    background: color-mix(in srgb, var(--accent-strong) 18%, var(--surface));
    color: var(--accent-strong);
}

.app-card p {
    margin: 14px 0 0;
    font-size: 0.96rem;
}

@media (max-width: 860px) {
    .site-shell {
        width: min(100% - 24px, 680px);
        padding-top: 12px;
    }

    .hero,
    .intro-grid,
    .app-category {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 28px;
    }

    .hero h1 {
        white-space: normal;
    }

    .hero-brand {
        min-height: 220px;
    }

    .category-heading {
        position: static;
    }
}

@media (max-width: 520px) {
    body.home-page {
        background: var(--bg);
    }

    .site-shell {
        width: calc(100% - 18px);
    }

    .hero {
        padding: 22px;
        min-height: auto;
    }

    .hero-actions a {
        width: 100%;
    }

    .intro-grid article,
    .app-card {
        padding: 18px;
    }

    .app-card {
        grid-template-columns: 1fr;
    }

    .app-card img {
        width: 52px;
        height: 52px;
    }
}
