/* ============================================
   ACCESSIBILITY & THEME — jamesmccleary.com
   Shared across index.html and case study pages
   ============================================ */

/* ---- SKIP LINK ---- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1.5rem;
    background: #6366f1;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.625rem 1.25rem;
    border-radius: 0 0 12px 12px;
    text-decoration: none;
    z-index: 9999;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
    outline: 3px solid #a78bfa;
    outline-offset: 2px;
}

/* ---- FOCUS STYLES ---- */
:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 3px;
    border-radius: 4px;
}
button:focus-visible,
a:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---- DARK MODE (default) ---- */
:root {
    --bg:              #0a0a0c;
    --bg-secondary:    #111114;
    --text-main:       #f8fafc;
    --text-muted:      #94a3b8;
    --text-subtle:     #64748b;
    --entertainment:   #818cf8;
    --medtech:         #2dd4bf;
    --fintech:         #fbbf24;
    --edu:             #fb7185;
    --border:          rgba(255,255,255,0.08);
    --border-hover:    rgba(255,255,255,0.15);
    --glass:           rgba(255,255,255,0.03);
    --glass-hover:     rgba(255,255,255,0.05);
    --dot-color:       rgba(255,255,255,0.03);
    --scrollbar-thumb: rgba(255,255,255,0.08);
    --stat-gradient:   linear-gradient(to bottom, #fff, #444);
    --resume-bg:       #18181b;
    --hero-glow:       rgba(129,140,248,0.08);
    --bg-grid:         rgba(129,140,248,0.07);
    --role-dot-bg:     #0a0a0c;
    --section-after:   rgba(255,255,255,0.08);
    --mobile-menu-border: rgba(255,255,255,0.08);
    --mobile-link-border: rgba(255,255,255,0.05);
    --contrast-fix:    #7c8fa8; /* bumped from #64748b for WCAG AA on dark bg */
}

/* ---- LIGHT MODE ---- */
html.light {
    --bg:              #f8f9fb;
    --bg-secondary:    #ffffff;
    --text-main:       #0f172a;
    --text-muted:      #374151;
    --text-subtle:     #6b7280;
    --entertainment:   #4f46e5;
    --medtech:         #0d9488;
    --fintech:         #b45309;
    --edu:             #e11d48;
    --border:          rgba(0,0,0,0.10);
    --border-hover:    rgba(0,0,0,0.20);
    --glass:           rgba(255,255,255,0.80);
    --glass-hover:     rgba(255,255,255,0.95);
    --dot-color:       rgba(0,0,0,0.04);
    --scrollbar-thumb: rgba(0,0,0,0.15);
    --stat-gradient:   linear-gradient(to bottom, #0f172a, #374151);
    --resume-bg:       #ffffff;
    --hero-glow:       rgba(79,70,229,0.06);
    --bg-grid:         rgba(79,70,229,0.04);
    --role-dot-bg:     #f8f9fb;
    --section-after:   rgba(0,0,0,0.10);
    --mobile-menu-border: rgba(0,0,0,0.08);
    --mobile-link-border: rgba(0,0,0,0.06);
    --contrast-fix:    #4b5563;
}

/* Light mode body background */
html.light body {
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79,70,229,0.06) 0%, transparent 60%),
        radial-gradient(circle at 2px 2px, rgba(0,0,0,0.04) 1px, transparent 0);
}

/* Light mode glass cards */
html.light .glass-card {
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Light mode stat number */
html.light .stat-number {
    background: var(--stat-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Light mode resume dropdown */
html.light .resume-menu {
    background: #ffffff;
    border-color: rgba(0,0,0,0.12);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
html.light .resume-menu a { color: #374151; }
html.light .resume-menu a:hover { background: rgba(0,0,0,0.04); color: #0f172a; }
html.light .resume-menu a + a { border-top-color: rgba(0,0,0,0.06); }

/* Light mode patent overlay */
html.light .patent-expanded { background: #ffffff; border-color: rgba(0,0,0,0.12); }

/* Light mode press links */
html.light .press-link:hover { color: #0f172a; }

/* Light mode scrollbar */
html.light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); }

/* Light mode mobile menu */
html.light #mobileMenu { border-top-color: rgba(0,0,0,0.08); }

/* Light mode hero h1 muted word */
html.light .text-slate-500 { color: #6b7280 !important; }
html.light .text-slate-400 { color: #374151 !important; }

/* Light mode section dividers */
html.light .border-white\/5 { border-color: rgba(0,0,0,0.07) !important; }
html.light .border-white\/10 { border-color: rgba(0,0,0,0.10) !important; }

/* Light mode badge adjustments */
html.light .badge-ent { background: rgba(79,70,229,0.08); }
html.light .badge-med { background: rgba(13,148,136,0.08); }
html.light .badge-fin { background: rgba(180,83,9,0.08); }
html.light .badge-edu { background: rgba(225,29,72,0.08); }

/* Light mode article accents */
html.light .article-ent { border-left-color: rgba(79,70,229,0.3); }
html.light .article-med { border-left-color: rgba(13,148,136,0.3); }
html.light .article-fin { border-left-color: rgba(180,83,9,0.3); }

/* Light mode timeline dots */
html.light .role-row::before { background: var(--role-dot-bg); }

/* ---- LARGE TEXT MODE ---- */
html.large-text {
    font-size: 120%;
}
html.large-text .section-title { font-size: 0.85rem; }
html.large-text .sector-badge { font-size: 0.7rem; }

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .glass-card,
    .glass-card:hover {
        transform: none !important;
        transition: border-color 0.2s ease !important;
    }
    .patent-details,
    .nng-verify {
        transition: none !important;
    }
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---- ACCESSIBILITY CONTROLS (theme + text toggle) ---- */
.a11y-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.a11y-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    text-transform: uppercase;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    line-height: 1.4;
}

.a11y-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
    background: var(--glass-hover);
}

.a11y-btn:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}

.a11y-btn[aria-pressed="true"] {
    background: rgba(129,140,248,0.12);
    border-color: rgba(129,140,248,0.4);
    color: var(--entertainment);
}
