/* ================================================================
   NVIDIA SIL Research Area Template Styles
   
   This file contains all the styling for research area pages.
   PICs should NOT modify this file - instead, customize the 
   content sections in their main.html files.
   
   For customization guidance, see the template documentation.
================================================================ */

/* ========================================
   CSS Custom Properties (Design System)
======================================== */
:root {
    /* NVIDIA Brand Colors */
    --primary-color: #76b900;
    --primary-dark: #5a8c00;
    
    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #888;
    
    /* Background Colors */
    --background-primary: #ffffff;
    --background-secondary: #f8f9fa;
    --background-tertiary: #e9ecef;
    
    /* Border & Shadow System */
    --border-color: #e0e0e0;
    --border-light: #f1f3f4;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 4px 16px rgba(0, 0, 0, 0.2);
    
    /* Border Radius System */
    --border-radius-small: 6px;
    --border-radius-medium: 8px;
    --border-radius-large: 12px;
    
    /* Animation & Transitions */
    --transition-standard: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Typography */
    --font-family-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-mono: 'Courier New', monospace;
    
    /* Layout */
    --container-max-width: 1000px;
    --spacing-xs: 4px;
    --spacing-small: 8px;
    --spacing-medium: 15px;
    --spacing-large: 20px;
    --spacing-xl: 30px;
    --spacing-xxl: 40px;
}

/* ========================================
   Base Styles & Reset
======================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-primary);
    background-color: var(--background-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0 var(--spacing-large) 5px var(--spacing-large);
    line-height: 1.6;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
}

/* ========================================
   Typography System
======================================== */
h1 {
    text-align: center;
    margin-top: 0;
    margin-bottom: var(--spacing-small);
    color: var(--text-primary);
    font-weight: 700;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h2 {
    margin-top: var(--spacing-medium);
    margin-bottom: var(--spacing-small);
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-primary);
}

h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.3rem;
    line-height: 1.3;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-large);
    font-style: italic;
    line-height: 1.4;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-medium);
}

/* ========================================
   Link System
======================================== */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-standard);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Tight-underline style for inline text links inside body content.
   Uses a background-gradient pseudo-underline to position the line close
   to the text. Underline is always visible in the link's green color and
   deepens on hover. Excludes card/button/list-item wrappers. */
.content-section p a,
.content-section li a,
.contact-section a {
    text-decoration: none;
    background-image: linear-gradient(var(--primary-color), var(--primary-color));
    background-position: 0 calc(100% - 2px);
    background-repeat: no-repeat;
    background-size: 100% 2px;
    transition: color 0.2s ease, background-image 0.2s ease;
}

.content-section p a:hover,
.content-section li a:hover,
.contact-section a:hover {
    background-image: linear-gradient(var(--primary-dark), var(--primary-dark));
}

/* Opt-out: resource list items are whole-card clickable links */
.resources-list li a,
.resources-list li a:hover {
    background-image: none;
}

/* ========================================
   Navigation Components
======================================== */
.nav-back {
    margin: var(--spacing-xxl) 0 var(--spacing-large) 0;
    text-align: center;
}

.nav-back a {
    background-color: var(--background-secondary);
    padding: 10px var(--spacing-large);
    border-radius: var(--border-radius-small);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-small);
    transition: all var(--transition-standard);
    font-weight: 500;
}

.nav-back a:hover {
    background-color: var(--background-tertiary);
    text-decoration: none;
    transform: translateX(-2px);
}

.nav-back a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Non-clickable header used as a heading-style label inside research cards
   that don't have a single canonical link target (e.g. NuRec components,
   Human Motion "Human Motions from Video"). Visually matches a heading
   anchor but cannot be focused or activated. */
a.nonlink-anchor {
    color: var(--text-primary);
    pointer-events: none;
    cursor: default;
    text-decoration: none;
}

/* Pill button rows inside research cards. Used for compact rows of
   project links (Project Page / Paper / Code / Model / Benchmark, or
   per-tool deep-links like Warp.FEM / Simplicits / fVDB / NanoVDB).
   Two class names are aliased here for backward compatibility:
   - .resource-buttons / .resource-button (used on application pages)
   - .sdk-buttons / .sdk-button (used on research-area pages and the
     homepage; the homepage's main-layout.css mirrors these rules)
   Outlined style with healthy gap so adjacent buttons stay clearly
   delineated even when the row contains 4-6 same-color CTAs — filled
   pills with a tight gap visually merge into one continuous green bar.
   On hover each button becomes filled green with a slight lift. */
.resource-buttons,
.sdk-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
}

.resource-button,
.sdk-button {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    background-color: var(--background-primary);
    color: var(--primary-color);
    text-decoration: none;
    border: 1.5px solid var(--primary-color);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--transition-standard),
                color var(--transition-standard),
                border-color var(--transition-standard),
                transform var(--transition-standard),
                box-shadow var(--transition-standard);
}

.resource-button:hover,
.sdk-button:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(118, 185, 0, 0.25);
}

.resource-button:focus-visible,
.sdk-button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   Media Components
======================================== */
.hero-video {
    width: 100%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: var(--spacing-large) auto;
    display: block;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-heavy);
    object-fit: cover;
}

.column-video,
.column-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--border-radius-medium);
    margin-bottom: 2px;
    transition: transform var(--transition-standard);
}

.research-card:hover .column-video,
.research-card:hover .column-image {
    transform: scale(1.02);
}

/* ========================================
   Layout Components
======================================== */
.content-section {
    background-color: var(--background-secondary);
    border-radius: var(--border-radius-medium);
    padding: 25px;
    margin: var(--spacing-large) 0;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-light);
}

.three-column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin: var(--spacing-large) 0;
}

.research-card {
    background-color: var(--background-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-large);
    padding: var(--spacing-large);
    box-shadow: var(--shadow-light);
    transition: all var(--transition-standard);
    overflow: hidden;
}

.research-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.research-card h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-small);
}

.research-card p {
    margin-bottom: var(--spacing-medium);
}

/* ========================================
   Specialty Components
======================================== */
.highlight-box {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--background-primary);
    padding: var(--spacing-large);
    border-radius: var(--border-radius-medium);
    margin: var(--spacing-large) 0;
    text-align: center;
    box-shadow: var(--shadow-medium);
}

.highlight-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: inherit;
}

.highlight-box p {
    color: inherit;
    opacity: 0.95;
    margin-bottom: 0;
}

.highlight-box a {
    color: #fff;
    text-decoration: underline;
}

.highlight-box a:hover {
    opacity: 0.85;
}

.tag {
    background-color: var(--primary-color);
    color: var(--background-primary);
    padding: 4px var(--spacing-small);
    border-radius: var(--border-radius-large);
    font-size: 0.8rem;
    margin-right: var(--spacing-small);
    margin-bottom: var(--spacing-xs);
    display: inline-block;
    font-weight: 500;
    transition: background-color var(--transition-standard);
}

.tag:hover {
    background-color: var(--primary-dark);
}

.contact-section {
    margin-top: var(--spacing-medium);
    padding: var(--spacing-medium);
    background-color: var(--background-tertiary);
    border-radius: var(--border-radius-small);
    border-left: 4px solid var(--primary-color);
}

.contact-section strong {
    color: var(--text-primary);
}

.resources-list {
    list-style: disc;
    padding-left: var(--spacing-xl);
    margin: 0;
}

.resources-list li {
    margin-bottom: var(--spacing-medium);
    padding: var(--spacing-medium);
    background-color: var(--background-primary);
    border-radius: var(--border-radius-small);
    border: 1px solid var(--border-light);
    position: relative;
    transition: all var(--transition-standard);
}

.resources-list li:hover {
    box-shadow: var(--shadow-light);
    transform: translateX(4px);
}

.resources-list li::before {
    content: none;
}

.resources-list li a {
    display: block;
    padding-left: 0;
    font-weight: 500;
}

/* ========================================
   Responsive Design System
======================================== */
@media (max-width: 768px) {
    body {
        padding: 0 var(--spacing-medium) 5px var(--spacing-medium);
    }

    .three-column-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-large);
    }

    .content-section {
        padding: var(--spacing-large);
        margin: var(--spacing-medium) 0;
    }

    .research-card {
        padding: var(--spacing-medium);
    }

    .hero-video {
        margin: var(--spacing-medium) auto;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0 10px 5px 10px;
    }

    .content-section {
        padding: var(--spacing-medium);
    }

    .highlight-box {
        padding: var(--spacing-medium);
    }

    .nav-back a {
        padding: var(--spacing-small) var(--spacing-medium);
        font-size: 0.9rem;
    }
}

/* ========================================
   Accessibility & Performance
======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    /* Future: Dark mode support can be added here */
}

.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;
}

/* ========================================
   Print Styles
======================================== */
@media print {
    .nav-back,
    .hero-video,
    .column-video {
        display: none;
    }
    
    .research-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    a {
        color: var(--text-primary);
        text-decoration: underline;
    }
}

/* ========================================
   Utility Classes
======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-small { margin-bottom: var(--spacing-small); }
.mb-medium { margin-bottom: var(--spacing-medium); }
.mb-large { margin-bottom: var(--spacing-large); }

.mt-small { margin-top: var(--spacing-small); }
.mt-medium { margin-top: var(--spacing-medium); }
.mt-large { margin-top: var(--spacing-large); }

/* .visually-hidden removed — use .sr-only (defined above) instead */ 