/* The site pages: /about and /download. The page colours are their own, a darker and
   higher-contrast take on the chat's. /about's story has its own sheet, story.css. */

@font-face {
    font-family: "Inter";
    src: url("/assets/fonts/inter.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Inter Tight";
    src: url("/assets/fonts/inter-tight.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2");
    font-weight: 100 800;
    font-display: swap;
}

:root {
    --page: #e4e4e7;
    --page-alt: #ececee;
    --page-band: #f4f4f5;
    --surface: #fafafa;
    --soft: #e4e4e7;
    --line: #a1a1aa;
    --line-soft: #d4d4d8;
    --ink: #09090b;
    --ink-muted: #3f3f46;
    --accent: #047857;
    --accent-bg: #ecfdf5;
    --button: #09090b;
    --on-button: #ffffff;
    --box: #ffffff;
    --shadow: rgba(9, 9, 11, 0.18);
    --grid: rgba(9, 9, 11, 0.06);
    --grid-strong: rgba(9, 9, 11, 0.12);
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --head: "Inter Tight", "Inter", -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --chat-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) {
        --page: #040405;
        --page-alt: #09090b;
        --page-band: #060608;
        --surface: #0e0e10;
        --soft: #1c1c1f;
        --line: #2e2e33;
        --line-soft: #1c1c1f;
        --ink: #fafafa;
        --ink-muted: #a1a1aa;
        --accent: #f87171;
        --accent-bg: rgba(239, 68, 68, 0.14);
        --button: #fafafa;
        --on-button: #09090b;
        --box: #141417;
        --shadow: rgba(0, 0, 0, 0.5);
        --grid: rgba(250, 250, 250, 0.035);
        --grid-strong: rgba(250, 250, 250, 0.075);
    }
}

:root.theme-dark {
    --page: #040405;
    --page-alt: #09090b;
    --page-band: #060608;
    --surface: #0e0e10;
    --soft: #1c1c1f;
    --line: #2e2e33;
    --line-soft: #1c1c1f;
    --ink: #fafafa;
    --ink-muted: #a1a1aa;
    --accent: #f87171;
    --accent-bg: rgba(239, 68, 68, 0.14);
    --button: #fafafa;
    --on-button: #09090b;
    --box: #141417;
    --shadow: rgba(0, 0, 0, 0.5);
    --grid: rgba(250, 250, 250, 0.035);
    --grid-strong: rgba(250, 250, 250, 0.075);
}

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

[hidden] {
    display: none !important;
}

html {
    scroll-padding-top: 24px;
}

body {
    margin: 0;
    background-color: var(--page-band);
    background-image:
        linear-gradient(var(--grid-strong) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px),
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

a {
    color: inherit;
}

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

p {
    margin: 0;
}

.mono {
    font-family: var(--mono);
}

code {
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--soft);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.86em;
    word-break: break-word;
}

.wrap {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 72px 24px;
}

/* Header */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.site-header .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 16px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-family: var(--head);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.logo .tile {
    fill: var(--button);
}

.logo .mark {
    fill: var(--on-button);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    font-size: 15px;
    font-weight: 500;
}

.site-nav > a:not(.button) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    color: var(--ink-muted);
    text-decoration: none;
}

.site-nav > a:not(.button):hover,
.site-nav > a[aria-current="page"] {
    color: var(--ink);
}

.site-nav > a[aria-current="page"] {
    box-shadow: inset 0 -2px 0 var(--accent);
}

.site-nav .button {
    min-height: 44px;
    margin-left: 6px;
    padding: 0 14px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
}

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

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

/* The icon shows the theme that's on. */
.theme-toggle .icon-dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .theme-toggle .icon-dark {
        display: block;
    }

    :root:not(.theme-light) .theme-toggle .icon-light {
        display: none;
    }
}

:root.theme-dark .theme-toggle .icon-dark {
    display: block;
}

:root.theme-dark .theme-toggle .icon-light {
    display: none;
}

/* Buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: var(--head);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.button.primary {
    background: var(--button);
    color: var(--on-button);
}

.button.primary:hover {
    opacity: 0.88;
}

.button.secondary {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
    font-weight: 500;
}

.button.secondary:hover {
    border-color: var(--ink-muted);
}

.button.small {
    min-height: 44px;
    font-size: 14px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Type */

.kicker {
    font-family: var(--head);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

h1 {
    margin: 0;
    font-family: var(--head);
    font-weight: 700;
    font-size: clamp(38px, 5.4vw, 64px);
    line-height: 1.04;
    letter-spacing: -0.035em;
}

h2 {
    margin: 0;
    font-family: var(--head);
    font-weight: 700;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.lead {
    max-width: 640px;
    font-size: 18px;
    line-height: 1.55;
    color: var(--ink-muted);
}

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

/* [01]-style tags, in the accent colour. */
.tag {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
}

.title {
    margin: 0;
    font-family: var(--head);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

/* A [01] tag with a title, used as a card's heading. */
.titled {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0;
    font-family: var(--head);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

/* /download */

.dl-hero .wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 80px 24px 40px;
}

.dl-hero h1 {
    max-width: 720px;
}

.fine {
    font-size: 14px;
    color: var(--ink-muted);
}

.dl-section .wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 40px 24px;
}

.dl-section.last .wrap {
    gap: 10px;
    padding-bottom: 96px;
}

/* The installers: one panel, one row each, with how to install and check it underneath. */

.releases {
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    list-style: none;
}

.release {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 28px;
}

.release + .release {
    border-top: 1px solid var(--line);
}

.release-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

.release-head p {
    margin-top: 2px;
    font-size: 15px;
}

.release-data span {
    font-family: var(--mono);
    font-size: 13px;
}

/* Version and size show once latest.json lists the installer (js/site.js). */
.release:not(.listed) .release-data {
    display: none;
}

.release-how {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 760px;
}

.release-how > p {
    font-size: 15px;
}

.hash {
    color: var(--ink-muted);
    font-family: var(--mono);
    font-size: 12px;
    word-break: break-all;
}

.hash code {
    padding: 0;
    background: none;
    color: var(--ink);
    font-size: inherit;
}

.command {
    display: flex;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--box);
}

.command code {
    flex: 1;
    min-width: 0;
    padding: 0;
    overflow-x: auto;
    background: none;
    font-size: 13px;
    line-height: 1.75;
    white-space: nowrap;
}

.command code span {
    display: block;
}

/* What the app adds: four columns, no boxes. */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.features li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 16px;
    border-top: 2px solid var(--line);
}

.features .title {
    font-size: 17px;
}

.features p {
    font-size: 15px;
}

/* The last two lines: the source, and other devices. */
.dl-line {
    color: var(--ink-muted);
}

.dl-line a {
    color: var(--ink);
    font-weight: 500;
    text-decoration-color: var(--accent);
    text-underline-offset: 4px;
}

/* Footer */

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
}

/* Centred: the name and tagline, then the links in a row under it. */
.site-footer .wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 24px;
    font-family: var(--head);
    font-size: 14px;
    color: var(--ink-muted);
    text-align: center;
}

.site-footer p {
    font-size: 15px;
}

.site-footer strong {
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.site-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--ink);
}

@media (max-width: 640px) {
    .wrap {
        padding: 56px 16px;
    }

    .site-header .wrap {
        padding: 8px 16px;
    }

    .site-nav > a:not(.button) {
        padding: 0 8px;
    }

    .dl-hero .wrap {
        padding: 48px 16px 24px;
    }

    .dl-section .wrap {
        padding: 32px 16px;
    }

    .release {
        padding: 20px;
    }

    .release-head .button {
        width: 100%;
    }

    .site-footer .wrap {
        padding: 32px 16px;
    }

    .site-footer a {
        padding: 0 8px;
    }
}
