/* =========================================
   GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-blue: #6366f1;
    --accent-blue-light: #e0e7ff;
    --accent-dark: #0f172a;
    --border-color: #e2e8f0;
    
    /* GenZ Vibe Variables */
    --genz-grad: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --genz-grad-text: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    /* Subtle dot grid graphic spanning the portfolio */
    background-image: radial-gradient(rgba(100, 116, 139, 0.15) 1px, transparent 1px);
    background-size: 25px 25px;
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--accent-dark);
    margin-bottom: 0.5rem;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

li {
    list-style: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.section-heading {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: var(--genz-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    padding-bottom: 0.5rem;
    position: relative;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60%;
    height: 4px;
    background: var(--genz-grad);
    border-radius: 4px;
}

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

/* =========================================
   PAGE SCREEN LAYOUT
   ========================================= */
.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden; /* For background graphics */
}

/* Page by Page Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.page:last-child {
    border-bottom: none;
}

/* GenZ aesthetic vibrant blobs */
.page:not(.cover-page):not(.contact-section)::before {
    content: '';
    position: absolute;
    top: -150px;
    right: -150px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 0;
    animation: floatBlob 8s ease-in-out infinite alternate;
}

.page:not(.cover-page):not(.contact-section)::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 0;
    animation: floatBlob 10s ease-in-out infinite alternate-reverse;
}

@keyframes floatBlob {
    0% { transform: translate(0px, 0px) scale(1); }
    100% { transform: translate(-30px, 40px) scale(1.1); }
}

/* Ensure foreground content stays above graphics */
.page .container {
    position: relative;
    z-index: 1;
}

.page:last-child {
    border-bottom: none;
}

/* =========================================
   COVER PAGE
   ========================================= */
.cover-page {
    position: relative;
    background-color: var(--accent-dark);
    color: var(--bg-primary);
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

/* Subtle schematic/blueprint background */
.cover-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.8;
    animation: scrollGrid 15s linear infinite;
}

/* Subtle glowing orb effect in the background */
.cover-page::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
    border-radius: 50%;
    z-index: 1;
    animation: pulseGlow 8s ease-in-out infinite alternate;
}

@keyframes scrollGrid {
    0% {
        background-position: 0px 0px;
    }

    100% {
        background-position: 40px 40px;
    }
}

@keyframes pulseGlow {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
    }
}

.cover-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 3rem;
}

.name-title {
    font-size: 5rem;
    font-weight: 800;
    background: var(--genz-grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    line-height: 1;
    filter: drop-shadow(0px 4px 10px rgba(168, 85, 247, 0.3));
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s ease, background-position 0.6s ease;
    animation: dropIn 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.name-title:hover {
    transform: perspective(600px) translateZ(40px) rotateX(10deg) scale(1.05);
    filter: drop-shadow(0px 15px 30px rgba(56, 189, 248, 0.8));
    background-position: 100% 50%;
}

.job-title {
    font-size: 1.8rem;
    font-weight: 400;
    color: #cbd5e1;
    margin-bottom: 2rem;
    font-family: var(--font-body);
    text-transform: lowercase; /* GenZ touch */
    letter-spacing: 1px;
    transition: letter-spacing 0.4s ease, color 0.4s ease, text-shadow 0.4s ease;
    animation: fadeIn 1.5s ease 0.5s both;
}

.job-title:hover {
    letter-spacing: 4px;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
}

@keyframes dropIn {
    0% { transform: translateY(-30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.cover-page .divider {
    height: 4px;
    width: 80px;
    background: var(--genz-grad);
    border-radius: 10px;
    margin: 0 auto 2rem;
}

.cover-page .summary {
    font-size: 1.1rem;
    color: #cbd5e1;
    max-width: 600px;
    margin: 0 auto;
}

/* =========================================
   ABOUT ME
   ========================================= */
.about-section {
    background-color: transparent;
}

.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
    align-items: center;
}

.text-block p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.about-grid img {
    border-radius: 24px !important;
    box-shadow: var(--glass-shadow);
    transition: transform 0.4s ease;
}

.about-grid img:hover {
    transform: rotate(2deg) scale(1.05);
}

.image-placeholder {
    background-color: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================================
   EDUCATION & SKILLS
   ========================================= */
.education-skills {
    background-color: var(--bg-secondary);
    /* Subtle diagonal stripe background graphic */
    background-image: repeating-linear-gradient(45deg,
            rgba(0, 0, 0, 0.02) 0px,
            rgba(0, 0, 0, 0.02) 2px,
            transparent 2px,
            transparent 8px);
}

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

/* Timeline */
.timeline {
    border-left: 3px solid var(--accent-blue);
    padding-left: 2rem;
    margin-top: 1rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.65rem;
    top: 5px;
    width: 16px;
    height: 16px;
    background: var(--genz-grad);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
    border-radius: 50%;
}

.timeline-item .year {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    background-color: var(--accent-blue-light);
    color: var(--accent-blue);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 0.5rem;
}

.timeline-item h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.timeline-item .institution {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.timeline-item .details {
    font-size: 0.95rem;
}

/* Skills */
.skill-category {
    margin-bottom: 1.5rem;
}

.skill-category h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    font-family: var(--font-body);
    font-weight: 600;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.badge {
    padding: 0.6rem 1.2rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-blue);
    backdrop-filter: blur(5px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--glass-shadow);
}

.badge:hover {
    background: var(--genz-grad);
    color: white;
    transform: translateY(-3px) scale(1.05);
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.3);
}

.badge.alt {
    background: var(--accent-dark);
    color: var(--bg-primary);
    border: none;
}

/* =========================================
   PROJECTS SECTION
   ========================================= */
.projects-section {
    background-color: transparent;
    display: block;
    /* Overriding flex to allow scrolling */
    padding: 4rem 0;
}

.project-card {
    display: flex;
    flex-direction: row;
    gap: 3rem;
    margin-bottom: 6rem;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.4s ease, opacity 0.8s ease;
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-card.reverse {
    flex-direction: row-reverse;
}

.project-info {
    flex: 1;
}

.project-info h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.project-info .tech-stack {
    font-size: 0.9rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.project-info .description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.features-list {
    margin-left: 1rem;
}

.features-list li {
    position: relative;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.features-list li::before {
    content: '→';
    position: absolute;
    left: -1.2rem;
    color: var(--accent-blue);
    font-weight: bold;
}

.project-image {
    flex: 1.2;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: transform 0.4s ease;
}

.project-image:hover {
    transform: scale(1.03);
}

.project-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   EXPERIENCE & CERTIFICATIONS
   ========================================= */
.experience-certs {
    background-color: var(--bg-secondary);
    /* Subtle diagonal stripe background graphic */
    background-image: repeating-linear-gradient(-45deg,
            rgba(0, 0, 0, 0.02) 0px,
            rgba(0, 0, 0, 0.02) 2px,
            transparent 2px,
            transparent 8px);
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, opacity 0.8s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    font-size: 1.2rem;
}

.card .subtitle {
    font-size: 0.9rem;
    color: var(--accent-blue);
    font-weight: 500;
    margin-bottom: 1rem;
}

.cert-list li {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease, border-color 0.3s ease, opacity 0.8s ease;
}

.cert-list li:hover {
    transform: translateX(5px);
    border-color: rgba(168, 85, 247, 0.4);
}

.cert-title {
    font-weight: 600;
}

.cert-issuer {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   PORTFOLIO HIGHLIGHTS / CONTACT
   ========================================= */
.contact-section {
    background-color: var(--accent-dark);
    /* Faint grid background graphic */
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    color: var(--bg-primary);
    display: block;
    padding: 4rem 0;
}

.contact-section .section-heading {
    color: var(--bg-primary);
    border-bottom-color: var(--accent-blue);
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.highlights-grid img {
    width: 100%;
    border-radius: 4px;
    transition: transform 0.3s;
}

.highlights-grid img:hover {
    transform: translateY(-5px);
}

.contact-box {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-box h2 {
    color: var(--bg-primary);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.contact-methods p {
    font-size: 1.1rem;
}

.contact-methods strong {
    color: var(--accent-blue);
}

/* =========================================
   RESPONSIVE (SCREEN)
   ========================================= */
@media (max-width: 900px) {

    .about-grid,
    .split-layout {
        grid-template-columns: 1fr;
    }

    .project-card,
    .project-card.reverse {
        flex-direction: column;
    }

    .highlights-grid {
        grid-template-columns: 1fr;
    }

    .name-title {
        font-size: 3rem;
    }
}

/* =========================================
   PRINT STYLES FOR PDF EXPORT
   ========================================= */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        background-color: #ffffff;
    }

    .container {
        max-width: 100%;
        padding: 2cm;
    }

    /* Force pages to break accurately */
    .page {
        height: 100vh;
        /* One A4 page per section */
        min-height: unset;
        page-break-after: always;
        break-after: page;
        border: none !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0 !important;
    }

    /* Except projects, which might need to span multiple pages */
    .projects-section {
        height: auto;
        display: block;
    }

    .project-card {
        height: 100vh;
        page-break-after: always;
        break-after: page;
        margin: 0;
        /* Align perfectly into one page */
        padding: 2cm;
        align-items: center;
    }

    /* Cover page special handling */
    .cover-page {
        background-color: var(--accent-dark) !important;
        color: #fff !important;
        page-break-inside: avoid;
    }

    /* Dark sections stay dark for printing accuracy */
    .contact-section {
        background-color: var(--accent-dark) !important;
        color: #fff !important;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .highlights-grid {
        display: none;
        /* Hide visual highlights for PDF layout if making it compact, or keep it. Let's keep it but size appropriately */
    }

    .contact-section .highlights-grid {
        display: grid;
    }

    /* Hide URLs on print links */
    a[href]::after {
        content: none !important;
    }
}