/* murm wears the Cory Land paper: cream paper and charcoal ink by day,
   warm night paper after dark, Georgia for display, Geist for everything
   you operate, and rust as the single accent. Shared by every page. */

@font-face {
    font-family: "Geist";
    src: url("/fonts/Geist-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Geist Mono";
    src: url("/fonts/GeistMono-Variable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;

    --background: #f6f4ed;
    --foreground: #292c2a;
    --secondary: #eeece3;
    --surface: #f1efe7;
    --raised: #fbfaf5;
    --muted-foreground: #686b64;
    --subtle-foreground: #777a72;
    --border: #d6d4cb;
    --border-strong: #b5b4a9;
    --shadow-color: 32 22% 18%;

    --brand: #a84e36;
    --brand-soft: #a84e3612;
    --tint-brand: #ecdcd2;
    --tint-brand-text: #793c2d;
    --destructive: hsl(0 66% 47%);
    --destructive-soft: hsl(0 66% 47% / 0.07);
    --success: #556944;

    --radius: 3px;
    --radius-sm: 2px;

    --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
    --font-serif: Georgia, "Times New Roman", serif;

    --motion-fast: 140ms;
    --motion-settle: 240ms;
    --ease-standard: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --background: #1c1d1a;
        --foreground: #e9e5d9;
        --secondary: #282925;
        --surface: #222320;
        --raised: #262723;
        --muted-foreground: #a6a397;
        --subtle-foreground: #8f8d82;
        --border: #393a35;
        --border-strong: #56574f;
        --shadow-color: 40 12% 3%;
        --brand: #d97c5d;
        --brand-soft: #d97c5d1a;
        --tint-brand: #4a2f25;
        --tint-brand-text: #f0b9a3;
        --destructive: hsl(4 72% 64%);
        --destructive-soft: hsl(4 72% 64% / 0.1);
        --success: #a3ba8e;
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --background: #1c1d1a;
    --foreground: #e9e5d9;
    --secondary: #282925;
    --surface: #222320;
    --raised: #262723;
    --muted-foreground: #a6a397;
    --subtle-foreground: #8f8d82;
    --border: #393a35;
    --border-strong: #56574f;
    --shadow-color: 40 12% 3%;
    --brand: #d97c5d;
    --brand-soft: #d97c5d1a;
    --tint-brand: #4a2f25;
    --tint-brand-text: #f0b9a3;
    --destructive: hsl(4 72% 64%);
    --destructive-soft: hsl(4 72% 64% / 0.1);
    --success: #a3ba8e;
}

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

html {
    background: var(--background);
}

body {
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    font-feature-settings: "rlig" 1, "calt" 1, "ss01" 1, "cv11" 1;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: color-mix(in srgb, var(--brand) 22%, transparent);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

a {
    color: var(--foreground);
    text-decoration-color: var(--border-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    text-decoration-color: var(--foreground);
}

:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Theme toggle: a quiet circle, moon by day and sun by night. */
.theme-toggle {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: border-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}

.theme-toggle:hover {
    border-color: var(--border-strong);
    color: var(--foreground);
}

.theme-toggle svg {
    position: absolute;
    inset: 0;
    width: 15px;
    height: 15px;
    margin: auto;
    transition: opacity var(--motion-settle) var(--ease-standard), transform var(--motion-settle) var(--ease-standard);
}

.theme-toggle .theme-icon-sun { opacity: 0; transform: rotate(-40deg) scale(.7); }
:root[data-theme="dark"] .theme-toggle .theme-icon-sun { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-moon { opacity: 0; transform: rotate(40deg) scale(.7); }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .theme-icon-sun { opacity: 1; transform: none; }
    :root:not([data-theme="light"]) .theme-toggle .theme-icon-moon { opacity: 0; transform: rotate(40deg) scale(.7); }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

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