/* CSS Variables (Design Tokens) */
:root {
    --bg: #ffffff;
    --panel: #f8fafc;
    --panel-alt: #f1f5f9;
    --text: #1e293b;
    --muted: #64748b;
    --brand: #3b82f6;
    --brand-2: #8b5cf6;
    --card: #ffffff;
    
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --container: min(1100px, 92%);
    --section-padding: 80px 0;
    --nav-height: 64px;
}

/* Dark theme */
[data-theme="dark"] {
    --bg: #0b1020;
    --panel: #0f172a;
    --panel-alt: #0b132b;
    --text: #e6e9ef;
    --muted: #94a3b8;
    --brand: #60a5fa;
    --brand-2: #a78bfa;
    --card: #111827;
    
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --container: min(1100px, 92%);
    --section-padding: 80px 0;
    --nav-height: 64px;
}

/* Global Reset */
* {
    box-sizing: border-box;
}

/* Base Styles */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    padding: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Layout Utilities */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--section-padding);
}

.section-alt {
    background-color: var(--panel-alt);
}

/* Alternating section backgrounds */
.section:nth-child(even) {
    background-color: var(--panel-alt);
}

.section:nth-child(odd) {
    background-color: var(--bg);
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid.two {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid.three {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

@media (max-width: 900px) {
    .grid.two,
    .grid.three {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 600px) {
    .grid.three {
        gap: 1.5rem;
    }
    
    .stat-tile {
        padding: 2rem 1.5rem;
    }
    
    .stat-number {
        font-size: 3rem;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    font-weight: 600;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

p {
    margin: 0 0 1rem 0;
}

.muted {
    color: var(--muted);
}

.caption {
    font-size: 0.875rem;
    color: var(--muted);
    text-align: center;
    margin-top: 0.5rem;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

[data-theme="dark"] .nav {
    background: rgba(11, 16, 32, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.nav-logo:hover {
    color: var(--brand);
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--brand);
}

/* Navigation CTA Button */
.nav-cta {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-left: 1rem;
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    color: white !important;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--brand);
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    position: relative;
    transition: background 0.2s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s ease;
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    bottom: -6px;
}

.nav-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

@media (max-width: 900px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-list {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--panel);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    [data-theme="dark"] .nav-list {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-list.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
}

/* Hero Section */
.hero {
    padding: calc(var(--nav-height) + 2rem) 0 var(--section-padding);
    background: linear-gradient(135deg, var(--panel) 0%, var(--panel-alt) 100%);
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: end;
}

.hero-content {
    max-width: 500px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.hero-byline {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
}

.hero-image-link:hover {
    text-decoration: none;
}

.hero-image {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateX(20px);
}

.hero-image:hover {
    transform: translateX(25px) translateY(-4px);
}

.hero-image:active {
    transform: translateX(22px) translateY(-2px) scale(0.98);
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.hero-image:hover img {
    box-shadow: var(--shadow-lg);
}

/* Add focus styles for accessibility */
.hero-image:focus {
    outline: 2px solid var(--text);
    outline-offset: 4px;
    border-radius: var(--radius);
}

/* Add selection styles */
.hero-image.selected {
    background: var(--panel-alt);
    border-radius: var(--radius);
}

.hero-image.selected img {
    opacity: 0.9;
}

/* Add subtle indicator that image is clickable */
.hero-image::after {
    content: '🔗';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.2rem;
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(0.5);
    z-index: 3;
}

.hero-image:hover::after {
    opacity: 0.7;
    transform: scale(1);
}

@media (max-width: 900px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        align-items: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        transform: translateX(0);
        margin-top: 2rem;
    }
    
    .hero-image:hover {
        transform: translateY(-4px);
    }
    
    .hero-image:active {
        transform: translateY(-2px) scale(0.98);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--muted);
}

.btn-ghost:hover {
    background: var(--muted);
    color: var(--bg);
}

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .card {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card h3 {
    margin-top: 0;
}

.card ul,
.card ol {
    margin: 0;
    padding-left: 1.5rem;
}

.card li {
    margin-bottom: 0.5rem;
}

.download-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Stat Tiles */
.stat-tile {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .stat-tile {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 0.75rem;
    line-height: 1;
}

.stat-label {
    color: var(--muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* App Link and Icon */
.app-link {
    display: inline-flex;
    align-items: center;
    margin-left: 0.75rem;
    color: var(--brand);
    text-decoration: none;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.app-link:hover {
    color: var(--brand-2);
    opacity: 1;
    transform: translateY(-1px);
}

.app-icon {
    transition: transform 0.2s ease;
}

.app-link:hover .app-icon {
    transform: translateX(2px);
}

/* App Images */
.app-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Implementation Details */
.implementation {
    margin-top: 2rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .implementation {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.implementation summary {
    padding: 1.5rem;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.implementation ul {
    padding: 1.5rem;
    margin: 0;
}

.implementation li {
    margin-bottom: 0.5rem;
}

/* Chart Container */
.chart-container {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .chart-container {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart {
    min-height: 260px;
    border: 2px dashed var(--muted);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    position: relative;
    padding: 1rem;
}

.chart svg,
.chart img {
    width: 100%;
    height: auto;
    max-width: 100%;
}

.chart .no-data {
    color: var(--muted);
    text-align: center;
    padding: 2rem;
}

/* Themes */
.themes {
    margin-top: 3rem;
}

.themes-section {
    margin-bottom: 2rem;
}

.themes-section h4 {
    color: var(--brand);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.themes ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.themes li {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.themes li:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .themes li {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.themes .quote {
    font-style: italic;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.themes .author {
    font-size: 0.875rem;
    color: var(--muted);
    font-weight: 500;
}

/* Contact Form */
.contact-info,
.contact-form {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .contact-info,
[data-theme="dark"] .contact-form {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--muted);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
}

.form-note {
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 1rem;
}

/* References */
.references {
    list-style: none;
    padding: 0;
    margin: 0;
}

.references li {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.6;
}

.references li:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .references li {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.references li em {
    color: var(--brand);
    font-style: normal;
    font-weight: 500;
}

.references li a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

.references li a:hover {
    color: var(--brand-2);
    text-decoration: underline;
}

/* Footer */
.footer {
    background: var(--panel);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    margin: 0;
    color: var(--muted);
}

/* Back to Top Button */
.to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand);
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s ease;
    z-index: 1000;
}

.to-top:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.to-top.visible {
    display: flex;
}

/* Scroll Margins for Fixed Nav */
#abstract,
#about,
#study,
#results,
#discussion,
#conclusion,
#app,
#acknowledgments,
#downloads,
#references {
    scroll-margin-top: calc(var(--nav-height) + 2rem);
}

/* Links */
a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Results Summary */
.results-summary {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .results-summary {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.results-summary p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 0;
}

.results-cta {
    margin-top: 2rem;
    text-align: center;
}

/* Usage Breakdown */
.usage-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.usage-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--panel);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .usage-item {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.usage-count {
    background: var(--brand);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 2rem;
    text-align: center;
}

.usage-label {
    color: var(--text);
    font-size: 0.95rem;
}

/* Study Design Section Spacing */
.study-section {
    margin-bottom: 3rem;
}

.study-section:last-child {
    margin-bottom: 0;
}

/* Measures Section */
.measures {
    margin-top: 2rem;
    text-align: center;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .hero {
        padding: calc(var(--nav-height) + 1rem) 0 60px;
    }
    
    .card,
    .stat-tile,
    .chart-container,
    .contact-info,
    .contact-form {
        padding: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .to-top {
        bottom: 1rem;
        right: 1rem;
    }
}

/* Print Styles */
@media print {
    .nav,
    .to-top,
    .hero-buttons {
        display: none;
    }
    
    .hero {
        padding-top: 2rem;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card,
    .stat-tile,
    .chart-container {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* Offset anchored sections below sticky nav */
section { scroll-margin-top: 80px; }

/* Team Subsection */
.team-subsection {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .team-subsection {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.team-subsection h3 {
    margin-bottom: 2rem;
    text-align: center;
}

/* Team Section */
.team-member {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-member:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .team-member {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.member-photo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.member-photo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--brand);
    box-shadow: var(--shadow);
}

.member-info h3 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.member-title {
    text-align: center;
    color: var(--brand);
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.member-affiliation {
    text-align: center;
    color: var(--muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.member-bio {
    text-align: left;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.member-expertise {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.expertise-tag {
    background: var(--panel);
    color: var(--brand);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--brand);
    transition: all 0.2s ease;
}

.expertise-tag:hover {
    background: var(--brand);
    color: white;
}

@media (max-width: 768px) {
    .team-member {
        padding: 1.5rem;
    }
    
    .member-photo img {
        width: 100px;
        height: 100px;
    }
    
    .member-expertise {
        justify-content: flex-start;
    }
}

/* Metrics Details Styles */
.metrics-details {
    margin-top: 2rem;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.metric-item:hover::before {
    left: 100%;
}

.metric-item:hover {
    background: var(--panel-alt);
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand);
}

.metric-item:active {
    transform: translateX(4px) scale(0.98);
}

[data-theme="dark"] .metric-item {
    background: var(--panel-alt);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .metric-item:hover {
    background: var(--panel);
    border-color: var(--brand);
}

.metric-label {
    font-weight: 600;
    color: var(--text);
    min-width: 200px;
    transition: color 0.2s ease;
}

.metric-item:hover .metric-label {
    color: var(--brand);
}

.metric-value {
    font-weight: 700;
    color: var(--brand);
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.metric-item:hover .metric-value {
    transform: scale(1.05);
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.metric-note {
    color: var(--muted);
    font-size: 0.9rem;
    font-style: italic;
    transition: color 0.2s ease;
}

.metric-item:hover .metric-note {
    color: var(--text);
}

/* Student Grid Styles */
.student-grid {
    display: grid;
    gap: 0.75rem;
}

.student-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.student-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.student-item:hover::before {
    left: 100%;
}

.student-item:hover {
    background: var(--panel-alt);
    transform: translateX(8px) translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand);
}

.student-item:active {
    transform: translateX(4px) translateY(-1px) scale(0.98);
}

[data-theme="dark"] .student-item {
    background: var(--panel-alt);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .student-item:hover {
    background: var(--panel);
    border-color: var(--brand);
}

.student-id {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--brand);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.student-item:hover .student-id {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.student-stats {
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.student-item:hover .student-stats {
    color: var(--brand);
    font-weight: 500;
}

/* Add focus styles for accessibility */
.metric-item:focus,
.student-item:focus {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Add selection styles */
.metric-item.selected,
.student-item.selected {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.metric-item.selected .metric-label,
.metric-item.selected .metric-value,
.metric-item.selected .metric-note,
.student-item.selected .student-stats {
    color: white;
}

.student-item.selected .student-id {
    background: white;
    color: var(--brand);
}

/* Qualitative Themes Interactive Styles */
.themes-section li {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--card);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow);
}

.themes-section li::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.themes-section li:hover::before {
    left: 100%;
}

.themes-section li:hover {
    background: var(--panel-alt);
    transform: translateX(8px) translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand);
}

.themes-section li:active {
    transform: translateX(4px) translateY(-1px) scale(0.98);
}

[data-theme="dark"] .themes-section li {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .themes-section li:hover {
    background: var(--panel-alt);
    border-color: var(--brand);
}

.themes-section li .quote {
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.themes-section li:hover .quote {
    color: var(--brand);
    font-weight: 500;
}

.themes-section li .author {
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.themes-section li:hover .author {
    color: var(--text);
}

/* Downloads Section Interactive Styles */
.download-card {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.download-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.download-card:hover::before {
    left: 100%;
}

.download-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand);
}

.download-card:active {
    transform: translateY(-4px) scale(0.98);
}

[data-theme="dark"] .download-card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .download-card:hover {
    border-color: var(--brand);
}

.download-card h3 {
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.download-card:hover h3 {
    color: var(--brand);
}

.download-card p {
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

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

/* Focus and Selection Styles for Themes and Downloads */
.themes-section li:focus,
.download-card:focus {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.themes-section li.selected,
.download-card.selected {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.themes-section li.selected .quote,
.themes-section li.selected .author,
.download-card.selected h3,
.download-card.selected p {
    color: white;
}

/* Add download icon animation */
.download-card::after {
    content: '⬇️';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.2rem;
    opacity: 0;
    transition: all 0.3s ease;
    transform: translateY(-10px);
}

.download-card:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* Add quote icon for themes */
.themes-section li::after {
    content: '"';
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--brand);
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(0.5);
}

.themes-section li:hover::after {
    opacity: 0.3;
    transform: scale(1);
}

/* Study Design Interactive Styles */
.stat-tile {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    transform: scale(0.9);
}

.stat-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.stat-tile:hover::before {
    left: 100%;
}

.stat-tile:hover {
    background: var(--panel-alt);
    transform: scale(0.95) translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand);
}

.stat-tile:active {
    transform: scale(0.93) translateY(-2px);
}

[data-theme="dark"] .stat-tile {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .stat-tile:hover {
    background: var(--panel);
    border-color: var(--brand);
}

.stat-number {
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.stat-tile:hover .stat-number {
    color: var(--brand);
    transform: scale(1.1);
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.stat-label {
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.stat-tile:hover .stat-label {
    color: var(--text);
    font-weight: 500;
}

/* Study Section Cards Interactive Styles */
.study-section .card {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transform: scale(0.95);
}

.study-section .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.study-section .card:hover::before {
    left: 100%;
}

.study-section .card:hover {
    background: var(--panel-alt);
    transform: scale(1) translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand);
}

.study-section .card:active {
    transform: scale(0.98) translateY(-2px);
}

[data-theme="dark"] .study-section .card {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .study-section .card:hover {
    background: var(--panel);
    border-color: var(--brand);
}

.study-section .card h3 {
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.study-section .card:hover h3 {
    color: var(--brand);
}

.study-section .card p,
.study-section .card ul,
.study-section .card ol {
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.study-section .card:hover p,
.study-section .card:hover ul,
.study-section .card:hover ol {
    color: var(--text);
}

/* Usage Breakdown Interactive Styles */
.usage-breakdown {
    display: grid;
    gap: 0.75rem;
}

.usage-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.usage-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.usage-item:hover::before {
    left: 100%;
}

.usage-item:hover {
    background: var(--panel-alt);
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand);
}

.usage-item:active {
    transform: translateX(4px) scale(0.98);
}

[data-theme="dark"] .usage-item {
    background: var(--panel-alt);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .usage-item:hover {
    background: var(--panel);
    border-color: var(--brand);
}

.usage-count {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    background: var(--brand) !important;
    color: white !important;
    border-radius: 50% !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    z-index: 1 !important;
    flex-shrink: 0 !important;
    min-width: 32px !important;
    min-height: 32px !important;
}

.usage-item:hover .usage-count {
    transform: scale(1.1) rotate(5deg) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

.usage-label {
    color: var(--text);
    font-size: 0.95rem;
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.usage-item:hover .usage-label {
    color: var(--brand);
    font-weight: 500;
}

/* Focus and Selection Styles for Study Design */
.stat-tile:focus,
.study-section .card:focus,
.usage-item:focus {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.stat-tile.selected,
.study-section .card.selected,
.usage-item.selected {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.stat-tile.selected .stat-number,
.stat-tile.selected .stat-label,
.study-section .card.selected h3,
.study-section .card.selected p,
.study-section .card.selected ul,
.study-section .card.selected ol,
.usage-item.selected .usage-count,
.usage-item.selected .usage-label {
    color: white;
}

/* Add icon animations for study design elements */
.stat-tile::after {
    content: '📊';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(0.5);
}

.stat-tile:hover::after {
    opacity: 0.3;
    transform: scale(1);
}

.study-section .card::after {
    content: '📋';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(0.5);
}

.study-section .card:hover::after {
    opacity: 0.3;
    transform: scale(1);
}

.usage-item::after {
    content: '👥';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(0.5);
}

.usage-item:hover::after {
    opacity: 0.3;
    transform: scale(1);
}

/* Measures Grid Styles */
.measures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.measure-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.measure-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .measure-item {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.measure-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .measure-icon {
    background: var(--panel-alt);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.measure-content {
    width: 100%;
}

.measure-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.measure-content p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .metrics-details .grid.two {
        grid-template-columns: 1fr;
    }
    
    .metric-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .metric-label {
        min-width: auto;
    }
    
    .measures-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .measure-item {
        padding: 1rem;
    }
    
    .student-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Section Header Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    margin: 0;
}

.section-header .btn {
    margin: 0;
}

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-header .btn {
        align-self: flex-end;
    }
}

/* Result Tiles */
.result-tile {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-height: 400px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

[data-theme="dark"] .result-tile {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-tile.alt {
    grid-template-columns: 1fr 1fr;
}

.result-tile.alt .result-copy {
    order: 2;
}

.result-tile.alt .result-chart {
    order: 1;
}

.result-copy h3 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.result-copy ul {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
    color: var(--text);
    line-height: 1.6;
}

.result-copy li {
    margin-bottom: 0.5rem;
}

.result-copy .caption {
    color: var(--muted);
    font-size: 0.875rem;
    font-style: italic;
    margin: 0;
}

.result-chart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    border: 2px dashed var(--muted);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    background: var(--panel);
    cursor: pointer;
}

.result-chart:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand);
}

.result-chart img {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.result-chart:hover img {
    transform: scale(1.02);
}





/* Themes Count Tile */
.themes-count {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.theme-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--panel);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .theme-item {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-icon {
    width: 24px;
    height: 24px;
    background: var(--brand);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.theme-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text);
}

.theme-count {
    font-weight: 600;
    color: var(--brand);
    font-size: 0.875rem;
}

/* Responsive adjustments for result tiles */
@media (max-width: 768px) {
    .result-tile {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        min-height: auto;
        padding: 1.5rem;
    }
    
    .result-tile.alt .result-copy,
    .result-tile.alt .result-chart {
        order: unset;
    }
    
    .result-chart {
        min-height: 200px;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .modal-close {
        align-self: flex-end;
    }
}
