:root {
    color-scheme: dark;
    --page: #0d141e;
    --surface: #131e2b;
    --surface-raised: #192637;
    --text: #f4f6fb;
    --muted: #aab6c8;
    --subtle: #74839a;
    --border: #2a384a;
    --brand: #6681ff;
    --brand-hover: #7c92ff;
}

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

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(850px 400px at 80% -10%, rgba(102, 129, 255, .11), transparent 65%),
        var(--page);
    color: var(--text);
    font: 400 16px/1.6 "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

a:focus-visible,
input:focus-visible {
    outline: 3px solid #aabaff;
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 14px;
    transform: translateY(-150%);
    border-radius: 8px;
    background: var(--text);
    color: var(--page);
}

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

.apps-container {
    width: min(1120px, calc(100% - 48px));
    margin-inline: auto;
}

.apps-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(170, 182, 200, .12);
    background: rgba(13, 20, 30, .92);
    backdrop-filter: blur(18px);
}

.apps-header-inner,
.apps-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.apps-header-inner {
    min-height: 72px;
}

.apps-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.apps-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.apps-brand strong {
    color: var(--muted);
    font-weight: 500;
}

.apps-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
}

.apps-nav a,
.apps-footer a {
    color: var(--muted);
    font-size: 14px;
}

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

main.apps-container {
    flex: 1;
}

.apps-intro {
    padding: clamp(58px, 8vw, 90px) 0 30px;
}

.apps-kicker {
    color: #aabaff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.apps-intro h1 {
    margin: 10px 0;
    font-size: clamp(2.5rem, 6vw, 4rem);
    letter-spacing: -.055em;
    line-height: 1.05;
}

.apps-intro p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
}

.apps-toolbar {
    display: grid;
    grid-template-columns: auto minmax(190px, 380px) 1fr;
    align-items: center;
    gap: 12px;
    margin: 6px 0 24px;
}

.apps-toolbar label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.apps-toolbar input {
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.apps-toolbar input:focus {
    border-color: var(--brand);
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 129, 255, .15);
}

.search-status {
    margin: 0;
    color: var(--subtle);
    font-size: 12px;
    text-align: right;
}

.downloads-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding-bottom: 80px;
}

.download-card {
    display: flex;
    flex-direction: column;
    padding: clamp(22px, 4vw, 32px);
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.app-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 21px;
}

.app-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-raised);
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.availability {
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
}

.availability-live {
    border-color: rgba(82, 211, 165, .24);
    background: rgba(82, 211, 165, .1);
    color: #7ee0bb;
}

.download-card h2 {
    margin: 0 0 8px;
    font-size: 21px;
    letter-spacing: -.025em;
}

.download-card > p {
    min-height: 52px;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
}

.app-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin: 0 0 24px;
    padding: 16px 0;
    border-block: 1px solid var(--border);
}

.app-details div {
    display: grid;
    gap: 2px;
}

.app-details dt {
    color: var(--subtle);
    font-size: 11px;
}

.app-details dd {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    margin-top: auto;
    padding: 11px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
}

.download-picker {
    position: relative;
    margin-top: auto;
}

.download-picker .download-toggle {
    width: 100%;
    margin-top: 0;
    cursor: pointer;
}

.download-menu {
    position: absolute;
    z-index: 5;
    right: 0;
    bottom: calc(100% + 10px);
    left: 0;
    display: grid;
    gap: 5px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .38);
}

.download-menu[hidden] {
    display: none;
}

.download-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.download-option:hover,
.download-option:focus-visible {
    background: var(--surface-raised);
    outline: none;
}

a.download-button:hover {
    background: var(--brand-hover);
}

.documentation-link {
    margin-top: 15px;
    color: #aabaff;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.documentation-link:hover {
    color: var(--text);
}

.empty-state {
    margin: -46px 0 80px;
    color: var(--muted);
}

.apps-footer {
    border-top: 1px solid rgba(170, 182, 200, .12);
}

.apps-footer-inner {
    min-height: 70px;
    color: var(--subtle);
    font-size: 13px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 700px) {
    .apps-container {
        width: calc(100% - 32px);
    }

    .downloads-grid {
        grid-template-columns: 1fr;
        padding-bottom: 56px;
    }

    .apps-toolbar {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .search-status {
        text-align: left;
    }
}

@media (max-width: 460px) {
    .apps-header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding-block: 12px;
    }

    .apps-nav {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .apps-nav a {
        font-size: 13px;
    }

    .apps-footer-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        padding-block: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
