/* ============================================
   TritonDFT Website — AgentFlow-inspired Design
   ============================================ */

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #5b6abf;
    --primary-light: #7b8ed8;
    --primary-dark: #3d4a9e;
    --accent: #667eea;
    --accent2: #764ba2;
    --green: #27ae60;
    --red: #e74c3c;
    --text: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #888;
    --border: #e8e8e8;
    --bg: #ffffff;
    --bg-alt: #f7f8fc;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.25s ease;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    font-size: 16px;
    padding-top: 52px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
}

.main-container {
    width: 100%;
}

/* ============================================
   Navigation Bar — AgentFlow style
   ============================================ */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1001;
    height: 52px;
    display: flex;
    align-items: center;
}

.top-navbar .container {
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-items {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-items::-webkit-scrollbar { display: none; }

.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    flex-shrink: 0;
}

.nav-pill:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.nav-pill.active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.nav-dropdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    transition: all var(--transition);
    flex-shrink: 0;
}

.nav-dropdown:hover {
    color: var(--primary);
}

/* ============================================
   Table of Contents Sidebar
   ============================================ */
.toc-sidebar {
    position: fixed;
    right: 24px;
    top: 80px;
    width: 190px;
    z-index: 100;
}

.toc-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 14px;
    box-shadow: var(--shadow-sm);
}

.toc-content h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    color: var(--text-muted);
}

.toc-content nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-content nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 450;
    transition: all var(--transition);
    border-left: 2px solid transparent;
}

.toc-content nav a:hover {
    color: var(--primary);
    background: var(--bg-alt);
}

.toc-content nav a.active {
    color: var(--primary);
    background: rgba(91,106,191,0.08);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
    padding: 56px 0 48px;
    text-align: center;
}

.hero-header {
    margin-bottom: 24px;
}

.logo-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 14px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(102,126,234,0.35);
}

.logo-icon i {
    font-size: 36px;
    color: white;
}

.logo-text {
    font-size: 54px;
    font-weight: 300;
    color: var(--text);
    letter-spacing: -1px;
}

.subtitle {
    font-size: 28px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Authors */
.authors {
    margin: 24px 0 28px;
}

.author-names {
    font-size: 17px;
    margin-bottom: 6px;
    color: var(--text);
    line-height: 1.6;
}

.author-names sup {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

.affiliations {
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.affiliations sup {
    font-size: 11px;
    font-weight: 700;
    margin-right: 1px;
}

.author-notes {
    font-size: 13px;
    color: var(--text-muted);
}

.note-item {
    margin: 0 8px;
}

/* Action Buttons — AgentFlow dark pills */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 28px 0 40px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: var(--text);
    border: none;
    border-radius: 24px;
    color: #fff;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
    letter-spacing: 0.01em;
}

.action-btn:hover {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.action-btn i {
    font-size: 13px;
    opacity: 0.85;
}

/* Abstract / Performance Chart */
.abstract-text {
    max-width: 800px;
    margin: 0 auto 36px;
    font-size: 16px;
    line-height: 1.85;
    color: var(--text-secondary);
    text-align: left;
}

.hero-figure {
    margin: 10px auto 0;
    max-width: 100%;
}

.hero-figure img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.hero-figure .figure-caption {
    margin-top: 14px;
    text-align: center;
}

/* ============================================
   Content Sections
   ============================================ */
.content-section {
    padding: 64px 0;
}

.bg-light {
    background: var(--bg-alt);
}

.section-title {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 36px;
    color: var(--text);
    text-align: center;
    letter-spacing: -0.3px;
}

.subsection-title {
    font-size: 22px;
    font-weight: 600;
    margin: 40px 0 20px;
    color: var(--text);
}

/* ---- Introduction ---- */
.intro-content p {
    font-size: 16px;
    line-height: 1.85;
    margin-bottom: 18px;
    color: var(--text);
}

.highlight-box {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: white;
    padding: 28px 32px;
    border-radius: var(--radius);
    margin: 28px 0;
    text-align: center;
}

.highlight-box p {
    font-size: 17px;
    line-height: 1.7;
    margin: 0;
}

.key-points {
    list-style: none;
    padding-left: 0;
    margin: 18px 0;
}

.key-points li {
    padding: 10px 0 10px 28px;
    position: relative;
    font-size: 16px;
    line-height: 1.6;
}

.key-points li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 700;
    font-size: 17px;
}

/* ---- Figures ---- */
.figure-container {
    margin: 36px 0;
}

.figure-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    display: block;
}

.figure-caption {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-muted);
    text-align: left;
}

/* ---- Agent Cards ---- */
.agent-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 32px;
}

.agent-card {
    background: white;
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.agent-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.agent-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.agent-icon i {
    font-size: 24px;
    color: white;
}

.agent-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.agent-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ---- Two Column Layout ---- */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: start;
    margin-top: 32px;
}

.column-figure .figure-container {
    margin: 0;
}

.column-figure .figure-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.column-text h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.column-text p {
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 14px;
    color: var(--text);
}

.column-text ul {
    margin: 16px 0;
    padding-left: 18px;
}

.column-text ul li {
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
}

.info-box {
    background: var(--bg-alt);
    padding: 22px;
    border-radius: var(--radius-sm);
    margin-top: 22px;
    border-left: 3px solid var(--primary);
}

.info-box h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.info-box p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
}

/* ---- Benchmark Stats ---- */
.benchmark-intro {
    margin-bottom: 40px;
}

.lead {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.benchmark-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 40px 0;
}

.stat-box {
    text-align: center;
    padding: 36px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(102,126,234,0.3);
}

.stat-number {
    font-size: 44px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.stat-box p {
    font-size: 13px;
    opacity: 0.85;
}

/* Dimensions Grid */
.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 32px;
}

.dimension-box {
    background: white;
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    transition: all var(--transition);
}

.dimension-box:hover {
    box-shadow: var(--shadow-md);
}

.dim-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: var(--bg-alt);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dim-icon i {
    font-size: 26px;
    color: var(--primary);
}

.dimension-box h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.dimension-box p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ============================================
   Results — Tables
   ============================================ */
.results-intro {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-secondary);
    text-align: center;
    max-width: 760px;
    margin: 0 auto 32px;
}

.results-content {
    margin-bottom: 0;
}

.results-table-container {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.results-table thead {
    background: var(--bg-alt);
}

.results-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.results-table td {
    padding: 11px 14px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid #f0f0f0;
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.results-table tbody tr:hover {
    background: rgba(91,106,191,0.03);
}

.highlight-row {
    background: rgba(91,106,191,0.06) !important;
}

.best-row {
    background: rgba(39,174,96,0.06) !important;
}

.best-row td { font-weight: 600; }

.table-caption {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    text-align: left;
    padding: 0 4px;
}

/* Framework Comparison Table */
.framework-table th {
    font-size: 12px;
    padding: 10px 8px;
    line-height: 1.4;
}

.framework-table td {
    font-size: 13px;
    padding: 12px 8px;
    line-height: 1.5;
}

.results-table thead tr:first-child th[colspan] {
    font-weight: 700;
    font-size: 13px;
    text-align: center;
}

.results-table thead tr:nth-child(2) th {
    font-size: 12px;
    padding: 8px;
}

/* ---- Findings Grid ---- */
.findings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 32px;
}

.finding-box {
    background: white;
    padding: 26px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.finding-box:hover {
    box-shadow: var(--shadow-sm);
}

.finding-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.finding-box.success .finding-icon {
    background: rgba(39,174,96,0.1);
    color: var(--green);
}

.finding-box.info .finding-icon {
    background: rgba(91,106,191,0.1);
    color: var(--primary);
}

.finding-icon i { font-size: 20px; }

.finding-box h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.finding-box p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ============================================
   Demo Video
   ============================================ */
.demo-video-container {
    max-width: 780px;
    margin: 0 auto;
    overflow: hidden;
}

.demo-video {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    background: #000;
    display: block;
}

.demo-video:focus { outline: none; }

/* ============================================
   Share Section
   ============================================ */
.share-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 28px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all var(--transition);
}

.share-btn.twitter {
    background: #1da1f2;
    color: white;
}

.share-btn.twitter:hover {
    background: #0d8ddc;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(29,161,242,0.4);
}

.share-btn.linkedin {
    background: #0077b5;
    color: white;
}

.share-btn.linkedin:hover {
    background: #006399;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,119,181,0.4);
}

/* ============================================
   BibTeX
   ============================================ */
.bibtex-container {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    background: #1e1e2e;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-lg);
}

.copy-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-button:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.bibtex-container pre {
    margin: 0;
    overflow-x: auto;
}

.bibtex-container code {
    color: #cdd6f4;
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.8;
}

/* ============================================
   Footer — Multi-institution like AgentFlow
   ============================================ */
.footer {
    background: var(--bg-alt);
    padding: 48px 0 28px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: nowrap;
    margin-bottom: 24px;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 48px;
    flex-shrink: 0;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.footer-logo:hover {
    opacity: 1;
}

.footer-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* UCSD & LLNL logos — larger. Change width/height here to adjust size. */
.footer-logo-ucsd img {
    width: 200px;
    height: 120px;
}

.footer-logo-llnl img {
    padding-left: 50px;
    width: 240px;
    height: 110px;
}
@media (max-width: 768px) {
    .footer-logo-ucsd img {
        width: 200px;
        height: 48px;
    }
    .footer-logo-llnl img {
        width: 200px;
        height: 48px;
    }
}

.footer-note {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

.footer-note a {
    color: var(--primary);
    text-decoration: none;
}

.footer-note a:hover {
    text-decoration: underline;
}

@media (max-width: 560px) {
    .footer-logos {
        flex-wrap: wrap;
        justify-content: center;
        gap: 24px;
    }
    .footer-logo {
        width: 100px;
        height: 40px;
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
    .toc-sidebar { display: none; }
}

@media (max-width: 968px) {
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .column-figure .figure-image {
        max-width: 560px;
        margin: 0 auto;
    }

    .agent-cards,
    .dimensions-grid,
    .findings-grid {
        grid-template-columns: 1fr;
    }

    .benchmark-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body { padding-top: 48px; }

    .top-navbar { height: 48px; }

    .container { padding: 0 18px; }

    .logo-title-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .logo-icon {
        width: 56px;
        height: 56px;
    }

    .logo-icon i { font-size: 28px; }
    .logo-text { font-size: 38px; }
    .subtitle { font-size: 22px; }
    .section-title { font-size: 24px; }
    .subsection-title { font-size: 19px; }

    .action-buttons { gap: 8px; }

    .action-btn {
        padding: 7px 14px;
        font-size: 12.5px;
    }

    .results-table-container {
        max-width: 100%;
    }

    .results-table {
        min-width: 580px;
    }

    .framework-table {
        min-width: 860px;
    }

    .demo-video-container {
        max-width: 100%;
    }
    .demo-video {
        border-radius: var(--radius-sm);
    }
}

@media (max-width: 480px) {
    .hero-section { padding: 36px 0 40px; }
    .content-section { padding: 40px 0; }
    .stat-number { font-size: 36px; }
    .logo-text { font-size: 30px; }
    .subtitle { font-size: 19px; }
    .author-names { font-size: 15px; }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}
