@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

/* CSS Variables */
:root {
    --apple-blue: #007AFF;
    --apple-gray: #86868b;
    --apple-light-gray: #e1dede;
    --gradient-education: linear-gradient(135deg, #bf5700, #ff8c41);
    --gradient-experience: #f5f5f7;
    --gradient-projects: linear-gradient(135deg, #aae2f2, #c8aee5);
    --gradient-honors: linear-gradient(135deg, #d2b5e5, #e5b5c8);
    --gradient-skills: linear-gradient(135deg, #a1c4fd, #c2e9fb);
    --title-gradient-education: linear-gradient(135deg, #bf5700, #ff8c41);
    --title-gradient-experience: linear-gradient(135deg, #667eea, #764ba2);
    --title-gradient-projects: linear-gradient(135deg, #00c9b7, #8a2be2);
    --title-gradient-honors: linear-gradient(90deg, 
        #4285f4 0%, 
        #7b5bf2 20%, 
        #b64ff6 40%, 
        #e542a3 60%, 
        #f95c5c 80%, 
        #ff8a56 100%
    );
    --title-gradient-skills: linear-gradient(135deg, #306dfa, #00d4ff);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    color: #1d1d1f;
    overflow-x: hidden;
}

/* Added: Two Background Layers for Opacity Fade 
#bg-layer-1,
#bg-layer-2 {
  position: fixed;
  inset: 0; 
  z-index: -1;
  background: transparent; /* Background set by JS 
  transition: opacity 0.5s ease;
  will-change: opacity; /* Hint browser about opacity changes 
  opacity: 0; /* Start hidden 
  contain: paint; /* Isolate painting 
}*/

/* Initial state will be set by JS, e.g., making layer 1 visible */
#header {background: #f5f5f7;}
body { background:#f5f5f7; }   /* same colour as #header and #experience */


/* Typography */
h1 {
    font-size: 4em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #007AFF, #00C7FF);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 2.5em;
    margin-bottom: 20px;
    background-size: 100% 100%;
    background-position: 0 0;
    display: inline-block; 
}

#education h2 { background-image: var(--title-gradient-education); }
#experience h2 { background-image: var(--title-gradient-experience); padding-left: 0; margin-bottom: 14px; font-size: 3em; }
#projects h2 { background-image: var(--title-gradient-projects); }
#honors h2 { background-image: var(--title-gradient-honors); }
#skills h2 { background-image: var(--title-gradient-skills); }

p {
    margin-bottom: 10px;
}

.date {
    color: #5a5a5b;
}

/* Section Styles */
.section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: background 0.5s ease;
}

#education {
    background-image: var(--gradient-education);
}

#experience {
    background: #f5f5f7;
    padding: 110px 0 60px;
    margin-top: 110vh;
}

/* Marquee */
.marquee-strip {
    overflow: hidden;
    margin: 72px -60px 32px;
    padding: 28px 0;
    background: #ffffff;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 22s linear infinite;
    mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}

.marquee-items {
    display: flex;
    align-items: center;
    gap: 56px;
    padding-right: 56px;
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-33.3333%); }
}

.marquee-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    opacity: 0.85;
}

.marquee-text-logo {
    font-size: 1em;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.marquee-dot {
    color: #c0c0c5;
    font-size: 1.2em;
    line-height: 1;
}

#projects {
    background-image: var(--gradient-projects);
}

#honors {
    background: #1a1a1c; /* Apple's dark gray instead of pure black */
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

#skills {
    background-image: var(--gradient-skills);
}

.content {
    max-width: 800px;
    padding: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 3;
    position: relative;
}

.content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Override transform animation for header content */
#header .content {
    opacity: 1;
    transform: none;
}

#header .content.visible {
    opacity: 1;
    transform: none;
}

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

/* Header Styles */
#header {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    z-index: 2;
}

#header .content {
    text-align: center;
    z-index: 2;
    transition: transform 0.1s ease;
    background-color: transparent;
    box-shadow: none;
}

#header .content:hover {
    transform: none;
    box-shadow: none;
}

#header h1 {
    font-size: 5em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #007AFF, #00C7FF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.background {
    position: absolute;
    top: -1vh;
    left: -1vw;
    right: -1vw;
    bottom: -1vh;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    border-radius: 30px;
    transition: all 0.4s ease;
}

.subtitle {
    font-size: 1.5em;
    color: #86868b;
    margin-bottom: 20px;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.contact-info span, .contact-info a {
    color: #86868b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: #007AFF;
}

/* Scroll cue */
.scroll-cue {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    transition: opacity 0.3s ease;
    color: rgba(255, 255, 255, 0.65);
}

.scroll-cue-inner {
    animation: scroll-cue-bounce 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scroll-cue-text {
    font-size: 0.7em;
    letter-spacing: 0.14em;
    font-weight: 500;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes scroll-cue-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(10px); opacity: 1; }
}

/* Education Styles */

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0px;
    position: relative;
}

.education-header h2 {
    margin-bottom: 10px;
}

.education-content {
    margin-top: 0;
}

.university-logo {
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: auto;
}

.ut-logo {
    width: 100%;
    height: auto;
}

/* Experience Styles */
.experience-container {
    max-width: 100%;
    min-height: 50%;
    margin: 0 auto;
    padding: 0 60px;
    position: relative;
}

.experience-cards-wrapper {
    overflow: hidden;
    margin: 0 -60px;
    height: 400px;
    display: flex;
    align-items: center;
}

.experience-cards {
    display: flex;
    transition: transform 0.3s ease;
    padding-left: 40px;
}

.experience-card {
    flex: 0 0 calc(30% - 40px);
    margin: 0 20px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 60px;
}
.experience-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.experience-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}


.experience-position {
    font-size: 0.92em;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 1px;
}

.experience-company {
    font-size: 1.6em;
    font-weight: 600;
    color: transparent;
    background-image: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
}

.experience-date {
    display: inline-block;
    font-size: 0.75em;
    font-weight: 500;
    color: #86868b;
    background: #f0f0f5;
    border-radius: 20px;
    padding: 2px 10px;
    margin-top: 6px;
    margin-bottom: 15px;
    letter-spacing: 0.02em;
}


/* Changed: Updated list styles for experience details */
.experience-details ul {
    padding-left: 0;
}

.experience-details li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
    font-size: 0.95em;
    color: #1d1d1f;
}

.experience-details li::before {
    content: "•";
    color: transparent;
    background-image: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    position: absolute;
    left: 0;
    top: 0;
}

.experience-summary {
    font-size: 0.9em;
    font-weight: 400;
    color: #3a3a3c;
    line-height: 1.5;
    margin-top: 12px;
    flex-grow: 1;
}

.experience-details-hidden {
    display: none;
}

.expand-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1d1d1f;
    color: white;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.expand-btn:hover {
    background: #007AFF;
    transform: scale(1.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: white;
    border-radius: 24px;
    padding: 44px 44px 36px;
    max-width: 620px;
    width: 90%;
    position: relative;
    transform: scale(0.92);
    transition: transform 0.25s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1d1d1f;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    background: #444;
}

.modal-body .experience-company {
    font-size: 1.5em;
    margin-bottom: 4px;
}

.modal-body .experience-position {
    font-size: 1em;
    margin-bottom: 2px;
}

.modal-body .experience-date {
    margin-bottom: 20px;
}

.modal-body ul {
    padding-left: 0;
}

.modal-body li {
    font-size: 0.95em;
    color: #1d1d1f;
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.modal-body li::before {
    content: "•";
    color: transparent;
    background-image: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    position: absolute;
    left: 0;
    top: 0;
}

.experience-card-nav {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: var(--apple-light-gray);
}

.card-navigation {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
    padding-right: 4px;
}

.nav-button {
    background-color: #ebebeb;
    color: #1d1d1f;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 6px;
    flex-shrink: 0;
}

.nav-button:hover:not(:disabled) {
    background-color: #dcdcdc;
}

.nav-button:disabled {
    background-color: #f0f0f0;
    color: #cfcfcf;
    cursor: not-allowed;
}

.nav-button svg {
    display: block;
}

/* Projects Styles */
.projects-container {
    position: relative;
}

.project {
    padding: 15px 0;
    position: relative;
}

.project::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 10px; /* This makes the line 10px shorter on the right */
    height: 1.5px;
    background-color: #d2d2d7; /* Use the same color as the original border */
}

.project:last-child::after {
    display: none;
}

.project-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-header-content {
    flex-grow: 1;
}

.project-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #1d1d1f;
}

.project-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.project-title a:hover {
    color: var(--apple-blue);
}

.project-role {
    font-size: 16px;
    color: #86868b;
    margin-top: 4px;
}

.project-content {
    padding-top: 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out;
    opacity: 0;
}

.project-content.expanded {
    max-height: 300px; /* Adjust based on your content */
    opacity: 1;
}

.project-content a {
    color: var(--apple-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.project-content a:hover {
    color: #0051d5;
}

.expand-icon {
    width: 12px;
    height: 12px;
    border: solid #86868b;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-right: 12px;
}

.project.expanded .expand-icon {
    transform: rotate(-135deg);
}

/* Skills Styles */
.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.skill {
    background-color: var(--apple-light-gray);
    color: var(--apple-blue);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.skill:hover {
    background-color: var(--apple-blue);
    color: white;
}

/* List Styles */
ul {
    list-style-type: none;
    padding-left: 0;
}

ul li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 25px;
}

ul li::before {
    content: "•";
    color: var(--apple-blue);
    font-size: 1.5em;
    position: absolute;
    left: 0;
    top: -2px;
}

/* Parallax Background Styles */
/* Removed parallax styles */

/* Utility Classes */
.full-width {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

/* Media Queries */
@media (max-width: 768px) {
    h1 {
        font-size: 3em;
    }

    #header h1 {
        font-size: 3em;
    }

    .content {
        padding: 20px;
    }

    #header .content {
        padding: 20px;
    }

    .contact-info {
        font-size: 0.9em;
    }

    .education-header {
        flex-direction: column;
        align-items: center;
    }

    .university-logo {
        margin-top: 20px;
    }

    .project-title {
        font-size: 18px;
    }
    
    .project-role {
        font-size: 14px;
    }
    
    #projects .content {
        padding: 20px;
    }
}

/* Honors Styles */
.gradient-border {
    position: relative;
    width: 94%;
    max-width: 1400px;
    margin: 0 auto;
    border-radius: 30px;
    background: #1a1a1c; /* Match the section background */
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.15),
        0 0 70px rgba(124, 169, 245, 0.15),
        0 0 120px rgba(161, 125, 245, 0.1);
    overflow: hidden;
}

.gradient-border::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, 
        #7ca9f5, #a17df5, #e481d4, #ff9fb5, #ffbb97, 
        #ffbb97, #ff9fb5, #e481d4, #a17df5, #7ca9f5);
    background-size: 300% 300%;
    animation: gradientWave 12s ease infinite;
    border-radius: 35px;
    z-index: 0;
    /* Optimize for performance */
    will-change: background-position;
    transform: translateZ(0);
}

.gradient-border::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background: #1a1a1c; /* Match the section background */
    border-radius: 27px;
    z-index: 1;
}

@keyframes gradientWave {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.honors-container {
    background: transparent;
    border-radius: 27px;
    padding: 40px 60px;
    position: relative;
    z-index: 2;
}

.honors-container h2 {
    text-align: left;
    margin-bottom: 40px;
    font-size: 2.5em;
    padding-left: 40px;
    color: white; /* Fallback */
    background: linear-gradient(90deg, 
        #4285f4 0%, 
        #7b5bf2 20%, 
        #b64ff6 40%, 
        #e542a3 60%, 
        #f95c5c 80%, 
        #ff8a56 100%
    );
    background-size: 100% 100%; /* This ensures the gradient fits exactly within the text width */
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Improve performance */
    transform: translateZ(0);
    will-change: transform;
    /* Make colors pop more with increased saturation but reduce filter complexity */
    filter: saturate(120%);
}

.honors-cards-wrapper {
    overflow: hidden;
    margin: 0 -20px;
    height: 450px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 4;
}

.honors-cards {
    display: flex;
    transition: transform 0.3s ease;
    padding-left: 40px;
    will-change: transform;
}

.honor-card {
    flex: 0 0 calc(33.333% - 40px);
    margin: 0 20px;
    background-color: rgb(25, 25, 25);
    border-radius: 20px;
    box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
    height: 380px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    will-change: transform;
    transform: translateZ(0);
}

.honor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.honor-card-content {
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.honor-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: white;
}

.honor-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.honor-details {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 15px;
    flex-grow: 1;
    line-height: 1.6;
}

.honor-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: auto;
}

.honor-navigation {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    position: relative;
    z-index: 10;
}

.honor-navigation .nav-button {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
}

.honor-navigation .nav-button:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.honor-navigation .nav-button:disabled {
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

@media (max-width: 1200px) {
    .honor-card {
        flex: 0 0 calc(50% - 40px);
    }
    
    .gradient-border {
        width: 96%;
    }
}

@media (max-width: 768px) {
    .honor-card {
        flex: 0 0 calc(100% - 40px);
    }
    
    .honors-cards-wrapper {
        height: 500px;
    }
    
    .honor-card {
        height: 420px;
    }
    
    .gradient-border {
        width: 92%;
    }
    
    .honors-container {
        padding: 30px 20px;
    }
    
    .gradient-border::before {
        top: -3px;
        left: -3px;
        right: -3px;
        bottom: -3px;
    }
    
    .gradient-border::after {
        top: 2px;
        left: 2px;
        right: 2px;
        bottom: 2px;
    }
}

/* Mobile Overlay */
#mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    /* Optimize for hardware acceleration */
    transform: translateZ(0);
    will-change: opacity;
}

#mobile-overlay h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #007AFF, #00C7FF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    max-width: 80%;
    line-height: 1.4;
}


body.is-scrolling {
  transition: none !important;
}

#projects, #honors { contain: layout paint style; }
