/* ============================================================
   Nyx · Hestia — shared foundation only.
   Portfolio design tokens (light theme: slate ground, white
   surfaces, blue/cyan/purple brand gradient, Poppins), reset,
   base elements, the fluid type scale, and the shared layout
   primitives (.page / .reader).
   Component looks live in scoped <Component>.razor.css files.
   ============================================================ */

:root {
    --bg: #F1F5F9; /* slate 100 ground */
    --bg-2: #FFFFFF; /* white */
    --surface: #FFFFFF; /* raised white card */
    --surface-2: #e9edf3; /* tinted surface / hover */
    --raise: #cbd5e1; /* slate 300 track */
    --border: #d5dbe5; /* light slate border */
    --border-soft: #e3e7ee; /* softer divider */
    --text: #0B1120; /* navy near-black */
    --muted: #475569; /* slate 600 */
    --faint: #94a3b8; /* slate 400 */

    --accent: #3b82f6; /* brand blue */
    --accent-2: #2563eb; /* deeper blue (reads on white) */
    --accent-dim: rgba(59, 130, 246, 0.12);
    --accent-line: rgba(59, 130, 246, 0.32);
    --glow: rgba(59, 130, 246, 0.28);
    /* brand gradients (blue → purple → cyan) */
    --gradient-brand: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
    --gradient-text: linear-gradient(120deg, #2563eb 0%, #7c3aed 45%, #0891b2 100%);
    --radius: 14px;
    --radius-sm: 9px;
    /* fluid content width — grows with the screen, capped for readability */
    --maxw: clamp(660px, 42vw, 920px);
    --sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
    --ease: cubic-bezier(.22, .61, .36, 1);
    color-scheme: light;
}

/* fluid base: 1rem scales ~15px → 19px between laptop and ultrawide.
   The px term keeps it zoom-accessible (not pure vw). */
html {
    font-size: clamp(15px, 0.25vw + 12.6px, 19px);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    background-image: radial-gradient(60vw 34vw at 50% -6%, rgba(59, 130, 246, 0.12), transparent 70%), radial-gradient(50vw 40vw at 100% 0%, rgba(139, 92, 246, 0.10), transparent 60%);
    background-attachment: fixed;
}

::selection {
    background: rgba(59, 130, 246, 0.24);
    color: #0b1120;
}

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

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

/* ---------- shared layout primitives ---------- */

.page {
    display: block;
    position: relative;
    z-index: 1;
}

.reader {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(1.5rem, 2.6vw, 3.2rem) clamp(1rem, 2vw, 2.2rem) 7rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

    .reader > * {
        animation: rise .5s var(--ease) both;
    }

        .reader > *:nth-child(1) {
            animation-delay: .02s;
        }

        .reader > *:nth-child(2) {
            animation-delay: .09s;
        }

        .reader > *:nth-child(3) {
            animation-delay: .16s;
        }

        .reader > *:nth-child(4) {
            animation-delay: .23s;
        }

        .reader > *:nth-child(5) {
            animation-delay: .30s;
        }

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- not found (shared by every detail page) ---------- */

.notfound {
    padding: 0.5rem 0;
}

    .notfound h1 {
        font-size: 1.33rem;
        font-weight: 620;
        margin: 0 0 0.5rem;
    }

    .notfound .muted {
        font-size: 0.93rem;
        margin: 0 0 1.2rem;
    }

/* ---------- focus ---------- */

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

/* ---------- responsive + motion ---------- */

@media (max-width: 620px) {
    .reader {
        padding: 1.5rem 1rem 6rem;
        gap: 1.4rem;
    }
}

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