/* ==========================================================================
   SARAH Project Website - Academic Modern Style
   ========================================================================== */

:root {
    /* Olive & wine — coolors.co/141204-262a10-70163c */
    --color-bg: #f5f3ee;
    --color-bg-alt: #eae6dd;
    --color-bg-card: #faf9f6;
    --color-text: #141204;
    --color-text-secondary: #3a3820;
    --color-text-muted: #6b6650;
    --color-text-subtle: #9a9480;
    
    /* Olive headings, vivid wine accent */
    --color-primary: #3d4418;
    --color-primary-light: #525a22;
    --color-accent: #9b1e52;
    --color-accent-light: #b82866;
    --color-link: #9b1e52;
    --color-link-hover: #b82866;
    
    /* Borders and shadows */
    --color-border: #d2ccc0;
    --color-border-light: #e4e0d6;
    --shadow-sm: 0 1px 3px rgba(20, 18, 4, 0.07);
    --shadow-md: 0 4px 12px rgba(20, 18, 4, 0.09);
    --shadow-lg: 0 8px 30px rgba(20, 18, 4, 0.11);
    
    /* Typography */
    --font-heading: 'IBM Plex Mono', 'Courier New', monospace;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-mono: 'IBM Plex Mono', 'Menlo', monospace;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 17px;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.bg-pattern {
    display: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: var(--color-primary);
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

img, video {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: 3rem 0;
}

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

.section-title {
    display: inline-block;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-primary);
    background:
        linear-gradient(to right, var(--color-accent) 2px, transparent 2px),
        repeating-linear-gradient(
            to right,
            transparent,
            transparent 1.2em,
            var(--color-border-light) 1.2em,
            var(--color-border-light) calc(1.2em + 1px)
        ),
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 1.5em,
            var(--color-border-light) 1.5em,
            var(--color-border-light) calc(1.5em + 1px)
        ),
        var(--color-bg-card);
    padding: 0.4em 0.8em 0.4em 1em;
    margin-bottom: 1.5rem;
    text-align: center;
    border: none;
    box-shadow: var(--shadow-sm);
}

.section > .container {
    text-align: center;
}

.section > .container > *:not(.section-title):not(.section-subtitle) {
    text-align: left;
}

.section-title::after {
    display: none;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.subsection-subtitle {
    text-align: left;
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.subsection-title {
    display: table;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
    color: var(--color-primary);
    background:
        linear-gradient(to right, var(--color-accent) 2px, transparent 2px),
        repeating-linear-gradient(
            to right,
            transparent,
            transparent 1.1em,
            var(--color-border-light) 1.1em,
            var(--color-border-light) calc(1.1em + 1px)
        ),
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 1.4em,
            var(--color-border-light) 1.4em,
            var(--color-border-light) calc(1.4em + 1px)
        ),
        var(--color-bg-card);
    padding: 0.35em 0.7em 0.35em 0.85em;
    border: none;
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-sm) 0;
    background: rgba(245, 243, 238, 0.75);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: all var(--transition-normal);
}

.nav.scrolled {
    border-bottom-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.nav a {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: var(--space-xs) var(--space-sm);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.nav a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: calc(var(--space-xl) + 40px) var(--space-md) var(--space-lg);
    text-align: center;
    background: linear-gradient(180deg, var(--color-bg-card) 0%, var(--color-bg) 100%);
}

.hero-content {
    max-width: 800px;
    margin-bottom: var(--space-lg);
}

.title {
    margin-bottom: var(--space-md);
}

.title-acronym {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.03em;
    animation: fadeIn 0.6s ease-out;
}

.title-full {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
    letter-spacing: 0.01em;
    animation: fadeIn 0.6s ease-out 0.1s backwards;
}

.tagline {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-bottom: var(--space-md);
    animation: fadeIn 0.6s ease-out 0.2s backwards;
}

.teaser-caption {
    max-width: 800px;
    margin: var(--space-sm) auto 0;
    text-align: left;
}

.teaser-title {
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.teaser-desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.authors {
    margin-bottom: var(--space-md);
    animation: fadeIn 0.6s ease-out 0.3s backwards;
}

.author-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-md);
    margin-bottom: var(--space-xs);
}

.author {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.05rem;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
}

.author-first {
    display: block;
}

.author-last {
    display: block;
    font-weight: 700;
}

a.author {
    color: var(--color-text);
    text-decoration: none;
}

a.author:hover {
    color: var(--color-link);
    text-decoration: none;
}

.author sup {
    color: var(--color-accent);
}

.affiliation {
    font-family: var(--font-heading);
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: var(--space-xs);
}

.affiliation-icon {
    display: inline-block;
    width: 1.6em;
    height: 1em;
    vertical-align: -0.15em;
    margin: 0 1.5em;
}

.venue {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-accent);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contribution-note {
    font-size: 0.85rem;
    color: var(--color-text-subtle);
    margin-top: var(--space-xs);
}

.hero-note {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: var(--space-md);
    letter-spacing: 0.03em;
}

/* Buttons */
.links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    animation: fadeIn 0.6s ease-out 0.4s backwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--color-primary-light);
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-bg-card);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-alt);
    border-color: var(--color-primary);
    color: var(--color-primary);
    text-decoration: none;
}

/* Teaser */
.teaser {
    width: 100%;
    max-width: 900px;
    animation: fadeIn 0.6s ease-out 0.5s backwards;
}

.teaser-video {
    aspect-ratio: 16 / 9;
}

/* Video Container */
.video-container {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: #000;
}

.video-container video {
    display: block;
    width: 100%;
    height: auto;
}

.video-container.teaser-video {
    cursor: pointer;
}

.video-container.teaser-video:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Video Placeholders
   ========================================================================== */

.video-placeholder {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.video-placeholder:hover {
    border-color: var(--color-text-subtle);
    box-shadow: var(--shadow-md);
}

.placeholder-content {
    text-align: center;
    padding: var(--space-md);
    color: var(--color-text-muted);
}

.placeholder-content svg {
    opacity: 0.35;
    margin-bottom: var(--space-sm);
    color: var(--color-text-secondary);
}

.placeholder-content span {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: var(--space-xs);
    color: var(--color-text-secondary);
}

.placeholder-content p {
    font-size: 0.9rem;
    color: var(--color-text-subtle);
    max-width: 360px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ==========================================================================
   Abstract
   ========================================================================== */

.abstract-content {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.05rem;
    text-align: justify;
    hyphens: auto;
    line-height: 1.65;
}

.abstract-content p {
    margin-bottom: 1rem;
}

.abstract-content p:first-child::first-letter {
    font-size: 3.5rem;
    float: left;
    line-height: 1;
    margin-right: 0.15em;
    margin-top: 0.05em;
    font-weight: 600;
    color: var(--color-primary);
}

.abstract-content em {
    font-style: italic;
}

.abstract-content strong {
    font-weight: 600;
    color: var(--color-primary);
}

/* ==========================================================================
   Demo Section
   ========================================================================== */

.demo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    max-width: 1000px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .demo-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
}

.demo-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.demo-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.demo-card .video-placeholder,
.demo-card .video-container {
    margin-bottom: var(--space-sm);
    aspect-ratio: 16 / 10;
}

.demo-card .video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.demo-card h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
    color: var(--color-primary);
}

.demo-card p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.6;
}

/* ==========================================================================
   Method Section
   ========================================================================== */

.method-overview {
    margin-bottom: 2rem;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.method-image-container {
    position: relative;
    border-radius: 8px;
}

.method-figure {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.method-figure.clickable-image {
    cursor: pointer;
}

.method-figure.clickable-image:hover {
    transform: scale(1.005);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Image highlight overlays */
.image-highlight {
    position: absolute;
    top: -2%;
    height: 104%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: transparent;
    box-shadow: inset 0 0 0 3px var(--color-primary);
}

.image-highlight[data-section="left"] {
    left: -1%;
    width: 26%;
}

.image-highlight[data-section="center"] {
    left: 26%;
    width: 48%;
}

.image-highlight[data-section="right"] {
    left: 76%;
    right: -1%;
    width: auto;
}

.image-highlight.active {
    opacity: 1;
    background: rgba(255,255,255,0.15);
}

/* Caption styling */
.method-caption {
    color: var(--color-text-secondary);
    max-width: 100%;
    margin: 0;
    padding: 1rem 0.5rem 0.5rem;
    font-size: 0.95rem;
    line-height: 1.65;
}

.caption-title {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--color-primary);
    font-size: 1rem;
}

.caption-title strong {
    font-weight: 600;
}

.caption-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.caption-section {
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(0,0,0,0.02);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: justify;
    font-size: 0.9rem;
}

.caption-section:hover,
.caption-section.active {
    background: rgba(45, 106, 79, 0.05);
    border-color: var(--color-primary);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.caption-section .section-label {
    display: block;
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.caption-footer {
    text-align: center;
    font-style: italic;
    color: var(--color-text-secondary);
    opacity: 0.8;
    font-size: 0.9rem;
    margin: 0;
}

@media (max-width: 768px) {
    .caption-sections {
        grid-template-columns: 1fr;
    }
}

.components-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

@media (max-width: 700px) {
    .components-grid {
        grid-template-columns: 1fr;
    }
}

.component-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.component-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.component-card:nth-child(2) { transition-delay: 0.05s; }
.component-card:nth-child(3) { transition-delay: 0.1s; }
.component-card:nth-child(4) { transition-delay: 0.15s; }

.component-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-sm);
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
}

.component-icon svg {
    color: var(--color-primary);
    width: 24px;
    height: 24px;
}

.component-card h3 {
    font-size: 1.05rem;
    margin-bottom: var(--space-xs);
    color: var(--color-primary);
}

.component-card p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.6;
}

.component-figure {
    width: 100%;
    height: auto;
    margin-top: 1rem;
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.component-figure:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Gaze Section */
.gaze-section {
    margin-top: 1.5rem;
}

.gaze-figure {
    aspect-ratio: 16 / 9;
    max-width: 800px;
    margin: 0 auto 0.75rem;
}

.gaze-figure video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.figure-caption {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    max-width: 640px;
    margin: 0 auto;
    font-style: italic;
    line-height: 1.5;
}

/* ==========================================================================
   Results Section
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

@media (max-width: 700px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.4s ease;
}

.stat-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-card:nth-child(2) { transition-delay: 0.05s; }
.stat-card:nth-child(3) { transition-delay: 0.1s; }
.stat-card:nth-child(4) { transition-delay: 0.15s; }

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.1;
}

.stat-label {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 4px 0;
}

.stat-desc {
    font-size: 0.8rem;
    color: var(--color-text-subtle);
}

.results-comparison {
    margin-bottom: var(--space-lg);
}

.results-figure {
    aspect-ratio: 16 / 9;
    max-width: 800px;
    margin: 0 auto 0.75rem;
}

.results-figure video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Results Grid (2x2 for qualitative results) */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 700px) {
    .results-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
}

/* Results Table - Academic Style */
.results-table-wrapper {
    overflow-x: auto;
    margin-top: var(--space-lg);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    background: var(--color-bg-card);
    box-shadow: var(--shadow-sm);
}

.results-table th,
.results-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid var(--color-border-light);
}

.results-table thead {
    border-bottom: 2px solid var(--color-primary);
}

.results-table th {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.85rem;
    background: var(--color-bg-alt);
}

.results-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.results-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.results-table .row-gt {
    color: var(--color-text-subtle);
    font-style: italic;
    background: var(--color-bg);
}

.results-table .row-ours {
    background: rgba(44, 62, 80, 0.06);
    font-weight: 600;
}

.results-table .row-ours td {
    color: var(--color-primary);
}

.results-table .row-ours td:first-child {
    border-left: 3px solid var(--color-accent);
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

@media (max-width: 700px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gallery-item {
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.4s ease;
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item:nth-child(2) { transition-delay: 0.05s; }
.gallery-item:nth-child(3) { transition-delay: 0.1s; }
.gallery-item:nth-child(4) { transition-delay: 0.15s; }

.gallery-item .video-placeholder,
.gallery-item .video-container {
    aspect-ratio: 4 / 3;
}

.gallery-item .video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   BibTeX
   ========================================================================== */

.bibtex-wrapper {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.bibtex-wrapper pre {
    margin: 0;
    padding: var(--space-md);
    overflow-x: auto;
    background: var(--color-bg-alt);
}

.bibtex-wrapper code {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.copy-btn {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--color-bg);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* ==========================================================================
   Acknowledgements
   ========================================================================== */

.acknowledgements-text {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    color: var(--color-text-muted);
    font-style: italic;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    padding: var(--space-md) 0;
    text-align: center;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg-alt);
}

.footer p {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--color-text-subtle);
    margin: 0;
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    .container {
        padding: 0 var(--space-sm);
    }
    
    .nav ul {
        gap: var(--space-xs);
    }
    
    .nav a {
        font-size: 0.8rem;
        padding: 4px 6px;
    }
    
    .section {
        padding: var(--space-md) 0;
    }
    
    .hero {
        min-height: auto;
        padding: calc(var(--space-lg) + 40px) var(--space-sm) var(--space-md);
    }

    .hero-content {
        margin-bottom: var(--space-md);
    }
    
    .links {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
    }
    
    .abstract-content {
        text-align: left;
        font-size: 1rem;
    }
    
    .abstract-content p:first-child::first-letter {
        font-size: 2.5rem;
    }

    .teaser {
        max-width: 100%;
    }

    .teaser-caption {
        max-width: 100%;
    }

    .method-overview {
        padding: 0.75rem;
    }

    .theater-overlay {
        padding: var(--space-sm);
    }

    .theater-inner {
        max-width: 95vw;
    }

    .theater-content video {
        max-width: 95vw;
        max-height: 60vh;
    }

    .theater-image {
        max-width: 95vw;
        max-height: 60vh;
    }

    .theater-close {
        top: var(--space-sm);
        right: var(--space-sm);
        width: 40px;
        height: 40px;
    }

    .theater-nav {
        width: 40px;
        height: 40px;
    }

    .theater-nav-next {
        right: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .nav {
        padding: 6px 0;
    }

    .nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px 4px;
    }

    .nav a {
        font-size: 0.75rem;
        padding: 4px 5px;
    }

    .hero {
        padding: calc(var(--space-md) + 44px) 0.75rem var(--space-sm);
    }

    .title-acronym {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .title-full {
        font-size: clamp(0.9rem, 3vw, 1.2rem);
    }
    
    .author-row {
        gap: var(--space-xs);
    }

    .author {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.15rem;
    }

    .subsection-title {
        font-size: 0.95rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
    }

    .bibtex-wrapper pre {
        padding: var(--space-sm);
    }

    .bibtex-wrapper code {
        font-size: 0.7rem;
    }
}

/* ==========================================================================
   Carousel
   ========================================================================== */

.carousel {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 60px;
    overflow-x: hidden;
    overflow-y: visible;
    padding-bottom: var(--space-sm);
}

.carousel-track {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.carousel-slide {
    position: absolute;
    left: 50%;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    border-radius: 0;
    overflow: hidden;
    /* Separate transitions for smooth movement */
    transition: 
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s ease;
}

.carousel-slide .video-container {
    width: 400px;
    aspect-ratio: 16 / 9;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    background: #000;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide .video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Active slide - center and large */
.carousel-slide.active {
    opacity: 1;
    transform: translateX(-50%) translateZ(0) scale(1);
    z-index: 3;
    pointer-events: auto;
    border-radius: 0;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.carousel-slide.active .video-container {
    width: 640px;
}

/* Previous slide - left side */
.carousel-slide.prev {
    opacity: 0.85;
    transform: translateX(calc(-50% - 380px)) translateY(30px) translateZ(0) scale(0.75);
    z-index: 2;
    pointer-events: auto;
    border-radius: 0;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Next slide - right side */
.carousel-slide.next {
    opacity: 0.85;
    transform: translateX(calc(-50% + 380px)) translateY(30px) translateZ(0) scale(0.75);
    z-index: 2;
    pointer-events: auto;
    border-radius: 0;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.carousel-slide.prev:hover,
.carousel-slide.next:hover {
    opacity: 1;
}

/* Hidden slides - far left/right for entrance animation */
.carousel-slide.hidden-left {
    opacity: 0;
    transform: translateX(calc(-50% - 600px)) translateZ(0) scale(0.6);
    pointer-events: none;
}

.carousel-slide.hidden-right {
    opacity: 0;
    transform: translateX(calc(-50% + 600px)) translateZ(0) scale(0.6);
    pointer-events: none;
}

.carousel-slide.hidden {
    opacity: 0;
    transform: translateX(-50%) translateZ(0) scale(0.5);
    pointer-events: none;
}

/* Navigation buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.carousel-btn-prev {
    display: none;
}

.carousel-btn:hover {
    background: var(--color-bg-alt);
    color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.carousel-btn-prev {
    left: 0;
}

.carousel-btn-next {
    right: 0;
}

/* Caption */
.carousel-caption {
    text-align: left;
    margin-top: 0.75rem;
    padding: 0;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.carousel-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.2rem;
}

.carousel-desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0;
    line-height: 1.5;
}

/* Dots */
.counter-current {
    font-weight: 600;
}

.counter-total {
    font-size: 0.7em;
    opacity: 0.7;
    font-weight: 400;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1.25rem;
    position: relative;
    z-index: 5;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-border);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.carousel-dot:hover {
    background: var(--color-text-subtle);
}

.carousel-dot.active {
    background: var(--color-primary);
    transform: scale(1.2);
}

/* Responsive */
@media (max-width: 900px) {
    .carousel {
        padding: 0 50px;
    }
    
    .carousel-track {
        min-height: 320px;
    }
    
    .carousel-slide .video-container {
        width: 340px;
    }

    .carousel-slide.active .video-container {
        width: 500px;
    }
    
    .carousel-slide.prev {
        transform: translateX(calc(-50% - 240px)) translateY(25px) translateZ(0) scale(0.7);
    }
    
    .carousel-slide.next {
        transform: translateX(calc(-50% + 240px)) translateY(25px) translateZ(0) scale(0.7);
    }
    
    .carousel-slide.hidden-left {
        transform: translateX(calc(-50% - 400px)) translateY(30px) translateZ(0) scale(0.6);
    }
    
    .carousel-slide.hidden-right {
        transform: translateX(calc(-50% + 400px)) translateY(30px) translateZ(0) scale(0.6);
    }
}

@media (max-width: 700px) {
    .carousel {
        padding: 0 40px;
        overflow-y: hidden;
    }
    
    .carousel-track {
        min-height: auto;
    }

    .carousel-slide {
        position: relative;
        left: auto;
        display: none;
    }

    .carousel-slide.active {
        display: block;
        transform: none;
    }

    .carousel-slide .video-container,
    .carousel-slide.active .video-container {
        width: 100%;
    }

    .carousel-slide.prev,
    .carousel-slide.next,
    .carousel-slide.hidden-left,
    .carousel-slide.hidden-right {
        display: none;
    }

    .carousel-caption {
        max-width: 100%;
    }
    
    .carousel-btn {
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================================
   Theater Mode (Lightbox)
   ========================================================================== */

.theater-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 10, 15, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.theater-overlay.active {
    opacity: 1;
    visibility: visible;
}

.theater-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}

.theater-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.theater-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.theater-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.theater-nav-next {
    right: var(--space-md);
}

.theater-nav:hover {
    background: var(--color-bg-alt);
    color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-50%) scale(1.05);
}

.theater-nav:focus {
    outline: 2px solid rgba(255, 255, 255, 0.55);
    outline-offset: 2px;
}

.theater-inner {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    max-width: 75vw;
    max-height: 85vh;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.theater-overlay.active .theater-inner {
    transform: scale(1);
}

.theater-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.theater-content video {
    max-width: 75vw;
    max-height: 65vh;
    width: auto;
    height: auto;
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background: transparent;
}

.theater-image {
    max-width: 75vw;
    max-height: 65vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.theater-placeholder {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.theater-placeholder svg {
    opacity: 0.4;
    margin-bottom: var(--space-md);
    color: #fff;
}

.theater-placeholder span {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: var(--space-xs);
}

.theater-placeholder p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.theater-caption {
    margin-top: var(--space-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    width: 100%;
    font-style: italic;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.1s;
}

.theater-overlay.active .theater-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Add visual hint that placeholders are clickable */
.video-placeholder {
    cursor: pointer;
    position: relative;
}

.video-placeholder::after {
    content: 'Click to expand';
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-sm);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--color-text-subtle);
    background: var(--color-bg);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    opacity: 0;
    transform: translateY(4px);
    transition: all var(--transition-fast);
    pointer-events: none;
}

.video-placeholder:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.video-placeholder:focus {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .nav, .video-placeholder, .copy-btn {
        display: none;
    }
    
    body {
        font-size: 11pt;
        color: #000;
        background: #fff;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .section {
        padding: 1.5rem 0;
    }
}

