/*
 * Oryn design tokens + base styles.
 * Dark-first, quiet, low-aggression UI. Shared by every page.
 * Oryn is a fork of Galène (MIT); see LICENCE.
 */

:root {
    /* Surfaces (dark theme) */
    --bg: #0B0E13;
    --surface: #12161C;
    --surface-2: #161B22;
    --surface-3: #1B2129;

    /* Text */
    --text: #E6EAF0;
    --text-2: #9AA4B2;
    --text-3: #6B7480;

    /* Accent — blue -> violet duo */
    --accent: #5B8CFF;
    --accent-2: #7A6CFF;
    --accent-grad: linear-gradient(95deg, #5B8CFF 0%, #7A6CFF 100%);
    --accent-soft: rgba(91, 140, 255, 0.14);
    --focus-ring: rgba(91, 140, 255, 0.45);

    /* Lines & overlays */
    --divider: rgba(255, 255, 255, 0.06);
    --hover: rgba(255, 255, 255, 0.04);
    --hover-strong: rgba(255, 255, 255, 0.08);

    /* Status — muted, never aggressive */
    --danger: #E06A6A;
    --warn: #D6B85A;
    --ok: #6BBE8A;

    /* Shape */
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    /* Elevation — contrast first; shadow only for modals */
    --shadow-modal: 0 10px 30px rgba(0, 0, 0, 0.45);

    /* Motion */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast: 140ms;
    --t-base: 240ms;

    /* Type */
    --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
            "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif,
            "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

h1 {
    font-size: 160%;
    font-weight: 400;
    white-space: nowrap;
}

.inline {
    display: inline;
}

.signature {
    border-top: 1px solid var(--divider);
    padding-top: 0;
    clear: both;
    min-height: 3.125rem;
    text-align: center;
    color: var(--text-3);
}

.signature a {
    color: var(--text-2);
}

.signature a:hover {
    color: var(--accent);
}

body, html {
    height: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.01em;
    color: var(--text);
    text-align: left;
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*, :after, :before {
    box-sizing: border-box;
}

textarea {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
}

/* Shared brand lockup: mark + wordmark */
.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
}

.brand-mark {
    width: 22px;
    height: 22px;
    flex: none;
    filter: drop-shadow(0 0 6px rgba(91, 140, 255, 0.35));
}

.brand-word {
    font-weight: 400;
    font-size: 1.15rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1;
}

::selection {
    background: rgba(91, 140, 255, 0.35);
    color: #fff;
}

/* Quiet, dark scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
    background-clip: padding-box;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

/*
 * Oryn: full-screen loading overlay — the FOUC guard.
 * The strict CSP (style-src falls back to default-src 'self') forbids inline
 * <style>, so the guard lives here in an external sheet.  common.css is small
 * and loads before the large galene.css, so the overlay (#app-loading, in
 * galene.html) is painted over the page during the brief window before
 * galene.css applies and the raw DOM would otherwise flash as plain text.
 * galene.js removes the overlay on window 'load'.
 */
html {
    background: var(--bg);
}

#app-loading {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.app-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.14);
    border-top-color: var(--accent);
    animation: app-spin 0.8s linear infinite;
}

@keyframes app-spin {
    to { transform: rotate(360deg); }
}
