/*
 * Shared tokens and primitives for the profile ("manu-os") and project pages.
 * Palette: neutral glass + ink, one sunset-orange accent pulled from the wallpaper.
 * Theme follows prefers-color-scheme.
 * Radius rule: windows and panels 14px, inner surfaces 10px, app icons 14px,
 * every button and chip is a full pill.
 * Z-index scale: wallpaper 0, desktop icons 1, windows 10-900 (managed in script.js),
 * dock 1000, menu bar 1001.
 */

@font-face {
    font-family: "Satoshi";
    src: url("fonts/satoshi-400.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Satoshi";
    src: url("fonts/satoshi-500.woff2") format("woff2");
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Satoshi";
    src: url("fonts/satoshi-700.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Satoshi";
    src: url("fonts/satoshi-900.woff2") format("woff2");
    font-weight: 900;
    font-display: swap;
}

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

:root {
    color-scheme: light dark;

    --bg: #e9e7e6;
    --glass: rgb(250 249 248 / 0.8);
    --glass-strong: rgb(252 251 250 / 0.94);
    --surface: #fbfaf9;
    --surface-2: #efedeb;
    --text: #15161a;
    --muted: #5c6068;
    --line: rgb(21 22 26 / 0.09);
    --line-strong: rgb(21 22 26 / 0.18);
    --accent: #c8461f;
    --accent-text: #b13c18;
    --on-accent: #fff8f4;
    --accent-soft: rgb(200 70 31 / 0.1);
    --shadow: 0 30px 80px -30px rgb(40 20 10 / 0.35), 0 0 0 1px rgb(21 22 26 / 0.06);
    --shadow-soft: 0 16px 40px -24px rgb(40 20 10 / 0.3);
    --blur: blur(28px) saturate(170%);

    --font-sans: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    --radius: 14px;
    --radius-sm: 10px;
    --pill: 999px;
    --page: min(1180px, 100% - 3rem);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0e11;
        --glass: rgb(30 31 36 / 0.74);
        --glass-strong: rgb(30 31 36 / 0.94);
        --surface: #1b1c21;
        --surface-2: #25272d;
        --text: #eeeff2;
        --muted: #9ea3ad;
        --line: rgb(238 239 242 / 0.09);
        --line-strong: rgb(238 239 242 / 0.18);
        --accent: #ff7a45;
        --accent-text: #ff9466;
        --on-accent: #1a0f0a;
        --accent-soft: rgb(255 122 69 / 0.14);
        --shadow: 0 30px 80px -24px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(255 255 255 / 0.08);
        --shadow-soft: 0 16px 40px -20px rgb(0 0 0 / 0.7);
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
video,
svg {
    display: block;
    max-width: 100%;
}

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

button,
input,
textarea {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: 0;
    cursor: pointer;
}

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

::selection {
    background: var(--accent);
    color: var(--on-accent);
}

.icon {
    width: 1em;
    height: 1em;
    flex: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.75rem;
    padding: 0 1.25rem;
    border-radius: var(--pill);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    transition:
        transform 0.35s var(--ease),
        background-color 0.3s var(--ease),
        border-color 0.3s var(--ease),
        box-shadow 0.35s var(--ease);
}

.btn:hover {
    border-color: var(--text);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.btn-primary:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 26px -12px var(--accent);
    transform: translateY(-1px);
}

.btn-sm {
    height: 2.25rem;
    padding: 0 0.95rem;
    font-size: 0.875rem;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent-text);
    font-weight: 500;
}

.text-link .icon {
    transition: transform 0.3s var(--ease);
}

.text-link:hover .icon {
    transform: translate(2px, -2px);
}

.text-link:hover .icon-right {
    transform: translateX(3px);
}

/* Stack chips */

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
}

.stack li {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
    padding: 0.2rem 0.6rem;
    border-radius: var(--pill);
    background: var(--surface-2);
}

/* Project pages: top bar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    width: var(--page);
    margin-inline: auto;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.wordmark-mark {
    width: 1.75rem;
    height: 1.75rem;
    display: grid;
    place-items: center;
    border-radius: var(--pill);
    background: var(--accent);
    color: var(--on-accent);
    font-size: 0.7rem;
    font-weight: 900;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.topnav a:not(.btn) {
    padding: 0.4rem 0.85rem;
    border-radius: var(--pill);
    color: var(--muted);
    transition:
        color 0.25s var(--ease),
        background-color 0.25s var(--ease);
}

.topnav a:not(.btn):hover {
    color: var(--text);
    background: var(--surface-2);
}

.site-footer {
    width: var(--page);
    margin: 0 auto;
    padding: 2rem 0 2.5rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer nav {
    display: flex;
    gap: 1.25rem;
}

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (max-width: 767px) {
    :root {
        --page: calc(100% - 2rem);
    }

    .topnav .nav-link {
        display: none;
    }
}
