/* =====================================================================
   Faculty Portfolio — theme system, dark mode, progress bar, animations
   ===================================================================== */

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --heading: #123d2e;
    --text: #4b5b53;
    --muted: #6b7d73;
    --border: #e3ebe6;
    --input-bg: #ffffff;
    --input-border: #c8d6cd;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 40px rgba(18, 61, 46, 0.10);
    --gold: #c9741f;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-logo: #1c2b24;
    --nav-link: #33443b;
    --nav-link-hover: #123d2e;
    --nav-hover-bg: #f2f7f4;
    --nav-divider: #f1f5f9;
    --nav-dropdown: #ffffff;
}

:root[data-theme="dark"] {
    --bg: #0b1220;
    --surface: #131f36;
    --surface-alt: #0e1728;
    --heading: #f1f5f9;
    --text: #b7c2d6;
    --muted: #8b98af;
    --border: #243352;
    --input-bg: #0e1728;
    --input-border: #33415a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.45);
    --nav-bg: rgba(11, 18, 32, 0.96);
    --nav-logo: #f1f5f9;
    --nav-link: #cbd5e1;
    /* On the near-black dark nav bar the hover colour has to go lighter, not darker. */
    --nav-link-hover: #ffffff;
    --nav-hover-bg: rgba(255, 255, 255, 0.07);
    --nav-divider: rgba(255, 255, 255, 0.06);
    --nav-dropdown: #131f36;
}

body {
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s ease, color 0.3s ease;
}

/* ---------- Section surfaces ---------- */
.sec { background: var(--bg); transition: background 0.3s ease; }
.sec-alt { background: var(--surface-alt); transition: background 0.3s ease; }
.sec-title { color: var(--heading) !important; }

/* ---------- Eyebrow tags ---------- */
.eyebrow {
    display: inline-block; font-size: 13px; font-weight: 700; padding: 6px 16px;
    border-radius: 30px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
}
.eyebrow.green { background: rgba(5, 150, 105, 0.12); color: #059669; }
.eyebrow.sky   { background: rgba(2, 132, 199, 0.12); color: #0284c7; }
.eyebrow.gold  { background: rgba(212, 175, 55, 0.16); color: #b48608; }
.eyebrow.navy  { background: rgba(18, 61, 46, 0.09);   color: #123d2e; }
:root[data-theme="dark"] .eyebrow.green { color: #34d399; }
:root[data-theme="dark"] .eyebrow.sky   { color: #38bdf8; }
:root[data-theme="dark"] .eyebrow.gold  { color: #e6c34d; }
:root[data-theme="dark"] .eyebrow.navy  { background: rgba(148, 163, 184, 0.15); color: #e2e8f0; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent, var(--gold));
}
.card.flat:hover { transform: translateY(-4px); }
.card-title { color: var(--heading); }
.card-text { color: var(--muted); }

/* Publications rows slide sideways instead of up */
.pub-card:hover { transform: translateX(4px); }

/* ---------- Contact form inputs (theme-aware) ---------- */
.form-input {
    width: 100%; padding: 14px 18px; border: 1px solid var(--input-border);
    background: var(--input-bg); color: var(--heading);
    border-radius: 10px; font-size: 15px; outline: none; box-sizing: border-box;
    transition: border-color 0.3s ease, background 0.3s ease;
    font-family: inherit;
}
.form-input::placeholder { color: var(--muted); opacity: 0.8; }
.form-input:focus { border-color: #059669; }
.form-label { display: block; font-weight: 600; color: var(--heading); font-size: 14px; margin-bottom: 8px; }

/* =====================================================================
   Header — the header's own <style> reads these vars for theming
   ===================================================================== */
@media (max-width: 768px) {
    :root[data-theme="dark"] .nav-right nav ul li a { border-bottom-color: rgba(255, 255, 255, 0.06) !important; }
}

/* Active nav link (scrollspy) */
.nav-right nav ul li a.active-link { color: #123d2e; }
.nav-right nav ul li a.active-link::after { width: 100% !important; }
:root[data-theme="dark"] .nav-right nav ul li a.active-link { color: #ffffff !important; }

/* =====================================================================
   Reading progress bar
   ===================================================================== */
.reading-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0%;
    background: linear-gradient(90deg, #c9741f, #123d2e);
    z-index: 2000; transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(201, 116, 31, 0.5);
}

/* =====================================================================
   Theme toggle button (lives in the header)
   ===================================================================== */
.theme-toggle {
    width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(18, 61, 46, 0.06); color: #123d2e; border: 1px solid rgba(18, 61, 46, 0.12);
    font-size: 16px; transition: all 0.25s ease; margin-right: 12px;
}
.theme-toggle:hover { background: var(--gold); color: #ffffff; border-color: var(--gold); transform: rotate(-15deg); }
:root[data-theme="dark"] .theme-toggle { background: rgba(255, 255, 255, 0.08); color: #e6c34d; border-color: rgba(255, 255, 255, 0.14); }

.nav-cv-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: #c9741f; color: #ffffff !important; padding: 8px 16px;
    border-radius: 8px; font-weight: 700; font-size: 13.5px; text-decoration: none;
    transition: all 0.25s ease;
}
.nav-cv-btn:hover { background: #123d2e; color: #ffffff !important; }
.nav-cv-btn::after { display: none !important; }
:root[data-theme="dark"] .nav-cv-btn:hover { background: #ffffff; color: #123d2e !important; }

/* =====================================================================
   Scroll-reveal animation
   ===================================================================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1 !important; transform: none !important; transition: none; }
}
