/* Fraunces (variable: opsz 9-144, wght 100-900, SOFT 0-100) + Inter */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,400..700,0..100;1,9..144,400..700,0..100&family=Inter:wght@400;500;600;700&display=swap');

/*
 * Arina Zhurakovskaia — brand tokens (psych-student fork)
 * Direction: "Warm Clinical" — dark-mode primary with dusty rose accent.
 * See design-bundles/psych-student/brand.md for rationale and accessibility notes.
 * All contrast ratios verified in brand.md: body AAA 14.7:1, accent AA/AAA 7.2:1.
 */

:root,
[data-theme="dark"] {
    --bg: #0D1424;
    --bg-elevated: #171F33;
    --bg-deep: #080C16;

    --text: #F5F0E6;
    --text-soft: #C9C3B5;
    --text-muted: #8A8778;

    --accent: #C9A094;
    --accent-soft: #7D8F83;

    --border: #2A3349;
    --focus: #D4B59E;

    /* template-kit compatibility shims */
    --color-accent: var(--accent);
    --color-accent-hover: #D4B59E;
    --color-accent-light: #E0C4B8;
    --bg-body: var(--bg);
    --bg-surface: var(--bg-elevated);
    --bg-surface-alt: var(--bg-deep);
    --bg-hero: var(--bg);
    --text-muted-rgb: 138 135 120;
}

[data-theme="light"] {
    --bg: #F8F4EC;
    --bg-elevated: #FFFFFF;
    --bg-deep: #EFE9DE;

    --text: #1E2A3A;
    --text-soft: #455268;
    --text-muted: #7A8597;

    --accent: #B8755A;
    --accent-soft: #6B7F73;

    --border: #D9CFBF;
    --focus: #A56548;

    --color-accent: var(--accent);
    --color-accent-hover: #A56548;
    --color-accent-light: #C48670;
    --bg-body: var(--bg);
    --bg-surface: var(--bg-elevated);
    --bg-surface-alt: var(--bg-deep);
    --bg-hero: var(--bg);
    --text-muted-rgb: 122 133 151;
}

/* Typography — Fraunces (headings, variable serif with SOFT optical size)
 * + Inter (body). Loaded via Google Fonts URL set on SiteSettings. */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.0625rem;
    line-height: 1.7;
    font-weight: 400;
    background: var(--bg);
    color: var(--text);
}

h1, h2, h3, h4, h5, h6,
.heading {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
}

h1 { font-size: 3.75rem; line-height: 1.1; font-weight: 600; font-variation-settings: "SOFT" 100, "opsz" 144; }
h2 { font-size: 2.5rem;  line-height: 1.15; font-weight: 500; }
h3 { font-size: 1.5rem;  line-height: 1.3;  font-weight: 500; }

.caption, .eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    line-height: 1.4;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* Focus ring — mandatory on all interactive elements (brand.md §Accessibility) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* Nav hover: underline-draw (300ms cubic-bezier 0.2, 0.8, 0.2, 1) — brand.md §Motion */
nav a {
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
nav a:hover,
nav a:focus-visible {
    background-size: 100% 1px;
}

/* Faint grid texture overlay preserved from her current site (~3% opacity). */
.hero-texture::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image:
        linear-gradient(var(--text) 1px, transparent 1px),
        linear-gradient(90deg, var(--text) 1px, transparent 1px);
    background-size: 48px 48px;
}

/* Reveal-on-scroll (brand.md §Motion) — fade-up 8px over 300ms.
 * Respects prefers-reduced-motion. Hooks: .reveal class on any section. */
.reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 300ms ease-out, transform 300ms ease-out;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section-level reveal for the psych-student fork. Paired with the
 * IntersectionObserver in templates/overrides/base.html (extra_js block)
 * which uses rootMargin: '0px 0px 160px 0px' to fire ~160px before the
 * section enters the viewport — so by the time the user scrolls to it,
 * the fade is already complete. 16px translate, 380ms. */
.arina-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}
.arina-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal.is-visible,
    .arina-reveal,
    .arina-reveal.is-visible {
        opacity: 1;
        transform: none;
        transition: none;
    }
    nav a {
        transition: none;
    }
}

/* Upstream style.css ships no default-hide rule for .mobile-drawer,
 * so the hamburger's drawer renders as a visible block under the main
 * nav at desktop widths. Hide it; keep mobile behaviour via max-height. */
.mobile-drawer {
    display: none;
}
@media (max-width: 768px) {
    .mobile-drawer {
        display: block;
        max-height: 0;
        overflow: hidden;
        transition: max-height 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .mobile-drawer.open {
        max-height: 28rem;
    }
    .mobile-drawer .navbar-nav {
        position: static;
        transform: none;
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 1rem 1rem;
        background: var(--bg-deep);
        border-bottom: 1px solid var(--border, rgba(245, 240, 230, 0.08));
    }
}
