:root {
    --sky-top: #0072bc;
    --sky-bottom: #8ed6fb;
    --text-main: #000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

/* Fallback */

/* 7.css overrides/helpers */
.window-body.has-space {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* TOP NAV */
.top-nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(to bottom, #005A9C, #0072bc);
    color: white;
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 2rem;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    font-size: 1.1rem;
    font-family: 'Segoe UI', sans-serif;
}

.top-nav a {
    color: white;
    text-decoration: none;
    margin: 0 0.5rem;
}

.top-nav a:hover {
    text-decoration: underline;
}

/* Desktop Separators */
@media (min-width: 769px) {
    .nav-right a:not(:last-child)::after {
        content: " |";
        color: white;
        margin-left: 0.5rem;
    }
}

.burger-menu {
    display: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .burger-menu {
        display: block;
    }

    .nav-right {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: inherit;
        /* Matches navbar gradient */
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    }

    .nav-right.nav-active {
        display: flex;
    }

    .nav-right a {
        margin: 0.5rem 0;
        display: block;
    }
}

/* HERO SECTION */
.frutiger-hero {
    min-height: 100vh;
    background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-bottom) 80%, #fff 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-top: 60px;
    /* User uploaded Frutiger Aero background */
    background-image: url('assets/hero-bg.png');
    background-size: cover;
    background-position: center bottom;
    background-attachment: fixed;
    /* PARALLAX */
    /* Anchor grass to bottom usually looks better */
    background-blend-mode: normal;
    /* Remove soft-light to see true colors */
    overflow: hidden;
    /* ensure butterflies don't stretch page */
}

/* BUTTERFLIES */
.butterfly {
    position: absolute;
    width: 50px;
    height: auto;
    pointer-events: none;
    z-index: 10;
    opacity: 0.9;
}

.b1 {
    top: 20%;
    left: 20%;
    animation: float1 15s infinite linear;
}

.b2 {
    bottom: 30%;
    right: 25%;
    animation: float2 20s infinite linear;
    transform: scaleX(-1);
    /* flip */
}

@keyframes float1 {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(100px, -50px) rotate(10deg);
    }

    50% {
        transform: translate(200px, 0) rotate(0deg);
    }

    75% {
        transform: translate(100px, 50px) rotate(-10deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

@keyframes float2 {
    0% {
        transform: translate(0, 0) scaleX(-1) rotate(0deg);
    }

    33% {
        transform: translate(-150px, -80px) scaleX(-1) rotate(-15deg);
    }

    66% {
        transform: translate(-80px, 40px) scaleX(-1) rotate(10deg);
    }

    100% {
        transform: translate(0, 0) scaleX(-1) rotate(0deg);
    }
}

.main-title {
    font-size: 5rem;
    line-height: 1;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    /* 2000s Glossy Effect - Black Version */
    background: linear-gradient(180deg, #444 0%, #222 50%, #000 51%, #333 100%);
    -webkit-background-clip: text;
    background-clip: text;
    /* Standard property for compatibility */
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(2px 2px 0px rgba(0, 0, 0, 0.2));
    animation: popIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.student-subtitle {
    font-size: 1.5rem;
    color: #333;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    /* Tech vibe */
    overflow: hidden;
    /* Ensures the content is not revealed until the animation */
    border-right: .15em solid orange;
    /* The typwriter cursor */
    white-space: nowrap;
    /* Keeps the content on a single line */
    margin: 0 auto;
    /* Gives that scrolling effect as the typing happens */
    animation:
        typing 3.5s steps(30, end),
        blink-caret .75s step-end infinite;
    max-width: fit-content;
}

/* The typing effect */
@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

/* The typewriter cursor effect */
@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: orange;
    }
}

/* WAVES */
.wave-separator {
    line-height: 0;
    width: 100%;
}

.wave-separator svg {
    display: block;
    width: 100%;
    height: 150px;
}

.top-wave {
    background: linear-gradient(to bottom, #dff6ff, #000);
    margin-top: -1px;
}

.bottom-wave {
    background: #000;
    margin-bottom: -1px;
}

/* PROJECTS SECTION */
.projects-section {
    background-color: #000;
    padding: 4rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    /* Critical for arrow positioning */
}

.projects-section .section-title {
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--sky-top);
    /* Subtle blue underline */
    padding-bottom: 0.5rem;
}

.cd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

/* JEWEL CASE CSS */
.cd-case {
    position: relative;
    width: 200px;
    height: 180px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s;
}

.cd-case:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
}

/* Empty Project Filler */
.empty-project {
    cursor: default;
    pointer-events: none;
    opacity: 0.7;
}

.empty-project:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
}

.empty-project .disc-label {
    display: none;
}

.cd-spine-left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 15px;
    background: linear-gradient(to right, #444, #111);
    border-right: 1px solid #666;
    z-index: 2;
}

.cd-disc-shiny {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 10%, #ccc 20%, #ddd 21%, #fff 25%, silver 30%, #fff 60%, silver 70%);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-left: 10px;
    background-image: conic-gradient(from 0deg, transparent 0%, rgba(255, 0, 0, 0.1) 10%, rgba(0, 255, 0, 0.1) 20%, rgba(0, 0, 255, 0.1) 30%, transparent 40%);
}

.disc-hole {
    width: 25px;
    height: 25px;
    background: #000;
    /* Dark hole for contrast inside case */
    border: 1px solid #999;
    border-radius: 50%;
}

.disc-label {
    position: absolute;
    top: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 5px;
    border-radius: 3px;
    max-width: 80%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.cd-plastic-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 40%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
    border-radius: 4px;
    z-index: 5;
}

/* BIO SECTION */
.bio-section {
    position: relative;
    min-height: 100vh;
    background: var(--sky-bottom);
    /* Radiant sun and flower field background */
    background-image: url('assets/bio-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* PARALLAX */
    padding-top: 0;
    /* Removing top padding to allow full centering */
    align-items: center;
    /* Center vertically */
    display: flex;
    justify-content: center;
}

/* SCROLL REVEAL ANIMATIONS */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.bio-content-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    max-width: 1200px;
}

.bio-text-area {
    position: relative;
    max-width: 600px;
    /* Increased slightly */
    text-align: left;
    font-family: 'Times New Roman', Times, serif;
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    padding-right: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bio-text-area h2 {
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.avatar-svg {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* AVATAR WIDGET STYLES */
.avatar-wrapper {
    position: relative;
    display: inline-block;
}

.gnark-img {
    position: absolute;
    bottom: -20px;
    /* Adjusted for larger size */
    right: -25px;
    width: 100px;
    /* Increased from 60px */
    z-index: 20;
    transform: rotate(10deg);
    filter: drop-shadow(2px 2px 5px rgba(0, 0, 0, 0.5));
    pointer-events: none;
}

.avatar-window {
    width: 300px !important;
}

/* MODAL OVERLAY */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

/* --- Timeline Académique (Frutiger Aero) --- */
.academic-timeline {
    position: relative;
    padding-left: 30px;
    margin-top: 2rem;
    border-left: 3px solid rgba(0, 174, 239, 0.3);
    /* Blueish border */
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/* Marker (The Dot) */
.timeline-marker {
    position: absolute;
    left: -38px;
    /* -30px padding + half border + alignment */
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    border: 3px solid #00aeef;
    box-shadow: 0 0 5px rgba(0, 174, 239, 0.5);
    top: 5px;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-marker {
    background: #00aeef;
    transform: scale(1.2);
}

/* Active State (Current) */
.timeline-item.active .timeline-marker {
    background: #00aeef;
    box-shadow: 0 0 10px #00aeef, 0 0 20px #00aeef;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 174, 239, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 174, 239, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 174, 239, 0);
    }
}

/* Content Card */
.timeline-content {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.timeline-item:hover .timeline-content {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.6);
    border-color: #00aeef;
}

.timeline-content h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #004a80;
    /* Dark Blue for title */
    font-weight: 700;
}

.timeline-content .date {
    display: block;
    font-size: 0.9rem;
    color: #555;
    /* Dark Gray for date */
    margin-bottom: 0.5rem;
    font-style: italic;
}

.timeline-content p {
    margin: 0;
    font-size: 1rem;
    color: #222;
    /* Dark Text */
}

/* Modal Layout */
.modal-layout {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    align-items: flex-start;
}

.modal-left {
    flex: 0 0 350px;
    /* Fixed width for image column - Larger */
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-cover-img {
    width: 100%;
    max-width: 350px;
    /* Allow image to be bigger */
    height: auto;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#modal-item-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #000;
    font-size: 1.8rem;
    /* Make header bigger */
}

/* Metadata Styles */
.modal-meta {
    background: rgba(255, 255, 255, 0.5);
    padding: 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.9rem;
}

.meta-row {
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
}

.meta-row:last-child {
    margin-bottom: 0;
}

.meta-label {
    font-weight: bold;
    color: #555;
    width: 70px;
    /* Fixed width labels for alignment */
    display: inline-block;
}

#modal-tech {
    color: #005A9C;
    /* Blue for tech stack */
    font-weight: 600;
}

#modal-desc {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: #222;
    line-height: 1.5;
    white-space: pre-wrap;
    /* Allow newlines from JS */
}

.modal-actions {
    margin-top: auto;
    /* Push to bottom */
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.xp-button {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(to bottom, #f2f2f2 0%, #e0e0e0 49%, #d0d0d0 50%, #f0f0f0 100%);
    border: 1px solid #707070;
    border-radius: 3px;
    text-decoration: none;
    color: black;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.xp-button:hover {
    background: linear-gradient(to bottom, #dff6ff 0%, #a4dcff 49%, #93cfff 50%, #cceeff 100%);
    border-color: #3c7fb1;
}

/* WINDOWS 7 PLAYER WIDGET */
.music-player-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    z-index: 9999;
    /* 7.css handles the glass look if standard structure is used */
}

.music-player-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 5px;
}

.player-info {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #aaa;
    border-radius: 3px;
    padding: 5px 10px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.player-controls button {
    min-width: 40px;
}

.volume-control {
    display: flex;
    align-items: center;
    padding: 0 5px;
    margin-top: 5px;
    color: #444;
}

#volume-slider {
    width: 100%;
    cursor: pointer;
    accent-color: #0072bc;
    /* Uses browser default style but colored blue */
    height: 4px;
}

#song-title {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    display: inline-block;
}

/* GLOBAL RESPONSIVE SAFETY */
img,
video,
svg {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .main-title {
        font-size: 10vw;
        /* Responsive font size */
        margin-bottom: 1rem;
    }

    .student-subtitle {
        font-size: 1rem;
        white-space: normal;
        /* Allow wrapping on mobile */
        border-right: none;
        /* Remove typewriter cursor on mobile if wrapping */
        animation: none;
        /* Disable complex animation on mobile for stability */
        width: auto;
    }

    /* REDUCE PADDING ON SECTIONS */
    .frutiger-hero {
        padding-top: 80px;
        /* Clear fixed nav */
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .projects-section {
        padding: 2rem 1rem;
        /* Reduced from 4rem 2rem */
    }

    .bio-section {
        padding: 2rem 1rem;
    }

    .bio-content-wrapper {
        flex-direction: column;
        padding: 0;
        gap: 2rem;
        /* Reduced gap */
        width: 100%;
    }

    .cd-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        /* Increased min-width to match CD case width (200px) so they don't overlap */
        gap: 2.5rem;
        width: 100%;
        justify-items: center;
        /* Center items in their cells */
    }

    /* Hide Music Player on Mobile */
    .music-player-window {
        display: none;
    }

    /* Hide Scroll Arrows on Mobile (User Request) */
    .scroll-arrow {
        display: none;
    }

    /* Hide Butterflies on Mobile */
    .butterfly {
        display: none;
    }

    /* Hide Empty Projects on Mobile */
    .empty-project {
        display: none;
    }

    /* Adjust windows for mobile */
    .window {
        width: 95% !important;
        /* Leave a little breathing room */
        max-width: 100% !important;
        margin: 0 auto;
    }

    /* Ensure modal images don't overflow */
    .modal-layout {
        flex-direction: column;
        padding: 0.5rem;
    }

    .modal-left,
    .modal-right {
        width: 100%;
        flex: auto;
    }

    .modal-cover-img {
        max-width: 100%;
        /* Allow full width on mobile */
        width: auto;
        max-height: 250px;
        object-fit: contain;
    }

    /* MOBILE SPECIFIC: Avatar Superimposed on Text */
    .avatar-wrapper {
        position: absolute;
        top: -85px;
        /* Moved way up to sit ON TOP of the box border */
        right: 0;
    }

    .avatar-window {
        width: 100px !important;
    }

    .gnark-img {
        width: 50px;
        /* Smaller on mobile */
        bottom: -10px;
        right: -10px;
    }

    /* Reduce padding on mobile so text has space */
    .bio-text-area {
        padding-right: 1rem;
        /* Removed extra padding, text goes full width */
        padding-top: 30px;
        width: 100%;
    }

    .bio-text-area h2 {
        font-size: 2rem;
        /* Smaller section title */
    }
}

/* FOOTER STYLES */
.site-footer {
    text-align: center;
    padding: 1rem 0;
    /* Reduced padding */
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    background: transparent;
    position: absolute;
    /* Absolute positioning to sit at bottom without affecting layout */
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10;
}