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

:root {
    --text-main: #0c1e3c;
    --text-sub: #1a3a52;
    /* School Brand Colors */
    --nyu-violet: #57068c;
    --cmu-red: #C41230;
    --accent-blue: #1e40af;
    /* Paper Tint */
    --paper-color: #f0f4ff;
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    
    /* BACKGROUND LAYER 1: Blue Tint */
    background-color: var(--paper-color);
    
    /* BACKGROUND LAYER 2: Generated Noise Texture (No External Link Needed) */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.4'/%3E%3C/svg%3E");
    
    /* Blend them to look like paper */
    background-blend-mode: overlay;
    background-attachment: fixed;
}

/* Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
    display: none;
}

/* Navigation */
nav { padding: 33.33px 0; display: flex; justify-content: center; width: 100%; }
.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-links a { 
    text-decoration: none; color: var(--text-main); margin: 0 3vw; 
    font-family: 'Outfit', sans-serif;
    font-weight: 800; font-size: 1.3rem; line-height: 1.2;
    transition: 0.3s; text-transform: uppercase;
}
.nav-links a.active { color: var(--accent-blue); }
.nav-links a:hover { color: var(--accent-blue); }

/* Titles */
.section-title { 
    text-align: center; font-family: 'Space Grotesk'; 
    font-size: 5rem; color: var(--text-main); margin: 5vh 0; 
}

/* Home Layout */
.home-container {
    display: flex; align-items: center; justify-content: center;
    min-height: 70vh; gap: 8%; padding: 0 10%;
}

/* Flip Card Styles */
.flip-card {
    background-color: transparent;
    width: 80vw; height: 70vh;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.flip-card:hover {
    animation: wobble 0.6s ease-in-out;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border-radius: 20px;
    border: 3px solid white;
    box-shadow: 10px 20px 40px rgba(0,0,0,0.2);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}

.flip-card-front {
    flex-direction: row;
    gap: 40px;
    justify-content: space-between;
    padding: 40px;
}

.flip-card-back {
    transform: rotateY(180deg);
    background: rgba(255, 255, 255, 0.9);
}

.card-back-content {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
}

@keyframes wobble {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(1.5deg); }
    30% { transform: rotate(-1.5deg); }
    45% { transform: rotate(1.5deg); }
    60% { transform: rotate(-1.5deg); }
    75% { transform: rotate(1deg); }
    100% { transform: rotate(0deg); }
}
.circular-pfp {
    width: 350px; height: 350px; min-width: 350px; min-height: 350px;
    flex-shrink: 0; border-radius: 50%; object-fit: cover; aspect-ratio: 1/1;
    border: 5px solid var(--accent-blue); box-shadow: 5px 10px 20px rgba(0,0,0,0.15);
}
.hero-text {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center; flex: 1;
}
.hero-text p { font-size: 2rem; margin: 0; }
.hero-text h1 { font-family: 'Space Grotesk'; font-size: 6.5rem; line-height: 1; color: var(--text-main); text-align: left; }

/* Experience Layout */
.exp-container { max-width: 1000px; margin: 0 auto; padding-bottom: 15vh; }
.exp-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 20px; padding: 50px; margin-bottom: 50px;
    display: flex; align-items: center; gap: 50px;
    box-shadow: 5px 10px 20px rgba(0,0,0,0.1);
    border: 2px solid white;
}
.exp-card.reverse { flex-direction: row-reverse; }
.exp-img { width: 300px; height: 220px; border-radius: 10px; object-fit: cover; border: 4px solid white; }
.project-card {
    flex-direction: column;
    border-radius: 30px; padding: 90px; margin-bottom: 90px; gap: 30px;
}
.project-card.reverse { flex-direction: column; }
.project-card .exp-img { width: 659px; height: 483px; border-radius: 15px; }

/* Experience Text Centering */
.exp-content { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.role-badge { 
    font-family: 'Space Grotesk'; font-size: 1.5rem; 
    color: var(--accent-blue); text-transform: uppercase; 
    margin-bottom: 5px; display: block;
}
.exp-content h3 { font-size: 2rem; margin-bottom: 5px; font-weight: 800; }
.exp-content .date { font-weight: 600; color: var(--text-sub); margin-bottom: 20px; }
.exp-content ul { text-align: left; align-self: flex-start; margin-top: 15px; }

/* Education Layout */
.edu-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8vw; max-width: 90%; margin: 0 auto 5vh auto;
}
.edu-card {
    background: rgba(255, 255, 255, 0.7);
    padding: 3%; border-radius: 30px; text-align: center;
    border: 4px solid white; box-shadow: 10px 10px 0px rgba(0,0,0,0.1);
}
.edu-card h2 { font-family: 'Space Grotesk'; font-size: 2.85rem; margin: 20px 0; line-height: 1; }
.edu-card img { width: 152px; }
.edu-card .status { font-weight: 800; letter-spacing: 2px; }

/* School Specific Colors */
.nyu-color { color: var(--nyu-violet); }
.cmu-color { color: var(--cmu-red); }
.nyu-box { background: rgba(87, 6, 140, 0.1) !important; }
.cmu-box { background: rgba(196, 18, 48, 0.1) !important; }

/* Contact */
.contact-footer { position: fixed; bottom: 5%; width: 100%; display: flex; justify-content: center; z-index: 1000; }
.contact-trigger { 
    background: rgba(0, 0, 0, 0.4); color: #fff; border: none; 
    padding: 1.2rem 4rem; border-radius: 5px; font-weight: 800; font-size: 1.1rem;
    cursor: pointer; transform: rotate(-2deg); box-shadow: 5px 5px 0px rgba(255,255,255,0.5);
    transition: 0.2s;
}
.contact-trigger:hover { transform: rotate(0deg) scale(1.05); }

/* Modal */
.modal-overlay { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.8); 
    backdrop-filter: blur(10px); display: none; align-items: center; 
    justify-content: center; z-index: 2000; 
}
.modal-overlay.active { display: flex; }
.modal-card { background: #f1f5f9; padding: 2rem; border-radius: 20px; text-align: center; width: 90%; max-width: 450px; position: relative; border: 4px solid black; }

/* ===== MOBILE RESPONSIVENESS ===== */

/* Tablet Landscape and below (1024px) */
@media (max-width: 1024px) {
    .flip-card {
        width: 90vw;
        height: auto;
        min-height: 65vh;
    }

    .flip-card-inner {
        height: auto;
        min-height: 65vh;
    }

    .flip-card-front, .flip-card-back {
        position: relative;
        height: auto;
        min-height: 65vh;
    }

    .circular-pfp {
        width: 250px;
        height: 250px;
        min-width: 250px;
        min-height: 250px;
    }

    .hero-text h1 {
        font-size: 4.5rem !important;
    }

    .hero-text p {
        font-size: 1.5rem !important;
    }

    .card-back-content h2 {
        font-size: 2.5rem !important;
    }

    .card-back-content ul li {
        font-size: 1.3rem !important;
    }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
    nav { padding: 33.33px 0; }
    .nav-links { 
        display: flex; 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 10px;
    }
    .nav-links a { 
        font-size: 0.9rem; 
        margin: 5px 10px;
        padding: 8px 12px;
    }

    .section-title { font-size: 2.5rem; margin: 3vh 0; }

    .home-container { 
        min-height: auto; 
        padding: 20px 5%; 
    }

    .flip-card {
        width: 95vw;
        height: auto;
        min-height: calc(100vh - 200px);
        max-height: none;
    }

    .flip-card-inner {
        height: auto;
        min-height: calc(100vh - 200px);
    }

    .flip-card-front, .flip-card-back {
        position: relative;
        height: auto;
        min-height: calc(100vh - 200px);
        padding: 6vw;
    }

    .flip-card-front {
        flex-direction: column;
        gap: 20px;
        justify-content: flex-start;
        padding-top: 30px;
    }

    .flip-card-back {
        overflow-y: auto;
        justify-content: flex-start;
        padding-top: 30px;
    }

    .circular-pfp {
        width: clamp(120px, 30vw, 180px);
        height: clamp(120px, 30vw, 180px);
        min-width: clamp(120px, 30vw, 180px);
        min-height: clamp(120px, 30vw, 180px);
        border: 3px solid var(--accent-blue);
    }

    .hero-text {
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .hero-text h1 {
        font-size: clamp(2rem, 7vw, 3rem) !important;
        text-align: center;
        line-height: 1.1;
        width: 100%;
    }

    .hero-text p {
        font-size: clamp(0.9rem, 3vw, 1.2rem) !important;
        text-align: center;
        max-width: 100% !important;
        margin-top: 10px !important;
    }

    .card-back-content {
        padding-top: 10px;
        width: 100%;
        overflow-y: auto;
    }

    .card-back-content > div {
        width: 100%;
    }

    .card-back-content h2 {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        margin-bottom: 20px !important;
    }

    .card-back-content ul {
        padding: 0 !important;
        margin: 0 !important;
        width: 100%;
    }

    .card-back-content ul li {
        font-size: clamp(0.85rem, 2.5vw, 1.1rem) !important;
        margin-bottom: 12px !important;
        line-height: 1.5;
        text-align: left;
        padding: 0 5px;
    }

    .card-back-content ul li b {
        font-size: clamp(0.9rem, 2.7vw, 1.15rem);
        display: inline;
    }

    .card-back-content ul li br {
        display: none;
    }

    .card-back-content ul br {
        display: none;
    }

    /* Experience Cards */
    .exp-container {
        padding: 0 15px 10vh 15px;
    }

    .exp-card {
        flex-direction: column !important;
        padding: 25px;
        margin-bottom: 30px;
        gap: 20px;
    }

    .exp-card.reverse {
        flex-direction: column !important;
    }

    .exp-img {
        width: 100%;
        height: auto;
        max-height: 250px;
    }

    .project-card {
        padding: 30px;
        margin-bottom: 40px;
    }

    .project-card .exp-img {
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    .exp-content h3 {
        font-size: 1.4rem;
    }

    .exp-content ul {
        align-self: center;
        padding-left: 0;
    }

    .role-badge {
        font-size: 1.1rem;
    }

    /* Education Grid */
    .edu-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 95%;
        padding: 0 10px;
    }

    .edu-card {
        padding: 25px;
    }

    .edu-card h2 {
        font-size: 1.8rem;
    }

    .edu-card img {
        width: 120px;
    }

    /* Contact Footer */
    .contact-footer {
        bottom: 3%;
    }

    .contact-trigger {
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
    }

    /* Modal */
    .modal-card {
        width: 90%;
        padding: 1.5rem;
    }
}

/* Mobile Phone Landscape (640px) */
@media (max-width: 640px) {
    .flip-card {
        min-height: calc(100vh - 180px);
    }

    .flip-card-inner {
        min-height: calc(100vh - 180px);
    }

    .flip-card-front, .flip-card-back {
        min-height: calc(100vh - 180px);
        padding: 5vw;
    }

    .hero-text h1 {
        font-size: clamp(1.75rem, 6.5vw, 2.5rem) !important;
    }

    .hero-text p {
        font-size: clamp(0.8rem, 2.8vw, 1.1rem) !important;
    }

    .card-back-content h2 {
        font-size: clamp(1.3rem, 4.5vw, 1.8rem) !important;
    }

    .card-back-content ul li {
        font-size: clamp(0.75rem, 2.3vw, 1rem) !important;
    }

    .card-back-content ul li b {
        font-size: clamp(0.8rem, 2.5vw, 1.05rem);
    }
}

/* Mobile Phone Portrait (480px) */
@media (max-width: 480px) {
    nav {
        padding: 14px 0;
    }
    .nav-links a {
        font-size: 0.9rem;
        margin: 5px 10px;
        padding: 8px 12px;
    }

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

    .flip-card {
        min-height: calc(100vh - 160px);
    }

    .flip-card-inner {
        min-height: calc(100vh - 160px);
    }

    .flip-card-front, .flip-card-back {
        min-height: calc(100vh - 160px);
        padding: 4vw;
    }

    .circular-pfp {
        width: clamp(100px, 28vw, 140px);
        height: clamp(100px, 28vw, 140px);
        min-width: clamp(100px, 28vw, 140px);
        min-height: clamp(100px, 28vw, 140px);
    }

    .hero-text h1 {
        font-size: clamp(1.5rem, 6vw, 2.2rem) !important;
    }

    .hero-text p {
        font-size: clamp(0.75rem, 2.5vw, 1rem) !important;
        margin-top: 8px !important;
    }

    .card-back-content h2 {
        font-size: clamp(1.2rem, 4.2vw, 1.6rem) !important;
        margin-bottom: 15px !important;
    }

    .card-back-content ul li {
        font-size: clamp(0.7rem, 2.2vw, 0.95rem) !important;
        margin-bottom: 10px !important;
    }

    .card-back-content ul li b {
        font-size: clamp(0.75rem, 2.4vw, 1rem);
    }

    /* Experience Cards */
    .exp-card {
        padding: 20px;
    }

    .project-card {
        padding: 25px;
    }

    .exp-content h3 {
        font-size: 1.2rem;
    }

    .role-badge {
        font-size: 1rem;
    }

    /* Education Cards */
    .edu-card {
        padding: 20px;
    }

    .edu-card h2 {
        font-size: 1.5rem;
    }

    .edu-card img {
        width: 100px;
    }

    /* Contact */
    .contact-trigger {
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
    }

    .modal-card {
        padding: 1.25rem;
    }
}

/* Small Mobile (375px) */
@media (max-width: 375px) {
    .flip-card {
        min-height: calc(100vh - 140px);
    }

    .flip-card-inner {
        min-height: calc(100vh - 140px);
    }

    .flip-card-front, .flip-card-back {
        min-height: calc(100vh - 140px);
        padding: 3.5vw;
    }

    .hero-text h1 {
        font-size: clamp(1.4rem, 5.5vw, 2rem) !important;
    }

    .hero-text p {
        font-size: clamp(0.7rem, 2.3vw, 0.95rem) !important;
    }

    .card-back-content h2 {
        font-size: clamp(1.1rem, 4vw, 1.5rem) !important;
    }

    .card-back-content ul li {
        font-size: clamp(0.65rem, 2.1vw, 0.9rem) !important;
        margin-bottom: 8px !important;
    }

    .card-back-content ul li b {
        font-size: clamp(0.7rem, 2.3vw, 0.95rem);
    }

    .circular-pfp {
        width: clamp(90px, 26vw, 120px);
        height: clamp(90px, 26vw, 120px);
        min-width: clamp(90px, 26vw, 120px);
        min-height: clamp(90px, 26vw, 120px);
    }
}

/* Final mobile nav consistency override (applies across all pages) */
@media (max-width: 768px) {
    nav {
        padding: 33.33px 0 !important;
    }

    nav .nav-links {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        padding: 0 8px;
    }

    nav .nav-links a {
        font-size: 0.82rem !important;
        margin: 0 !important;
        padding: 6px 10px !important;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 33.33px 0 !important;
    }

    nav .nav-links {
        gap: 6px !important;
        padding: 0 6px;
    }

    nav .nav-links a {
        font-size: 0.76rem !important;
        padding: 5px 8px !important;
    }
}