/* The project's website (built by ci/site.py): light and dark themes, from the visitor's setting */
/* Geist and Geist Mono (variable weights, SIL Open Font License - fonts/OFL.txt): the site's own copies, so that
   pages don't depend on another site */
@font-face {
    font-family:   "Geist";
    font-style:    normal;
    font-weight:   100 900;
    font-display:  swap;
    src:           url("fonts/geist-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family:   "Geist";
    font-style:    normal;
    font-weight:   100 900;
    font-display:  swap;
    src:           url("fonts/geist-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;
}

@font-face {
    font-family:   "Geist Mono";
    font-style:    normal;
    font-weight:   100 900;
    font-display:  swap;
    src:           url("fonts/geist-mono-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family:   "Geist Mono";
    font-style:    normal;
    font-weight:   100 900;
    font-display:  swap;
    src:           url("fonts/geist-mono-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;
}

:root {
    --bg:          #f6f7fb;
    --surface:     #ffffff;
    --surface-2:   #eef1f8;
    --text:        #1b2236;
    --muted:       #5b6478;
    --line:        #dde2ee;
    --accent:      #3d5be0;
    --accent-2:    #12a594;
    --accent-text: #ffffff;
    --good:        #1f9d55;
    --good-text:   #146c3b;
    --cloud-1:     #3d7bff;
    --cloud-2:     #12c7b0;
    --cloud-3:     #8b5cf6;
    --cloud-4:     #f0569b;
    --shadow:      0 1px 2px rgba(20, 30, 60, 0.06), 0 6px 20px rgba(20, 30, 60, 0.06);
    --radius:      14px;
}

/* Dark: the system's setting, unless the visitor chose light with the toggle, or chosen with it */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:          #0f1424;
        --surface:     #171e33;
        --surface-2:   #1e2741;
        --text:        #e7eaf3;
        --muted:       #9aa3ba;
        --line:        #2a3452;
        --accent:      #6f8bff;
        --accent-2:    #2fd1bd;
        --accent-text: #0f1424;
        --good:        #34c172;
        --good-text:   #7fe0a9;
        --cloud-1:     #2f5fe0;
        --cloud-2:     #0f9e8c;
        --cloud-3:     #6d3fd6;
        --cloud-4:     #c73e7e;
        --shadow:      0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    }
}

:root[data-theme="dark"] {
    --bg:          #0f1424;
    --surface:     #171e33;
    --surface-2:   #1e2741;
    --text:        #e7eaf3;
    --muted:       #9aa3ba;
    --line:        #2a3452;
    --accent:      #6f8bff;
    --accent-2:    #2fd1bd;
    --accent-text: #0f1424;
    --good:        #34c172;
    --good-text:   #7fe0a9;
    --cloud-1:     #2f5fe0;
    --cloud-2:     #0f9e8c;
    --cloud-3:     #6d3fd6;
    --cloud-4:     #c73e7e;
    --shadow:      0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin:     0;
    background: var(--bg);
    color:      var(--text);
    font:       16px/1.55 "Geist", -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Noto Sans, Liberation Sans, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
}

a {
    color: var(--accent);
}

/* The GitHub link: GitHub's mark, in the link's colour (the image is a mask) */
.nav-github {
    display:     inline-flex;
    align-items: center;
}

.icon-github {
    display:          inline-block;
    width:            22px;
    height:           22px;
    background-color: currentColor;
    -webkit-mask:     url("invertocat.svg") center / contain no-repeat;
    mask:             url("invertocat.svg") center / contain no-repeat;
}

/* The light / dark toggle: shows the theme it switches to */
.theme-toggle {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    width:           34px;
    height:          34px;
    padding:         0;
    border:          1px solid var(--line);
    border-radius:   50%;
    background:      transparent;
    color:           var(--muted);
    cursor:          pointer;
}

.theme-toggle:hover {
    color:        var(--text);
    border-color: var(--muted);
}

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

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

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

/* Form controls don't take the page's font by themselves */
button,
input,
select {
    font-family: inherit;
}

img {
    max-width: 100%;
}

code {
    font:          0.9em/1.4 "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background:    var(--surface-2);
    padding:       0.1em 0.35em;
    border-radius: 5px;
    overflow-wrap: anywhere;
}

pre {
    background:    var(--surface-2);
    padding:       1rem;
    border-radius: 10px;
    overflow-x:    auto;
}

pre code {
    background: none;
    padding:    0;
}

h1,
h2,
h3,
h4 {
    line-height:    1.2;
    font-weight:    600;
    letter-spacing: -0.015em;
}

.wrap {
    max-width: 1160px;
    margin:    0 auto;
    padding:   0 16px;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    margin:         0 0 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size:      0.78rem;
    font-weight:    600;
    opacity:        0.85;
}

.eyebrow a {
    color: inherit;
}

.version {
    font-size:      0.55em;
    font-weight:    500;
    opacity:        0.7;
    vertical-align: 0.2em;
    margin-left:    0.3rem;
}

/* Header */
.top {
    position:        sticky;
    top:             0;
    z-index:         10;
    background:      color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(8px);
    border-bottom:   1px solid var(--line);
}

.top-inner {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             1rem;
    min-height:      56px;
}

.brand {
    display:         flex;
    align-items:     center;
    gap:             0.6rem;
    font-weight:     600;
    color:           var(--text);
    text-decoration: none;
    white-space:     nowrap;
}

.top-nav {
    display:     flex;
    align-items: center;
    gap:         1.1rem;
    flex-wrap:   wrap;
}

.top-nav a {
    color:           var(--muted);
    text-decoration: none;
    font-weight:     500;
}

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

/* Hero: soft clouds of colour from its corners and sides, fading into the page towards its foot (layered gradients,
   as on getbootstrap.com - no image) */
.hero {
    background-image: linear-gradient(180deg, color-mix(in srgb, var(--bg) 1%, transparent), var(--bg) 85%),
        radial-gradient(ellipse at top left, color-mix(in srgb, var(--cloud-1) 50%, transparent), transparent 50%),
        radial-gradient(ellipse at top right, color-mix(in srgb, var(--cloud-2) 50%, transparent), transparent 50%),
        radial-gradient(ellipse at center right, color-mix(in srgb, var(--cloud-3) 50%, transparent), transparent 50%),
        radial-gradient(ellipse at center left, color-mix(in srgb, var(--cloud-4) 50%, transparent), transparent 50%);
    background-color: var(--bg);
    color:            var(--text);
    padding:          5rem 0 3.5rem;
}

.hero .eyebrow {
    color: var(--accent);
}

.hero h1 {
    margin:         0 0 1rem;
    font-size:      clamp(1.9rem, 4.2vw, 2.7rem);
    letter-spacing: -0.025em;
}

.lead {
    font-size: 1.15rem;
    margin:    0 0 1.5rem;
    opacity:   0.95;
}

.hero-points {
    display:               grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap:                   1rem;
    margin-top:            2rem;
}

.hero-points div {
    background:      color-mix(in srgb, var(--surface) 70%, transparent);
    border:          1px solid var(--line);
    border-radius:   var(--radius);
    padding:         1rem 1.1rem;
    backdrop-filter: blur(6px);
    box-shadow:      var(--shadow);
}

.hero-points strong {
    display:       block;
    font-size:     1.05rem;
    margin-bottom: 0.2rem;
}

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

/* Model picker */
.picker {
    padding: 3rem 0 1rem;
}

.picker h2,
.catalogue h2 {
    margin:    0 0 0.4rem;
    font-size: 1.45rem;
}

.models {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap:                   0.8rem;
    margin-top:            1.4rem;
}

.model {
    display:        flex;
    flex-direction: column;
    align-items:    flex-start;
    gap:            0.15rem;
    padding:        1rem 1.1rem;
    border:         2px solid var(--line);
    border-radius:  var(--radius);
    background:     var(--surface);
    color:          var(--text);
    font:           inherit;
    text-align:     left;
    cursor:         pointer;
    box-shadow:     var(--shadow);
    transition:     opacity 0.2s, border-color 0.2s, transform 0.1s;
}

.model:hover {
    border-color: var(--accent);
}

.model:active {
    transform: scale(0.98);
}

.model-name {
    font-weight: 700;
    font-size:   1.05rem;
}

.model-meta {
    color:     var(--muted);
    font-size: 0.9rem;
}

.model-count {
    margin-top:  0.4rem;
    font-size:   0.85rem;
    font-weight: 600;
    color:       var(--accent-2);
}

.model-arm .model-count {
    color: var(--muted);
}

.models.chosen .model {
    opacity:    0.4;
    box-shadow: none;
}

.models.chosen .model[aria-pressed="true"] {
    opacity:      1;
    border-color: var(--accent);
    box-shadow:   0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent), var(--shadow);
}

.picker-note {
    margin:        1rem 0 0;
    padding:       0.8rem 1rem;
    border-radius: 10px;
    background:    var(--surface-2);
}

/* The Store's card */
.store {
    padding: 1.5rem 0;
}

.store-card {
    display:               grid;
    grid-template-columns: 1.4fr 1fr;
    gap:                   1.5rem;
    padding:               1.8rem;
    border-radius:         calc(var(--radius) + 4px);
    background:            linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), color-mix(in srgb, var(--accent-2) 12%, var(--surface)));
    border:                1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
    box-shadow:            var(--shadow);
}

.store-intro {
    display:     flex;
    gap:         1.2rem;
    align-items: flex-start;
}

.store-card h2 {
    margin:    0 0 0.5rem;
    font-size: 1.5rem;
}

.steps {
    margin:        0;
    padding:       1.1rem 1.2rem 1.1rem 2.4rem;
    background:    var(--surface);
    border-radius: var(--radius);
    border:        1px solid var(--line);
}

.steps li {
    margin: 0.45rem 0;
}

/* Cards */
.catalogue {
    padding: 2rem 0 3rem;
}

.catalogue-head {
    display:         flex;
    align-items:     flex-end;
    justify-content: space-between;
    gap:             1rem;
    flex-wrap:       wrap;
    margin-bottom:   1rem;
}

.count {
    font-size:      0.6em;
    font-weight:    600;
    color:          var(--muted);
    background:     var(--surface-2);
    padding:        0.1em 0.55em;
    border-radius:  999px;
    vertical-align: 0.3em;
}

.filters {
    display:   flex;
    gap:       0.6rem;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    font:          inherit;
    padding:       0.5rem 0.75rem;
    border:        1px solid var(--line);
    border-radius: 10px;
    background:    var(--surface);
    color:         var(--text);
    min-width:     0;
}

.filters input {
    width:     16rem;
    max-width: 100%;
}

.cards {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap:                   1rem;
}

.card {
    display:        flex;
    flex-direction: column;
    gap:            0.5rem;
    padding:        1.1rem;
    background:     var(--surface);
    border:         1px solid var(--line);
    border-radius:  var(--radius);
    box-shadow:     var(--shadow);
    min-width:      0;
}

.card-link {
    display:               grid;
    grid-template-columns: 56px 1fr;
    grid-template-rows:    auto auto;
    column-gap:            0.85rem;
    align-items:           center;
    color:                 var(--text);
    text-decoration:       none;
}

.card-link .app-icon {
    grid-row: span 2;
}

/* An app that improves the NAS's security: a green tint, as well as its badge */
.card[data-security] {
    background:   color-mix(in srgb, var(--good) 7%, var(--surface));
    border-color: color-mix(in srgb, var(--good) 45%, var(--line));
}

.card-title {
    font-weight:   600;
    font-size:     1.02rem;
    line-height:   1.25;
    overflow-wrap: anywhere;
}

.card-version {
    color:     var(--muted);
    font-size: 0.88rem;
}

.card-summary {
    margin:    0;
    color:     var(--muted);
    font-size: 0.95rem;
    flex:      1;
}

.card-actions {
    display:   flex;
    gap:       0.5rem;
    flex-wrap: wrap;
    margin:    0.3rem 0 0;
}

.card-unavailable {
    display:    none;
    margin:     0;
    font-size:  0.9rem;
    color:      var(--muted);
    font-style: italic;
}

.card.unavailable {
    opacity: 0.45;
}

.card.unavailable .card-unavailable,
.store-card.unavailable .card-unavailable {
    display: block;
}

.card.unavailable [data-site="download"],
.store-card.unavailable [data-site="download"] {
    display: none;
}

.card.hidden {
    display: none;
}

.app-icon {
    width:         56px;
    height:        56px;
    border-radius: 12px;
    object-fit:    contain;
    background:    var(--surface-2);
    padding:       4px;
}

.app-icon.big {
    width:         88px;
    height:        88px;
    flex:          none;
    border-radius: 18px;
}

.badges {
    display:   flex;
    flex-wrap: wrap;
    gap:       0.35rem;
    margin:    0;
}

.badge {
    font-size:      0.75rem;
    padding:        0.12rem 0.55rem;
    border-radius:  999px;
    background:     var(--surface-2);
    color:          var(--muted);
    text-transform: capitalize;
    max-width:      100%;
    overflow-wrap:  anywhere;
}

.badge-publisher,
.badge-recipe {
    text-transform: none;
    background:     color-mix(in srgb, var(--accent-2) 18%, var(--surface));
    color:          var(--text);
}

/* Apps that improve the NAS's security: green */
.badge-security {
    text-transform: none;
    font-weight:    600;
    background:     color-mix(in srgb, var(--good) 22%, var(--surface));
    color:          var(--good-text);
}

.notice-security {
    background:  color-mix(in srgb, var(--good) 14%, var(--surface));
    border-left: 4px solid var(--good);
}

.recipes-title {
    margin-top: 2.8rem !important;
}

/* Buttons */
.button {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    padding:         0.45rem 0.95rem;
    border-radius:   10px;
    border:          1px solid var(--line);
    background:      var(--surface);
    color:           var(--text);
    font-weight:     600;
    font-size:       0.92rem;
    text-decoration: none;
    white-space:     nowrap;
}

.button:hover {
    border-color: var(--accent);
}

.button.primary {
    background:   var(--accent);
    border-color: var(--accent);
    color:        var(--accent-text);
}

.button.primary:hover {
    filter: brightness(1.08);
}

.button.big {
    padding:   0.7rem 1.3rem;
    font-size: 1rem;
}

.button.ghost {
    background:   transparent;
    color:        var(--muted);
    border-style: dashed;
    cursor:       default;
}

/* An app's page */
.app-head {
    padding:       2.5rem 0 1.5rem;
    border-bottom: 1px solid var(--line);
    background:    linear-gradient(180deg, var(--surface), var(--bg));
}

.app-head-inner {
    display:     flex;
    gap:         1.5rem;
    align-items: center;
}

.app-head h1 {
    margin:    0 0 0.4rem;
    font-size: clamp(1.6rem, 3.5vw, 2.1rem);
}

.app-head .app-icon.big {
    width:  96px;
    height: 96px;
}

.app-head .lead {
    color:         var(--muted);
    margin-bottom: 0.7rem;
}

.app-body {
    padding: 2rem 0 3rem;
}

.app-grid {
    display:               grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap:                   2rem;
}

.download-box {
    padding:       1.3rem;
    background:    var(--surface);
    border:        1px solid var(--line);
    border-radius: var(--radius);
    box-shadow:    var(--shadow);
    margin-bottom: 2rem;
}

.download-box h2 {
    margin-top: 0;
}

.table {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width:           100%;
    font-size:       0.95rem;
}

th,
td {
    text-align:     left;
    padding:        0.55rem 0.6rem;
    border-bottom:  1px solid var(--line);
    vertical-align: top;
}

th {
    color:       var(--muted);
    font-weight: 600;
    font-size:   0.85rem;
}

.downloads td {
    vertical-align: middle;
}

.downloads tr.yours {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.downloads tr.yours td:first-child {
    font-weight: 700;
}

.sha {
    color:       var(--muted);
    font-family: "Geist Mono", ui-monospace, monospace;
    font-size:   0.82rem;
}

.notice {
    padding:       0.8rem 1rem;
    border-radius: 10px;
    background:    color-mix(in srgb, var(--accent-2) 14%, var(--surface));
}

.readme {
    overflow-wrap: anywhere;
}

.readme h3 {
    margin-top: 2rem;
}

.readme li {
    margin: 0.35rem 0;
}

.app-side h3 {
    margin:         0 0 0.5rem;
    font-size:      0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color:          var(--muted);
}

.app-side h3 + * {
    margin-bottom: 1.8rem;
}

.links {
    list-style: none;
    padding:    0;
    margin:     0;
}

.links li {
    margin: 0.4rem 0;
}

.facts {
    display:               grid;
    grid-template-columns: auto 1fr;
    gap:                   0.35rem 0.8rem;
    margin:                0;
    font-size:             0.95rem;
}

.facts dt {
    color: var(--muted);
}

.facts dd {
    margin:        0;
    overflow-wrap: anywhere;
}

.share code {
    display: block;
    padding: 0.5rem 0.6rem;
}

/* Footer */
.foot {
    border-top: 1px solid var(--line);
    padding:    1.8rem 0;
    color:      var(--muted);
    font-size:  0.92rem;
}

.foot p {
    margin: 0.3rem 0;
}

@media (max-width: 860px) {
    .store-card {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 560px) {
    .top-inner {
        flex-wrap: wrap;
        row-gap:   0.15rem;
        padding:   0.5rem 16px;
    }

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

    .model {
        padding: 0.8rem;
    }

    .hero {
        padding: 2.5rem 0;
    }

    .top-nav {
        gap:       0.7rem;
        font-size: 0.92rem;
    }

    .brand {
        font-size: 0.95rem;
    }

    .store-intro,
    .app-head-inner {
        flex-direction: column;
    }

    .filters input {
        width: 100%;
    }

    .sha {
        display: none;
    }
}
