:root {
    --bg-dark: #0a0a0f;
    --bg-panel: rgba(20, 20, 30, 0.6);
    --bg-panel-hover: rgba(30, 30, 45, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --accent-red: #ff3366;
    --accent-blue: #00f0ff;
    --accent-amber: #ffaa00;
    --border-glass: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 100;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.glass {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
}

.accent-text {
    background: linear-gradient(90deg, var(--accent-red), var(--accent-amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-blue);
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-blue);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6rem 5% 2rem;
    position: relative;
    background: radial-gradient(circle at 50% 30%, rgba(255, 51, 102, 0.15) 0%, rgba(10, 10, 15, 1) 50%);
}

.badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.stat-container {
    padding: 2rem 4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-container.glow {
    box-shadow: 0 0 40px rgba(255, 51, 102, 0.2);
    border-color: rgba(255, 51, 102, 0.3);
}

.stat-symbol, .stat-number {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.stat-label {
    margin-top: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Sections */
.section {
    padding: 6rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    padding: 2.5rem;
    transition: transform 0.3s, background 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    background: var(--bg-panel-hover);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

.card-icon.red { background: rgba(255, 51, 102, 0.1); color: var(--accent-red); }
.card-icon.amber { background: rgba(255, 170, 0, 0.1); color: var(--accent-amber); }

.card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--text-secondary);
}

/* Case Studies */
.case-studies {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.case-card {
    padding: 2rem;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-red);
}

.case-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.tag.danger {
    background: rgba(255, 51, 102, 0.1);
    color: var(--accent-red);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}

.amount {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.case-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.grant-type {
    color: var(--accent-amber);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.evidence-list {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.evidence-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.evidence-item.fail {
    color: var(--text-primary);
}

.evidence-item.fail svg {
    color: var(--accent-red);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

/* Methodology */
.methodology-card {
    padding: 4rem;
    text-align: center;
}

.methodology-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.method-step {
    position: relative;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.step-num {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--bg-dark);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-family: 'Outfit';
}

.method-step h4 {
    margin-bottom: 1rem;
    margin-top: 1rem;
    color: var(--text-primary);
}

.method-step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-glass);
}

@media (max-width: 768px) {
    .methodology-grid {
        grid-template-columns: 1fr;
    }
    .case-studies {
        grid-template-columns: 1fr;
    }
    .stat-container {
        padding: 1.5rem 2rem;
    }
}

/* Evidence Deep Dive Tabs & Timeline */
.evidence-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.tab-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 0.75rem 2rem;
    border-radius: 100px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-panel-hover);
}

.tab-btn.active {
    background: linear-gradient(90deg, rgba(255, 51, 102, 0.2), rgba(255, 170, 0, 0.2));
    border-color: var(--accent-red);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.2);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 2rem;
    border-left: 2px solid var(--border-glass);
}

.timeline-item {
    position: relative;
    padding: 2rem;
    margin-bottom: 2rem;
    border-left: none;
}

.timeline-marker {
    position: absolute;
    left: -2rem; /* Half of padding-left + width/2 */
    top: 2rem;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: var(--bg-dark);
    border: 2px solid var(--accent-blue);
    color: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-family: 'Outfit';
    z-index: 2;
}

.timeline-marker.fail {
    border-color: var(--accent-red);
    color: var(--accent-red);
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.3);
}

.timeline-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.timeline-content .grant-type {
    margin-bottom: 1rem;
}

.evidence-img {
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    margin-top: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Built-with tech badges */
.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.1);
    transition: border-color 0.2s, color 0.2s;
}
.tech-badge:hover {
    border-color: rgba(80,180,255,0.4);
    color: rgba(255,255,255,0.95);
}

/* Live pulse indicator */
.live-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(80, 255, 180, 0.9);
    box-shadow: 0 0 8px rgba(80, 255, 180, 0.6);
    animation: pulse-green 1.8s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

/* Ledger table hover */
#ledger-tbody tr:hover {
    background: rgba(255,255,255,0.04);
}

/* Animation Classes for JS */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}
