@font-face {
    font-family: 'Blinker';
    src: url('https://static.igem.wiki/teams/5836/fonts/blinker/blinker-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Raleway';
    src: url('https://static.igem.wiki/teams/5836/fonts/raleway/raleway-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nixie One';
    src: url('') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fraunces';
    src: url('https://static.igem.wiki/teams/5836/fonts/fraunces/fraunces-72pt-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Dark blue background for the entire page */
body {
    background-color: #0b1320 !important;
}

/* Alternative: If the above doesn't work, target the page content wrapper */
#page_content {
    background-color: #0b1320 !important;
}

/* Also ensure the main container has the dark blue background */
.main-content,
.container-fluid,
main {
    background-color: #0b1320 !important;
}

/* Make sure the description hero section blends seamlessly */
.description-hero {
    background-color: #0b1320;
    min-height: 60vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible; /* Changed from hidden to visible to prevent hairpin clipping */
    margin: 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

/* Description Hero Section */
.description-hero {
    background-color: #0b1320;
    min-height: 60vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0;
    margin-top: -20px; /* Remove gap below navbar */
    padding-top: 20px; /* Add padding to maintain spacing */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.hairpin-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150vh; /* Extended height to prevent truncation */
    z-index: 10; /* Increased from 1 to ensure hairpins appear above main content */
    overflow: visible; /* Ensure hairpins aren't clipped */
    pointer-events: none; /* Allow interactions with content below */
}

.hairpin-image {
    width: 570px; /* 1.5 times larger than 380px */
    height: auto;
    opacity: 0.7;
    position: absolute;
    animation: circularDrift1 12s linear infinite;
}

.hairpin-container .hairpin-image:first-child {
    top: 25%; /* Adjusted for extended container - moved up from 40% */
    left: 15%;
    animation: circularDrift1 12s linear infinite;
}

.hairpin-container .hairpin-image:last-child {
    top: 20%; /* Adjusted for extended container - moved up from 35% */
    right: 15%;
    animation: circularDrift2 12s linear infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-15px); /* Reduced movement from -30px */
    }
}

@keyframes randomDrift {
    0% { 
        transform: translate(0px, 0px); 
    }
    25% { 
        transform: translate(8px, -12px); 
    }
    50% { 
        transform: translate(-10px, 5px); 
    }
    75% { 
        transform: translate(6px, 10px); 
    }
    100% { 
        transform: translate(0px, 0px); 
    }
}

@keyframes circularDrift1 {
    0% { 
        transform: translate(0px, 0px); 
    }
    12.5% { 
        transform: translate(30px, -25px); 
    }
    25% { 
        transform: translate(45px, 20px); 
    }
    37.5% { 
        transform: translate(25px, 50px); 
    }
    50% { 
        transform: translate(-15px, 55px); 
    }
    62.5% { 
        transform: translate(-45px, 30px); 
    }
    75% { 
        transform: translate(-50px, -20px); 
    }
    87.5% { 
        transform: translate(-25px, -45px); 
    }
    100% { 
        transform: translate(0px, 0px); 
    }
}

@keyframes circularDrift2 {
    0% { 
        transform: translate(0px, 0px); 
    }
    12.5% { 
        transform: translate(-35px, 25px); 
    }
    25% { 
        transform: translate(-55px, -18px); 
    }
    37.5% { 
        transform: translate(-40px, -50px); 
    }
    50% { 
        transform: translate(12px, -60px); 
    }
    62.5% { 
        transform: translate(50px, -35px); 
    }
    75% { 
        transform: translate(60px, 25px); 
    }
    87.5% { 
        transform: translate(30px, 55px); 
    }
    100% { 
        transform: translate(0px, 0px); 
    }
}

.hero-content {
    z-index: 2; /* Match attributions z-index */
    text-align: center;
    position: relative;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 8rem);
    font-weight: bold;
    color: #d7af6b;
    margin: 0;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
    letter-spacing: 0.05em;
    font-family: 'Fraunces', serif;
    line-height: 1.1;
    text-align: center;
    display: block;
}



/* Section Navigation - same as inclusivity */
.section-navigation {
    position: fixed;
    top: 100px;
    left: 20px;
    background: rgba(11, 19, 32, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(215, 175, 107, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 180px; /* Reduced from 200px */
    max-width: 250px; /* Reduced from 300px */
    transition: all 0.3s ease;
    transform: scale(0.75); /* Reduced from 0.9 to 75% of original size */
    transform-origin: top left; /* Keep it anchored to the top-left corner */
}

.navigation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(215, 175, 107, 0.2);
    cursor: pointer;
}

.navigation-title {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #d7af6b;
    letter-spacing: 0.5px;
}

.navigation-toggle {
    background: none;
    border: none;
    color: #d7af6b;
    cursor: pointer;
    padding: 0;
    display: none; /* Hidden by default, shown on mobile */
    transition: transform 0.3s ease;
}

.navigation-content {
    padding: 0.75rem 0;
    max-height: 400px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.navigation-item {
    display: block;
    padding: 0.6rem 1.25rem;
    color: #afc1d0;
    text-decoration: none;
    font-family: 'Nixie One', serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.navigation-item:hover {
    color: #d7af6b;
    background: rgba(215, 175, 107, 0.1);
    border-left-color: #d7af6b;
    text-decoration: none;
}

.navigation-item.active {
    color: #d7af6b;
    background: rgba(215, 175, 107, 0.15);
    border-left-color: #d7af6b;
    font-weight: 500;
}

/* Main Content */
.description-main-content {
    background-color: #0b1320;
    padding: 4rem 0 4rem 150px; /* Reduced left padding from 200px to 150px */
    min-height: 100vh;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.content-frame {
    width: 75%; /* Increased from 65% to 75% to use more available space */
    max-width: 1200px;
    margin: 0 auto; /* Back to centered */
    padding: 2rem;
    background-color: #0b1320;
}

/* Text Classes */
.section-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.2rem, 4.5vw, 4rem); /* Increased for desktop */
    font-weight: bold;
    color: #d7af6b;
    margin: 3rem 0 2rem 0;
    text-align: left;
    line-height: 1.2;
}

.subsection-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 600;
    color: #afc1d0;
    margin: 2.5rem 0 1.5rem 0;
    text-align: left;
    line-height: 1.3;
}

.paragraph {
    font-family: 'Nixie One', serif;
    font-size: clamp(1.3rem, 1.7vw, 1.7rem); /* Increased for desktop */
    color: white;
    margin: 1.5rem 0;
    text-align: left;
    line-height: 1.6;
}

.big-paragraph {
    font-family: 'Nixie One', serif;
    font-size: clamp(1.3rem, 1.7vw, 1.7rem); /* Increased for desktop */
    color: white;
    margin: 1.5rem 0;
    text-align: left;
    line-height: 1.7;
}

.reference {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.3rem, 1.7vw, 1.7rem); /* Same as paragraph font size */
    color: #b1d4e0;
    margin: 1.5rem 0;
    text-align: left;
    line-height: 1.6;
}

/* Bold text styling */
strong, b {
    color: #d7af6b;
    font-weight: bold;
}

/* Text under GIFs and pictures */
.image-caption {
    text-align: center;
}

.image-caption p {
    font-family: 'Nixie One', serif;
    font-size: 1.25rem;
    color: #ffffff;
    margin: 0;
    font-style: italic;
    opacity: 0.8;
}

/* Solution Grid Layout */
.solution-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Changed from 2fr 1fr to 50-50 layout */
    gap: 2rem;
    align-items: center;
    margin: 3rem 0;
    padding: 2rem 0;
}

.solution-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.solution-logo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.project-logo {
    width: 100%;
    max-width: 450px;
    height: auto;
    object-fit: contain;
}

/* Desktop specific adjustments for hairpin pieces */
@media (min-width: 769px) {
    .hairpin-image {
        width: 570px; /* 1.5 times larger than 380px */
        opacity: 0.7;
        animation: circularDrift1 12s linear infinite;
    }
    
    .hairpin-container .hairpin-image:first-child {
        top: 25%; /* Adjusted for extended container */
        left: 15%;
        animation: circularDrift1 12s linear infinite;
    }

    .hairpin-container .hairpin-image:last-child {
        top: 20%; /* Adjusted for extended container */
        right: 15%;
        animation: circularDrift2 12s linear infinite; /* Removed delay */
    }
    
    @keyframes float {
        0%, 100% { 
            transform: translateY(0px); 
        }
        50% { 
            transform: translateY(-15px); /* Reduced movement */
        }
    }
}

/* Small laptops - make section navigation smaller */
@media (max-width: 1200px) and (min-width: 769px) {
    .section-navigation {
        transform: scale(0.65); /* Even smaller for small laptops */
        min-width: 160px;
        max-width: 220px;
    }
}

/* Mobile Navigation - Match inclusivity styling */
@media (max-width: 768px) {
    .hero-spacing-breaks {
        display: none; /* Hide the 18 br tags on mobile */
    }
    
    .description-main-content {
        padding: 4rem 0; /* Reset padding on mobile - navigation is full width at top */
    }
    
    .section-navigation {
        top: 85px;
        left: 0;
        right: 0;
        width: 100%;
        min-width: auto;
        max-width: none;
        border-radius: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        background-color: #0b1320;
        backdrop-filter: none;
        z-index: 49;
    }
    
    .navigation-toggle {
        display: block;
    }
    
    .navigation-content {
        display: none;
    }
    
    .navigation-content.active {
        display: block;
    }
    
    .navigation-toggle.active {
        transform: rotate(180deg);
    }

    .content-frame {
        width: 90%;
        padding: 1rem;
        margin: 0 auto; /* Reset margin for mobile - navigation is full width */
    }
    
    .hairpin-image {
        width: 300px !important; /* Doubled from 150px */
        opacity: 0.6;
    }
    
    .hairpin-container .hairpin-image:first-child {
        animation: circularDrift1 12s linear infinite;
        top: 5% !important; /* Positioned over the title - 100px higher */
        left: 15% !important;
    }

    .hairpin-container .hairpin-image:last-child {
        animation: circularDrift2 12s linear infinite; /* Removed 3s delay */
        top: 2% !important; /* Positioned over the title - 100px higher */
        right: 15% !important;
    }
    
    .description-hero {
        min-height: 45vh;
    }
    
    /* Solution Grid Mobile */
    .solution-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .solution-logo {
        order: 1; /* Logo appears after content on mobile */
    }
    
    .project-logo {
        max-width: 300px; /* Increased from 200px (200 * 1.5 = 300) */
    }
    
    /* Keep original mobile float animation */
    @keyframes float {
        0%, 100% { 
            transform: translateY(0px); 
        }
        50% { 
            transform: translateY(-20px); /* Original mobile movement */
        }
    }
}

@media (max-width: 480px) {
    .content-frame {
        width: 95%;
        padding: 0.5rem;
        margin: 0 auto; /* Reset margin for small mobile - navigation is full width */
    }
    
    .hairpin-image {
        width: 300px !important; /* Doubled from 150px */
        opacity: 0.6;
    }
    
    .hairpin-container .hairpin-image:first-child {
        animation: circularDrift1 12s ease-in-out infinite;
        top: 5% !important; /* Positioned over the title - 100px higher than before */
        left: 15% !important;
    }

    .hairpin-container .hairpin-image:last-child {
        animation: circularDrift2 12s linear infinite; /* Removed 3s delay and updated to linear */
        top: 2% !important; /* Positioned over the title instead of bottom positioning */
        right: 5% !important;
    }

    .description-hero {
        min-height: 40vh;
    }
    
    .section-navigation {
        top: 80px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .section-navigation {
        top: 75px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }

    .hairpin-image {
        width: 400px !important; /* Doubled from 200px */
        opacity: 0.6;
    }

    /* Reset font sizes to original values for mobile */
    .paragraph {
        font-size: clamp(1.2rem, 1.5vw, 1.5rem);
    }

    .big-paragraph {
        font-size: clamp(1.2rem, 1.5vw, 1.5rem);
    }

    .reference {
        font-size: clamp(1.25rem, 1.6vw, 1.6rem);
    }

    .section-title {
        font-size: clamp(2rem, 4vw, 3.5rem);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .hairpin-image {
        width: 300px !important; /* Doubled from 150px */
        opacity: 0.5;
    }
}

/* Initial hidden state for animations - elements start invisible on the left (copied from attributions.css) */
.hero-title {
    opacity: 0 !important;
    transform: translateX(-300px) !important;
    transition: none !important;
}

/* Center alignment for paragraphs and references */
.center-aligned {
    text-align: center;
}

/* READ MORE link styling */
.read-more-link {
    color: white;
    text-decoration: underline;
    font-weight: normal;
}

.read-more-link:hover {
    color: #d7af6b;
    text-decoration: underline;
}

/* Three-box grid layout */
.problems-grid {
    display: grid;
    grid-template-columns: 1fr 5px 1fr 5px 1fr;
    gap: 0;
    margin: 2rem 0;
    align-items: stretch;
}

.problem-box {
    background: transparent;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: center; /* Center align everything */
}

.problem-separator {
    background-color: #d7af6b;
    width: 5px;
}

.problem-title {
    color: #d7af6b;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.problem-number {
    font-size: 2.4em; /* Large size for numbers */
    text-align: center;
    display: block;
    margin-bottom: 0.5rem;
}

.problem-header {
    font-size: 1.2em; /* Original size for titles */
    text-align: center; /* Changed from left to center */
}

.problem-content {
    color: white;
    font-size: 1em;
    line-height: 1.6;
    text-align: center; /* Center align content text */
}

/* Full-width centered image */
.full-width-image {
    width: 120%; /* Increased by 20% */
    height: auto;
    display: block;
    margin: 2rem auto; /* Center the larger image */
    margin-left: -10%; /* Offset to center the 120% width image */
}

/* Desktop version - show by default */
.desktop-description-image {
    display: block;
}

/* Mobile version - hidden by default */
.mobile-description-image {
    display: none;
}

/* Show mobile image on smaller screens */
@media (max-width: 768px) {
    .desktop-description-image {
        display: none;
    }
    
    .mobile-description-image {
        display: block;
    }
    
    .full-width-image {
        margin-left: -10%; /* Keep centering for mobile */
    }
}

/* Mobile responsive for problems grid */
@media (max-width: 768px) {
    .problems-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin: 2rem 0;
    }
    
    .problems-grid::before {
        content: "";
        height: 5px;
        width: 100%;
        background-color: #d7af6b;
        margin-bottom: 2rem;
    }
    
    .problems-grid::after {
        content: "";
        height: 5px;
        width: 100%;
        background-color: #d7af6b;
        margin-top: 2rem;
    }
    
    .problem-separator {
        display: block;
        height: 5px;
        width: 100%;
        background-color: #d7af6b;
        margin: 2rem 0;
    }
    
    .problem-box {
        border: none;
        border-radius: 0;
        background: transparent;
        padding: 1.5rem 0;
    }
    
    .problem-box:first-child {
        padding-top: 0;
    }
    
    .problem-box:last-child {
        padding-bottom: 0;
    }
}

/* Three-image grid layout */
.mirna-images-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    margin: 3rem 0;
    align-items: start;
}

.mirna-image-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.mirna-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.mirna-image:hover {
    transform: scale(1.1);
}

.mirna-image-text {
    font-family: 'Nixie One', serif;
    font-size: 1rem;
    color: white;
    line-height: 1.5;
}

/* Mobile responsive for image grid */
@media (max-width: 768px) {
    .mirna-images-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .mirna-image {
        max-width: 250px;
    }
}

/* Reference links styling */
.reference-link {
    color: #afc1d0;
    text-decoration: underline;
}

.reference-link:hover {
    color: #d7af6b;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .reference-link {
        word-break: break-all !important;
        display: inline-block !important;
        max-width: 100% !important;
    }
}
