:root {
    --unmaterialized-gray: transparent;
    --materialized-blue: #4A90E2;
    --scanner-gray: #404040;
}

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

body {
    font-family: 'Ubuntu', sans-serif;
    color: #fff;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Hero Section */
.hero {
    background-color: #000;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Scroll Indicator */
.scroll-indicator {
    font-family: Montserrat, sans-serif;
    line-height: 1.6;
    color: rgb(51, 51, 51);
    box-sizing: border-box;
    margin: 0px;
    padding: 0px;
    position: absolute;
    top: calc(100vh - 70px); /* 100% of viewport height - indicator height (50px) - desired offset (20px) */
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border-width: 2px;
    border-style: solid;
    border-color: white;
    border-image: initial;
    border-radius: 15px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 1s ease-out;
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background-color: white;
    border-radius: 2px;
    animation: scrollWheel 2s ease-in-out infinite;
}

@keyframes scrollWheel {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 0.5;
        transform: translateX(-50%) translateY(20px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
}

.container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

.text-container {
    position: fixed;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

.word {
    position: fixed;
    left: 0;
    right: 0;
    margin: 0 auto;
    font-size: 8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    display: flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    pointer-events: auto;
    /* Opacity is now controlled by individual letter spans */
}

.word.fade-in {
    /* This class is no longer used for fade-in, but might be used elsewhere. */
    /* We leave it empty to avoid breaking other logic, but opacity is handled by .letter.lit */
    opacity: 1; /* Maintain existing behavior */
}

.word.reality {
    top: 20vh;
}

.word.promises {
    top: 65vh;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .text-container {
        gap: 4vh;
    }
    
    .word {
        font-size: 4rem;
        letter-spacing: 0.05em;
    }
    
    .word.reality {
        top: 30vh;
    }
    
    .word.promises {
        top: 60vh;
    }
}

@media (max-width: 480px) {
    .text-container {
        gap: 3vh;
    }
    
    .word {
        font-size: 3rem;
        letter-spacing: 0.03em;
    }
    
    .word.reality {
        top: 35vh;
    }
    
    .word.promises {
        top: 55vh;
    }
}

@media (max-width: 320px) {
    .text-container {
        gap: 2vh;
    }
    
    .word {
        font-size: 2.5rem;
        letter-spacing: 0.02em;
    }
}

/* Scroll indicator responsive adjustments */
@media (max-width: 768px) {
    .scroll-indicator {
        bottom: 15px;
        width: 25px;
        height: 40px;
    }
    
    .scroll-indicator::before {
        width: 3px;
        height: 6px;
        top: 6px;
    }
}

@media (max-width: 480px) {
    .scroll-indicator {
        bottom: 10px;
        width: 20px;
        height: 35px;
    }
    
    .scroll-indicator::before {
        width: 2px;
        height: 5px;
        top: 5px;
    }
}

.letter {
    display: inline-block;
    position: relative;
    opacity: 0; /* Start invisible */
    transition: opacity 0.4s ease-out;
}

.letter.lit {
    opacity: 1;
}

.i-letter {
    position: relative;
    overflow: hidden;
}

/* Base styles for both i letters */
.i-letter {
    color: var(--unmaterialized-gray);
    position: relative;
}

.i-letter::before {
    content: 'i';
    position: absolute;
    top: 0;
    left: 0;
    color: var(--materialized-blue);
    /* Hide the blue layer by default. The animation logic will reveal it. */
    clip-path: inset(100% 0 0 0);
}

/* Make a specific letter blue from the start */
.i-letter.initially-materialized::before {
    clip-path: inset(0 0 0 0);
}

.i-letter::after {
    content: 'i';
    position: absolute;
    top: 0;
    left: 0;
    color: var(--scanner-gray);
    z-index: 3;
    clip-path: inset(0% 0 96% 0);
}

/* Materializing letter styles */
.i-letter.materializing::before {
    clip-path: inset(0 0 var(--clip-bottom, 100%) 0); /* Use custom property for dynamic clip-path */
}

.i-letter.materializing::after {
    animation: scannerMaterializing 1s ease-in-out infinite;
}

@keyframes scannerMaterializing {
    0%, 100% {
        clip-path: inset(var(--scan-start, 0%) 0 calc(100% - var(--scan-start, 0%) - 4%) 0);
    }
    50% {
        clip-path: inset(calc(var(--scan-end, 96%) - 4%) 0 calc(100% - var(--scan-end, 96%)) 0);
    }
}

/* Dematerializing letter styles */
.i-letter.dematerializing::before {
    clip-path: inset(var(--clip-top, 0%) 0 0 0); /* Use custom property for dynamic clip-path */
}

/* Fade out effect for completed dematerialization */
.i-letter.dematerializing.fade-out {
    opacity: var(--fade-opacity, 1);
    transition: opacity 1s ease-out;
}

.i-letter.dematerializing::after {
    clip-path: var(--scanner-clip, inset(96% 0 0% 0));
}

@keyframes scannerDematerializing {
    0%, 100% {
        clip-path: inset(var(--scan-start, 96%) 0 calc(100% - var(--scan-start, 96%) - 4%) 0);
    }
    50% {
        /* Oscillation should go up to the dematerialization border */
        clip-path: inset(calc(var(--scan-start, 96%) + var(--scan-range, 0%) - 4%) 0 calc(100% - var(--scan-start, 96%) - var(--scan-range, 0%)) 0);
    }
}

/* Additional glow effects */
.i-letter {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* --- Animated Swirling Grid Background --- */
#swirl-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    display: block;
    opacity: 0; /* Initially hidden */
    transition: opacity 1.5s ease-out;
}

#swirl-bg.visible {
    opacity: 1;
}

/* Content Sections */
.content-section {
    background: #000;
    color: #fff;
    padding: 80px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
}

/* Title Section Specific Styles */
.title-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.title-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: radial-gradient(450px circle at var(--mouse-x) var(--mouse-y), rgba(74, 144, 226, 0.15), transparent 80%);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 0; /* Position it behind the content */
    pointer-events: none;
}

.title-container:hover::before {
    opacity: 1;
}

.title-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4A90E2, transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.paper-title {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 30px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    position: relative;
}

.paper-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #4A90E2, #3498db);
    border-radius: 2px;
}

.authors {
    font-size: 1.4rem;
    font-weight: 500;
    color: #4A90E2;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.authors a {
    color: inherit;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.authors a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #4A90E2;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease-out;
}

.authors a:hover {
    color: #fff;
}

.authors a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.institution {
    font-size: 1.2rem;
    color: #bbb;
    margin-bottom: 15px;
    font-weight: 400;
}

.conference {
    font-size: 1.1rem;
    color: #999;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 30px;
}

/* Action Pills */
.action-pills {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: none;
}

.pill:hover::before {
    left: 100%;
    transition: left 0.6s ease;
}

.pill:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2), rgba(52, 152, 219, 0.2));
    border-color: rgba(74, 144, 226, 0.6);
    box-shadow: 
        0 8px 30px rgba(74, 144, 226, 0.4),
        0 0 0 1px rgba(74, 144, 226, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-3px) scale(1.02);
}

.pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(52, 152, 219, 0.1));
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(74, 144, 226, 0.3);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 20px rgba(74, 144, 226, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.pill:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.pill-icon {
    width: 20px;
    height: 20px;
    transition: all 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.pill:hover .pill-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(74, 144, 226, 0.4));
}

/* Special effects for different pill types */
.paper-pill {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(52, 152, 219, 0.1));
    border-color: rgba(74, 144, 226, 0.3);
}

.paper-pill:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2), rgba(52, 152, 219, 0.2));
    border-color: rgba(74, 144, 226, 0.6);
}

.video-pill {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(52, 152, 219, 0.1));
    border-color: rgba(74, 144, 226, 0.3);
}

.video-pill:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2), rgba(52, 152, 219, 0.2));
    border-color: rgba(74, 144, 226, 0.6);
    box-shadow: 
        0 8px 30px rgba(74, 144, 226, 0.4),
        0 0 0 1px rgba(74, 144, 226, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.video-pill:hover .pill-icon {
    filter: drop-shadow(0 4px 8px rgba(74, 144, 226, 0.4));
}

.content-section h2 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: #fff;
    position: relative;
}

.content-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #4A90E2, #3498db);
    border-radius: 2px;
}

.content-placeholder {
    max-width: 800px;
    margin: 0 auto;
}

.content-placeholder p {
    font-size: 1.2rem;
    color: #bbb;
    margin-bottom: 30px;
    line-height: 1.6;
}

.video-placeholder, .paper-placeholder {
    background: linear-gradient(135deg, #181a1b, #23272a);
    border-radius: 20px;
    padding: 60px 40px;
    border: 2px dashed #333;
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-placeholder:hover, .paper-placeholder:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: #4A90E2;
}

.play-button {
    font-size: 4rem;
    color: #4A90E2;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.video-placeholder:hover .play-button {
    transform: scale(1.1);
}

.document-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.paper-placeholder:hover .document-icon {
    transform: scale(1.1);
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding-bottom: 56.25%; /* Fixed 16:9 aspect ratio */
    height: 0; /* Important for padding-bottom trick */
    margin: 30px auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10;
    /* Reverted transform properties */
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
    clip-path: inset(0 0 100% 0); /* Initially hidden from bottom */
    transition: clip-path 0.1s ease-out; /* Animate clip-path */
    will-change: clip-path; /* Hint to browser for optimization */
}

.video-placeholder p, .paper-placeholder p {
    font-size: 1.1rem;
    color: #e0e6ed;
    font-weight: 500;
    margin: 0;
}

/* Responsive adjustments for content sections */
@media (max-width: 768px) {
    .content-section {
        padding: 60px 0;
    }
    
    .section-container {
        padding: 0 20px;
    }
    
    .title-container {
        padding: 40px 25px;
        margin: 0 10px;
    }
    
    .paper-title {
        font-size: 2rem;
        line-height: 1.4;
        margin-bottom: 25px;
    }
    
    .authors {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .institution {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .conference {
        font-size: 0.95rem;
        padding: 12px 20px;
        margin-bottom: 20px;
    }
    
    .action-pills {
        gap: 15px;
        margin-top: 15px;
        flex-wrap: wrap;
    }
    
    .pill {
        padding: 12px 24px;
        font-size: 1rem;
        border-radius: 40px;
    }
    
    .pill-icon {
        width: 18px;
        height: 18px;
    }
    
    .content-section h2 {
        font-size: 2.5rem;
        margin-bottom: 30px;
    }
    
    .content-placeholder p {
        font-size: 1rem;
    }
    
    .video-placeholder, .paper-placeholder {
        padding: 40px 20px;
    }
    
    .play-button, .document-icon {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .content-section {
        padding: 40px 0;
    }
    
    .title-container {
        padding: 30px 20px;
        margin: 0 5px;
    }
    
    .paper-title {
        font-size: 1.6rem;
        line-height: 1.5;
        margin-bottom: 20px;
    }
    
    .authors {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .institution {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .conference {
        font-size: 0.85rem;
        padding: 10px 16px;
        margin-bottom: 20px;
    }
    
    .action-pills {
        gap: 15px;
        margin-top: 15px;
        flex-wrap: wrap;
    }
    
    .pill {
        padding: 12px 24px;
        font-size: 1rem;
        border-radius: 40px;
    }
    
    .pill-icon {
        width: 18px;
        height: 18px;
    }
    
    .content-section h2 {
        font-size: 2rem;
        margin-bottom: 25px;
    }
    
    .video-placeholder, .paper-placeholder {
        padding: 30px 15px;
    }
    
    .play-button, .document-icon {
        font-size: 2.5rem;
    }
}

/* --- New Panel Styles for Paper Section --- */

#paper .section-container {
    max-width: 1200px; /* Adjust max-width for a wider single panel layout */
}

.single-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column; /* Stack the content rows vertically */
    gap: 30px; /* Reduced space between the two content rows */
    position: relative; /* Needed for the ::before pseudo-element */
    overflow: hidden; /* Ensures the radial gradient doesn't overflow */
}

.single-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: radial-gradient(350px circle at var(--mouse-x) var(--mouse-y), rgba(74, 144, 226, 0.15), transparent 80%);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 2; /* Position it above the content but below the text/video */
    pointer-events: none; /* Make sure it doesn't interfere with mouse events */
}

.single-panel:hover::before {
    opacity: 1;
}

.single-panel p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #ddd;
    text-align: left; /* Keep text left-aligned within its content area */
    margin-bottom: 0; /* Remove bottom margin */
    position: relative; /* Ensure text is on top of spotlight */
    z-index: 3; /* Ensure text is on top of the spotlight */
}

.content-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.content-row .video-wrapper {
    flex-basis: 48%;
    flex-shrink: 0;
    aspect-ratio: 16/9;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.content-row .text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.content-row .text-content h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.content-row .text-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #ddd;
    margin: 0;
}


@media (max-width: 488px) {
    .content-row {
        flex-direction: column;
        gap: 20px;
    }

    .content-row .video-wrapper {
        width: 100%;
    }

    .content-row .text-content {
        text-align: center;
    }
}

.panel-separator {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent); /* Whitish/silvery gradient */
    margin: 20px auto; /* Reduced vertical spacing and center the bar */
    width: 100%; /* Control the width of the bar */
    /* Removed max-width for full width */
}

/* Remove old panel styles */
/*
.panels-container {
    display: flex;
    flex-direction: column;
    gap: 60px;
    width: 100%;
}

.panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: radial-gradient(350px circle at var(--mouse-x) var(--mouse-y), rgba(74, 144, 226, 0.15), transparent 80%);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 2; /* Position it above the content but below the text/video */
    pointer-events: none; /* Make sure it doesn't interfere with mouse events */
}

.panel:hover::before {
    opacity: 1;
}

.video-wrapper {
    flex-basis: 48%;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    z-index: 3; /* Ensure video is on top of the spotlight */
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.panel p {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #ddd;
    text-align: left;
    position: relative; /* Position relative for z-index */
    z-index: 3; /* Ensure text is on top of the spotlight */
}