/* The page around the app: the loading screen, as the Loader board draws it (docs/design/project/Loader.dc.html and
   portfolio.css), and the static words a browser without the app reads. Identity A's colours, light and dark: the
   system's theme, or the one the reader picked before (index.html sets `data-theme`). */

@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("composeResources/com.pantrixui.foundation.generated.resources/font/plus_jakarta_sans.ttf") format("truetype");
    font-weight: 200 800;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("composeResources/com.developersancho.site.core.designsystem.generated.resources/font/jetbrains_mono_regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("composeResources/com.developersancho.site.core.designsystem.generated.resources/font/jetbrains_mono_bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    --background: #ffffff;
    --surface: #ffffff;
    --panel: #f6f7f9;
    --text-primary: #0b1220;
    --text-secondary: #475569;
    --divider: #e6e8ec;
    --primary: #c2410c;
    --signal: #ff5a1f;
    --accent-text: #c2410c;
    --ink-block: #0b1220;
    --on-ink-block: #ffffff;
    --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --background: #0b1220;
        --surface: #111a2e;
        --panel: #0e1628;
        --text-primary: #f8fafc;
        --text-secondary: #94a3b8;
        --divider: #1e293b;
        --primary: #ff5a1f;
        --accent-text: #ff7a45;
        --ink-block: #f8fafc;
        --on-ink-block: #0b1220;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --background: #0b1220;
    --surface: #111a2e;
    --panel: #0e1628;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --divider: #1e293b;
    --primary: #ff5a1f;
    --accent-text: #ff7a45;
    --ink-block: #f8fafc;
    --on-ink-block: #0b1220;
    color-scheme: dark;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text-primary);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

/* Where the app runs, it is the whole page and scrolls itself. */
html.app, html.app body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* The box the app is set in: the whole page. */
#app {
    width: 100%;
    height: 100%;
}

/* The loading screen: over the app, on the page's ground, until the app has drawn its first page. */
#loading {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: auto;
    background: var(--background);
}

/* The page's static words, which the build writes for each page: hidden where the app runs, and the page itself in a
   browser that cannot run it, and for search engines. */
html.app #static {
    display: none;
}

html:not(.app) #loading,
html:not(.app) #app {
    display: none;
}

.loader {
    box-sizing: border-box;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}

.loader-in {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.loader-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.loader-name {
    margin: 0;
    font-size: 32px;
    line-height: 38px;
    font-weight: 800;
    letter-spacing: -.8px;
}

.mono-mark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    background: var(--ink-block);
    color: var(--on-ink-block);
    font-weight: 800;
    letter-spacing: -.2px;
}

.mono-mark::after {
    content: "";
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: var(--signal);
}

.loader-mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 17px;
}

.eyebrow {
    margin: 0;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 20px;
    letter-spacing: .2px;
    color: var(--accent-text);
}

.eyebrow::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 2px;
    margin: -2px 10px 0 0;
    vertical-align: middle;
    background: var(--signal);
}

.body {
    margin: 0;
    font-size: 16px;
    line-height: 26px;
    font-weight: 500;
    color: var(--text-secondary);
}

.loader-wait {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-secondary);
}

/* Pantrix's spinner: three quarters of a ring in the primary colour, a turn in 0.9 s; still where less motion is
   asked for. */
.spinner {
    flex: none;
    stroke: var(--primary);
    animation: spin .9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
    }
}

@media (max-width: 599px) {
    .loader-name {
        font-size: 28px;
        line-height: 34px;
    }
}

/* The static words: the site's type and colours, one readable column. */
#static {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 48px;
    font-size: 16px;
    line-height: 1.6;
}

#static a {
    color: var(--accent-text);
}

#static header nav a {
    margin-right: 12px;
}

#static h1, #static h2, #static h3 {
    line-height: 1.25;
}

#static footer {
    margin-top: 48px;
    border-top: 1px solid var(--divider);
    color: var(--text-secondary);
    font-size: 13px;
}
