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

:root {
    --bg: #f8f6f0;
    --text: #2c3e50;
    --muted: #34495e;
    --card: rgba(255,255,255,0.95);
    --accent1: #3498db;
    --accent2: #2ecc71;
    --accent3: #f39c12;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

/* Dark theme */
body.dark {
    --bg: #0f141a;
    --text: #e6edf3;
    --muted: #9aa7b3;
    --card: rgba(17, 24, 31, 0.9);
    --accent1: #58a6ff;
    --accent2: #3fb950;
    --accent3: #f2cc60;
}

/* Top Navigation */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(44, 62, 80, 0.9);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    color: #ecf0f1;
    font-weight: 700;
    letter-spacing: 1px;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.nav-link {
    color: #ecf0f1;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font: inherit;
}

.btn-primary {
    background: var(--accent1);
    color: #fff;
}

/* Vintage Background */
.vintage-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 226, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.container {
    max-width: 900px;
    margin: 20px auto 40px;
    background: var(--card);
    backdrop-filter: blur(10px);
    box-shadow: 
        0 0 0 1px rgba(0,0,0,0.1),
        0 20px 40px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.8);
    border-radius: 8px;
    overflow: hidden;
    animation: containerFloat 6s ease-in-out infinite;
}

@keyframes containerFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(255,255,255,0.03) 2px,
        rgba(255,255,255,0.03) 4px
    );
    animation: patternMove 30s linear infinite;
}

@keyframes patternMove {
    0% { transform: translate(-50px, -50px); }
    100% { transform: translate(50px, 50px); }
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 40px;
    position: relative;
    z-index: 2;
}

.profile-pic {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 4px solid rgba(255,255,255,0.2);
    animation: imageGlow 4s ease-in-out infinite;
}

@keyframes imageGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255,255,255,0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255,255,255,0.5);
        transform: scale(1.02);
    }
}

.profile-frame {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    animation: frameRotate 15s linear infinite;
}

@keyframes frameRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.name-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    animation: titleSlide 1s ease-out;
}

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

.subtitle {
    font-size: 1.4rem;
    opacity: 0.9;
    margin-bottom: 15px;
    animation: subtitleFade 1.5s ease-out;
}

@keyframes subtitleFade {
    0% { opacity: 0; }
    100% { opacity: 0.9; }
}

.location {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 20px;
}

.decorative-line {
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent1), var(--accent2), var(--accent3));
    border-radius: 2px;
    animation: lineGrow 2s ease-out, lineShimmer 3s ease-in-out infinite 2s;
}

@keyframes lineGrow {
    0% { width: 0; }
    100% { width: 100px; }
}

@keyframes lineShimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Contact Bar */
.contact-bar {
    background: #34495e;
    padding: 20px 40px;
    display: flex;
    justify-content: center;
    gap: 40px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.contact-link:hover::before {
    left: 100%;
}

.contact-link:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.contact-link i {
    font-size: 1.2rem;
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Main Content */
.main-content {
    padding: 40px;
}

.section {
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    border-left: 4px solid var(--accent1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    position: relative;
    animation: sectionSlideIn 0.8s ease-out;
}

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

.section:nth-child(even) {
    border-left-color: var(--accent2);
}

.section:nth-child(3n) {
    border-left-color: var(--accent3);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.section-icon {
    font-size: 1.8rem;
    color: #3498db;
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--text);
    font-weight: 600;
}

.summary-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--muted);
    text-align: justify;
}

/* Decorative wave */
.wave { color: rgba(44,62,80,0.08); }
.wave svg { display: block; width: 100%; height: 60px; }

/* Timeline */
.timeline { position: relative; margin-left: 10px; }
.timeline::before { content: ""; position: absolute; left: 14px; top: 0; bottom: 0; width: 2px; background: rgba(52, 152, 219, 0.3); }
.timeline-item { position: relative; margin: 0 0 24px 0; padding-left: 40px; }
.timeline-dot { position: absolute; left: 8px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent1); box-shadow: 0 0 0 4px rgba(52,152,219,0.15); }
.timeline-content { background: rgba(255,255,255,0.08); border-left: 3px solid var(--accent1); padding: 16px; border-radius: 6px; }
.timeline-meta { font-size: 0.9rem; color: var(--muted); margin: 6px 0 10px; }
.timeline-tags { display: flex; gap: 8px; list-style: none; flex-wrap: wrap; }
.timeline-tags li { background: rgba(52,152,219,0.15); color: var(--text); padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; }

/* Stats counters */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.stat-card { text-align: center; background: rgba(255,255,255,0.08); padding: 20px; border-radius: 8px; border-left: 3px solid var(--accent2); }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--accent2); }
.stat-label { color: var(--muted); font-size: 0.95rem; }

/* CTA section */
.cta-section { text-align: center; background: rgba(52,152,219,0.08); border-left-color: var(--accent1); }
.cta-section h2 { margin-bottom: 10px; }
.cta-section p { color: var(--muted); margin-bottom: 16px; }
.cta-btn { font-weight: 600; }

/* Education */
.education-item {
    background: rgba(52, 152, 219, 0.08);
    padding: 25px;
    border-radius: 6px;
    border-left: 3px solid var(--accent1);
}

.degree-info h3 {
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 8px;
}

.institution {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.year {
    font-weight: 600;
    color: var(--accent1);
}

/* Skills */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.skill-group {
    background: rgba(46, 204, 113, 0.08);
    padding: 20px;
    border-radius: 6px;
    border-left: 3px solid var(--accent2);
}

.skill-group h4 {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 15px;
    font-weight: 600;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-item {
    background: #2c3e50;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    animation: skillFloat 4s ease-in-out infinite;
}

.skill-item:nth-child(2n) {
    animation-delay: 0.5s;
}

.skill-item:nth-child(3n) {
    animation-delay: 1s;
}

@keyframes skillFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.skill-item:hover {
    background: var(--accent1);
    transform: translateY(-3px) scale(1.05);
}

/* Projects */
.project-card {
    background: rgba(243, 156, 18, 0.08);
    padding: 25px;
    border-radius: 6px;
    border-left: 3px solid var(--accent3);
}

.project-card h3 {
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 15px;
}

.project-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 20px;
    text-align: justify;
}

.project-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.highlight {
    background: var(--accent3);
    color: white;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: highlightGlow 3s ease-in-out infinite;
}

@keyframes highlightGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(243, 156, 18, 0.3); }
    50% { box-shadow: 0 0 15px rgba(243, 156, 18, 0.6); }
}

/* Competencies */
.competencies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.competency-item {
    background: rgba(155, 89, 182, 0.08);
    padding: 25px;
    border-radius: 6px;
    border-left: 3px solid #9b59b6;
    text-align: center;
    transition: all 0.3s ease;
}

.competency-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.competency-icon {
    font-size: 2.5rem;
    color: #9b59b6;
    margin-bottom: 15px;
    animation: competencyRotate 8s linear infinite;
}

@keyframes competencyRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.competency-item h4 {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 10px;
    font-weight: 600;
}

.competency-item p {
    font-size: 0.95rem;
    color: #9aa7b3;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 30px 40px;
    text-align: center;
}

.footer-content p {
    font-size: 1rem;
    margin-bottom: 15px;
}

.footer-decoration {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    margin: 0 auto;
    border-radius: 1px;
    animation: decorationPulse 2s ease-in-out infinite;
}

@keyframes decorationPulse {
    0%, 100% { width: 60px; opacity: 1; }
    50% { width: 80px; opacity: 0.7; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-inner { flex-wrap: wrap; }
    .nav-links { flex: 1 1 100%; justify-content: center; }
    #downloadBtn { width: 100%; justify-content: center; }
    .container {
        margin: 10px;
    }
    
    .header {
        padding: 28px 16px;
    }
    
    .profile-section {
        flex-direction: column;
        text-align: center;
        gap: 25px;
    }
    
    .profile-pic {
        width: 150px;
        height: 150px;
    }
    
    .name-title {
        font-size: 2.4rem;
    }
    
    .contact-bar { flex-direction: column; gap: 12px; align-items: center; padding: 14px 16px; }
    
    .main-content { padding: 18px; }
    
    .skills-container { grid-template-columns: 1fr; }
    
    .competencies-grid { grid-template-columns: 1fr; }

    .section { padding: 22px; }
    .summary-text { font-size: 1rem; line-height: 1.7; }
    .stat-number { font-size: 1.8rem; }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Print styles for PDF export */
@media print {
    @page { margin: 12mm; }
    body { background: #fff; }
    .vintage-bg, .top-nav, .profile-frame { display: none !important; }
    .container { box-shadow: none; margin: 0; max-width: 100%; }
    .section { break-inside: avoid; page-break-inside: avoid; }
    a::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
    .contact-link { color: #000 !important; background: none !important; }
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: none;
    background: var(--accent1);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 12px;
    z-index: 1001;
}
.skip-link:focus { top: 0; }
