
:root{
    --bg-1: #d2cedb;
    --bg-2: #12041f;
    --panel: rgba(255,255,255,0.04);
    --accent-1: #7a2ff5;
    --accent-2: #8f092a;
    --muted: #9aa0b4;
    --glass: rgba(255,255,255,0.06);
    --neon: rgba(122,47,245,0.9);
}

html,body{height:100%;}
body {
    margin: 0;
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(1200px 600px at 10% 10%, rgba(122,47,245,0.14), transparent),
        radial-gradient(900px 500px at 90% 90%, rgba(255,92,156,0.12), transparent),
        linear-gradient(180deg,
            var(--bg-1) 0%,
            rgba(210,206,219,0.9) 25%,
            rgba(33,6,63,0.9) 70%,
            var(--bg-2) 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-attachment: fixed;
    color: #eaeaf3;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 1rem;
}

header.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1rem;
    background: linear-gradient(135deg, rgba(56, 29, 99, 0.45)), rgba(26, 0, 48, 0.25));
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), inset 0 -2px 40px rgba(255,255,255,0.02);
    color: white;
    border-radius: 10px;
    backdrop-filter: blur(6px) saturate(110%);
}

header.site-header h1 { font-size:1.5rem; margin:0; color: #7a2ff5; text-shadow: 0 6px 28px rgba(122,47,245,0.35); letter-spacing: .6px; }

.logo {
    height: 72px;
    margin-bottom: 0.25rem;
    filter: drop-shadow(0 6px 14px rgba(122,47,245,0.35));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05) rotate(-2deg);
}

.navbar {
    margin-top: 0;
}

.navbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; justify-items: stretch; }
.navbar a { 
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.5rem; 
    border-radius: 6px; 
    text-decoration: none; 
    color: #fff; 
    font-weight: 600; 
    font-size: 0.75rem; 
    text-align: center;
    letter-spacing: 0.2px;
    border: none; 
    background: linear-gradient(90deg,var(--accent-1), var(--accent-2)); 
    transition: all 0.2s ease; 
    box-shadow: 0 2px 8px rgba(122,47,245,0.25);
}
.navbar a:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 4px 16px rgba(122,47,245,0.4), 0 0 12px rgba(255,92,156,0.25); 
}
.navbar a:active {
    transform: translateY(0);
}
.navbar a.active { 
    box-shadow: 0 4px 14px rgba(122,47,245,0.5); 
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); 
}

.main-content {
    padding: 2rem 1.25rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.795), rgba(255, 255, 255, 0.438));
    border-radius: 12px;
    margin-top: 1.5rem;
    box-shadow: 0 12px 40px rgba(2,6,23,0.6);
    border: 1px solid rgba(255,255,255,0.03);
    color: #000;
}

/* Accessibility helpers */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: static; left: 1rem; top: 1rem; background: #fff; padding: 6px 10px; border-radius: 4px; color: #7a2ff5; text-decoration: none; z-index: 999; box-shadow: 0 4px 14px rgba(0,0,0,0.15);} 

/* Glossary UI */
.glossary-controls { display:flex; gap:1rem; align-items:center; margin-bottom:0.75rem; flex-wrap:wrap; }
.glossary-controls input[type=search] { padding:8px 10px; border-radius:6px; border:1px solid #e6e6f0; min-width:260px; }
.glossary-controls button { padding:7px 10px; border-radius:6px; border:1px solid rgba(0,0,0,0.06); background:#faf7ff; cursor:pointer; }
.glossary-alpha-nav { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.glossary-alpha-nav a { padding:6px 8px; border-radius:4px; background:#f6f2ff; color:#3b157a; text-decoration:none; font-weight:700; }
.glossary-letter-toggle { padding:6px 12px; background:#f0eaff; border:1px solid rgba(122,47,245,0.06); border-radius:6px; cursor:pointer; margin:6px 0; }
.glossary-letter-content { padding:6px; margin-bottom:0.65rem; }


.intro {
    text-align: center;
    margin-bottom: 2rem;
}

.intro h2 {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    color: #000;
    text-shadow: 0 8px 36px rgba(122,47,245,0.28), 0 2px 0 rgba(0,0,0,0.18);
}

.intro p {
    font-size: 1.1rem;
    color: #c90202;
    max-width: 800px;
    margin: 0 auto;
}

.donate-btn {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 1rem;
    background-color: #ff5c9c; /* punchy magenta */
    color: white;
    text-decoration: none;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(255,92,156,0.25);
}

.btn { display:inline-block; padding:8px 12px; border-radius:8px; color:white; text-decoration:none; font-weight:700; margin-right:8px; border:0; background: linear-gradient(90deg,var(--accent-1), var(--accent-2)); box-shadow: 0 8px 26px rgba(122,47,245,0.15); transition: all 0.2s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(122,47,245,0.25); }
.btn.ghost { background: transparent; color: white; border:1px solid rgba(255,255,255,0.06); }
.hero { display:flex; gap:2rem; align-items:center; justify-content:space-between; padding:2rem; margin-bottom:1.5rem; background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('assets/images/FreeEd4MedBackHm.png') center/cover no-repeat; border-radius: 12px; position: relative; }
.hero-left { flex:1 1 56%; }
.hero-right { flex: 1 1 40%; display:flex; justify-content:center; align-items:center; }
.lead { font-size:1.1rem; color: rgba(255,255,255,0.9); margin-top:0.6rem; max-width:56ch; }
.hero-ctas { margin-top:1.1rem; display:flex; gap:0.6rem; align-items:center; }
.micro { color: var(--muted); font-size:0.95rem; margin-top:0.9rem; }
.visual-card { position:relative; width:320px; height:220px; border-radius:12px; overflow:hidden; box-shadow: 0 22px 60px rgba(2,6,23,0.6); border:1px solid rgba(255,255,255,0.04); background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); }
.hero-wave { width:100%; height:100%; object-fit:cover; opacity:0.96; }
.visual-overlay { position:absolute; right:2rem; top:2rem; display:flex; flex-direction:column; gap:8px; z-index: 10; }
.visual-overlay .chip { background:rgba(255,255,255,0.06); padding:6px 10px; color:white; border-radius:999px; font-weight:700; font-size:0.85rem; border:1px solid rgba(255,255,255,0.03); }
.visual-overlay .badge { background:linear-gradient(90deg,var(--accent-2), rgba(255,255,255,0.06)); padding:6px 10px; color:white; border-radius:8px; font-size:0.8rem; font-weight:700; }

@media (max-width:980px){
    .hero { flex-direction:column; gap:1rem; }
    .hero-right { width:100%; align-items:center; }
    .visual-card { width:100%; height:200px; }
}

.donate-btn:hover {
    background-color: #5e0224;
    transform: translateY(-1px);
}

.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.feature {
    background-color: rgba(255,255,255,0.4);
    border-radius: 6px;
    padding: 1rem;
    flex: 1 1 28%;
    max-width: 320px;
    box-shadow: 0 12px 30px rgba(2,6,23,0.45);
    color: #000;
}

.feature h3 { color: var(--accent-1); margin: 0 0 0.35rem 0; }
.feature .feature-link { color: inherit; text-decoration:none; display:inline-block; padding:2px 4px; border-radius:6px; transition:all .12s ease; }
.feature .feature-link:hover{ color: white; background: linear-gradient(90deg,var(--accent-1),var(--accent-2)); transform: translateY(-2px); box-shadow: 0 8px 34px rgba(122,47,245,0.12); }
.feature p { color: #000; margin: 0; }

/* Research Library styles */
.research-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.research-list .entry {
    background: #faf7ff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(122,47,245,0.06);
}

.research-list .entry h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.05rem;
    color: #4a148c;
}

.research-list .entry .meta {
    font-size: 0.9rem;
    color: #0a0a0a;
    margin-bottom: 0.5rem;
}

.research-list .entry p { line-height: 1.45; color: #111111; }

.research-list .entry .breakdown { margin-top: 0.75rem; background: #ffffff; padding: 0.75rem; border-radius: 6px; border: 1px solid rgba(0,0,0,0.04); }
.research-list .entry .breakdown h4 { margin: 0 0 0.35rem 0; font-size: 1rem; color: #3b157a; }
.research-list .entry .key-findings { margin-left: 1.1rem; margin-bottom: 0.5rem; }
.research-list .entry .key-findings li { margin: 0.35rem 0; padding-left: 0.25rem; }
.research-list .entry .breakdown ul { margin-top: 0.25rem; }

/* Glossary term image tile */
.entry { display:block; color: #000; background: rgba(255,255,255,0.5); border-radius: 8px; padding: 0.5rem; margin-bottom: 0.5rem; }
.entry .term-art { float:left; width:90px; height:90px; margin-right:0.9rem; border-radius:8px; background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.06)); display:inline-flex; align-items:center; justify-content:center; border:1px solid rgba(255,255,255,0.03); box-shadow: 0 8px 30px rgba(2,6,23,0.6); }
.entry .term-art img { max-width:78px; max-height:78px; display:block; }
.entry .entry-body { overflow:hidden; }

@media (max-width:720px){
    .entry .term-art { display:none; }
}

.library-controls { display:flex; justify-content:space-between; gap:1rem; align-items:center; margin-top:10px; }
.library-controls .filters { display:flex; gap:0.5rem; align-items:center; flex-wrap:wrap; }
.library-controls .tag { padding:0.3rem 0.5rem; background:#efe7ff; border-radius:5px; border:1px solid rgba(122,47,245,0.06); cursor:pointer; color:#3b157a; font-weight:600; }
.library-controls .tag:hover { background:#f6eaff; }
.library-controls .export button { background:#7a2ff5; color:white; border:none; padding:0.4rem 0.65rem; border-radius:5px; cursor:pointer; }
.library-controls .export button:hover { opacity:0.92; }

/* Tools page styles */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; align-items: start; }
.tool-card { background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0.25)); color: #000; padding: 1rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.03); }
.tool-card h3 { color: var(--accent-1); margin: 0 0 .5rem 0; }
 .tool-card p, .tool-card ul, .tool-card ol, .tool-card li { color: rgba(16,16,18,0.92); }
.tool-card a { color: var(--accent-2); font-weight:700; }
.code { background:#0b0b15; color:#e6e6ff; padding:0.75rem; border-radius:6px; overflow:auto; font-size:0.9rem; }
.demo-controls { margin: 0.6rem 0; }
.demo-controls button { padding:0.4rem 0.7rem; background:#7a2ff5; color:white; border-radius:5px; border:none; cursor:pointer; }
.demo-controls button:disabled { opacity: 0.45; cursor: not-allowed; }

footer.footer {
        text-align: center;
        margin-top: 2rem;
        padding: 1.25rem;
        background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0.25));
        color: #000;
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,0.03);
}

/* neon and hero visual helpers */
.neon { color: white; text-shadow: 0 2px 8px rgba(122,47,245,0.45), 0 0 24px rgba(122,47,245,0.2); }
.glow-strong { text-shadow: 0 8px 36px rgba(122,47,245,0.5), 0 0 40px rgba(255,92,156,0.12); }

@media (max-width:720px){
    .navbar a{ padding:.35rem .6rem; font-size:.9rem; }
    .logo{ height:54px }
    
    /* Mobile Header & Nav Improvements */
    header.site-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    header.site-header > div {
        flex-direction: column;
        gap: 0.5rem;
    }

    .navbar {
        width: 100%;
        grid-template-columns: repeat(2, 1fr); /* 2 columns for easier tapping */
        gap: 0.5rem;
    }
    
    /* Make the last item span full width if odd number of items */
    .navbar a:last-child:nth-child(odd) {
        grid-column: span 2;
    }

    .hero {
        padding: 1.5rem;
        text-align: center;
    }
    
    .hero-left, .hero-right {
        width: 100%;
    }
    
    .intro h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .navbar {
        grid-template-columns: 1fr; /* Stack vertically on very small screens */
    }
    
    .navbar a:last-child:nth-child(odd) {
        grid-column: auto;
    }
    
    .research-list {
        grid-template-columns: 1fr; /* Single column for research items */
    }
    
    .feature {
        max-width: 100%; /* Full width features */
    }
}
