/* Modern Portfolio CSS - Inspired by itssharl.ee */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #3b82f6;
    --accent-secondary: #8b5cf6;
    --border-color: #1a1a1a;
    --font-primary: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Bubble Effect Canvas */
canvas {
    background: transparent !important;
    position: fixed !important;
    z-index: -999 !important;
    pointer-events: none !important;
    top: 0 !important;
    left: 0 !important;
}


/* Enhanced background with subtle gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.03) 0%, rgba(10, 10, 10, 0.8) 70%);
    pointer-events: none;
    z-index: -1000;
}

/* Ensure text content is always on top */
.main-content {
    position: relative;
    z-index: 10;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

.main-content.visible {
    opacity: 1;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    backdrop-filter: blur(10px);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

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

.loading-text {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Avatar Section */
.avatar-section {
    padding: 4rem 0 2rem;
    text-align: center;
}

.avatar-container {
    display: inline-block;
    position: relative;
}

.main-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 3px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: avatarFloat 6s ease-in-out infinite;
}

.main-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

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

/* Hero Section */
.hero-section {
    padding: 2rem 0 4rem;
    text-align: center;
}

.greeting {
    margin-bottom: 3rem;
}

.greeting-text {
    display: block;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    animation: slideInUp 0.8s ease 1s both;
}

.name-primary {
    display: block;
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.1;
    animation: slideInUp 0.8s ease 1.2s both;
}

/* Small domain caption to unify branding (non-intrusive) */
.brand-caption {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.4rem;
    opacity: 0.9;
}

.intro-text {
    margin-bottom: 3rem;
}

.role-description {
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.4;
}

.role-line {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text-secondary);
    animation: slideInUp 0.8s ease both;
}

.role-line:nth-child(1) { animation-delay: 1.4s; }
.role-line:nth-child(2) { animation-delay: 1.6s; }
.role-line:nth-child(3) { animation-delay: 1.8s; }

.role-line strong {
    color: var(--text-primary);
    font-weight: 600;
}

.action-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.action-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 400;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
    animation: slideInUp 0.8s ease both;
}

/* Improve contrast on interactive links for accessibility */
.action-link,
.project-link,
.social-link,
.contact-link {
    color: #cfd8ff; /* slightly brighter for contrast */
}

/* Visually hidden helper for accessibility */
.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
    border: 0; padding: 0; margin: -1px;
}

.action-link:nth-child(1) { animation-delay: 2s; }
.action-link:nth-child(2) { animation-delay: 2.2s; }
.action-link:nth-child(3) { animation-delay: 2.4s; }

.action-link:hover {
    color: var(--text-primary);
    transform: translateX(10px);
}

.arrow {
    color: var(--accent-color);
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.action-link:hover .arrow {
    transform: translateX(5px);
}

/* Prevent any unwanted transforms on text elements */
.section-title,
.tech-category h3,
.tech-item,
.project-title,
.project-description,
.contact-info,
.greeting,
.role-description {
    transform: none !important;
    position: relative;
    z-index: 10;
}

/* Ensure all content sections are above background effects */
.hero-section,
.skills-section,
.projects-section,
.contact-section,
.footer {
    position: relative;
    z-index: 10;
}

/* Sections */
.skills-section,
.projects-section,
.contact-section {
    padding: 4rem 0;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-primary);
}

/* Skills Section */
.skills-section {
    position: relative;
    z-index: 10;
    background: transparent;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
    position: relative;
    z-index: 10;
}

.tech-category {
    text-align: center;
    position: relative;
    z-index: 10;
    transform: none !important; /* Prevent any unwanted transforms */
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.tech-category h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    position: relative;
    z-index: 10;
}

.tech-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    position: relative;
    z-index: 10;
    min-height: 80px; /* Ensure minimum height to prevent overlap */
}

.tech-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    white-space: nowrap; /* Prevent text wrapping */
    margin-bottom: 0.4rem; /* Add vertical spacing */
}

.tech-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Container scaling for magnification effect */
.tech-item, .project-item, .about-card, .spec-item, .stat-item,
.contact-item, .action-link, .project-link, .social-link,
.tech-category, .project-content, .about-card-content,
.hero-content, .contact-content, .specializations {
    transform-origin: center;
    transition: transform 0.3s ease-out, z-index 0.3s ease-out;
    position: relative;
}

/* Ensure containers can expand without breaking layout */
.tech-grid, .projects-grid, .about-grid, .contact-content,
.specializations, .stats-grid {
    overflow: visible;
}

/* Prevent text truncation during magnification */
.tech-item, .project-item, .about-card, .spec-item, .stat-item {
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: normal !important;
}

/* Special handling for cards that might clip content */
.about-card, .project-item {
    border-radius: 8px;
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.about-card:hover, .project-item:hover {
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.15);
}

/* Responsive design for tech section */
@media (max-width: 768px) {
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 2rem;
    }
    
    .tech-category {
        padding: 1.2rem;
    }
    
    .tech-items {
        gap: 0.6rem;
        min-height: 60px;
    }
    
    .tech-item {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* About Section */
.about-section {
    background: transparent;
    padding: 4rem 0;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.about-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    width: 100%;
    box-sizing: border-box;
}

.about-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.about-card:hover::before {
    transform: scaleX(1);
}

.about-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.1);
}

.about-card-content {
    position: relative;
    z-index: 2;
}

.about-card-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.about-card-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.main-intro {
    grid-column: 1 / -1;
}

.specializations {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.spec-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.spec-icon {
    font-size: 1.2rem;
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    transition: transform 0.3s ease;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.stat-item:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.05);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-secondary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .main-intro {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .main-intro {
        grid-column: 1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .about-card {
        padding: 1.5rem;
        min-height: auto;
    }
    
    .spec-item {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .about-card-content h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
}

/* Projects Section */
.projects-grid {
    display: grid;
    gap: 3rem;
    margin-top: 2rem;
}

.project-item {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.project-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.1);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

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

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--accent-color);
    color: var(--text-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.project-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.project-link:hover {
    color: var(--text-primary);
}

.project-link:hover::after {
    width: 100%;
}

/* Contact Section */
.contact-content {
    text-align: center;
}

/* Contact form styles (simple, accessible) */
.contact-form {
    margin-top: 2rem;
    display: grid;
    gap: 0.75rem;
    max-width: 420px; /* narrower form */
    margin-left: auto;
    margin-right: auto;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.5rem 0.9rem; /* reduced padding */
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.015);
    color: var(--text-primary);
    font-size: 0.95rem; /* slightly smaller text */
}

.contact-button {
    display: inline-block;
    padding: 0.45rem 0.85rem; /* even more compact */
    border-radius: 8px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    max-width: 200px; /* smaller max width */
}

/* Enhanced compact button visuals */
.contact-button {
    box-shadow: 0 6px 18px rgba(18, 52, 86, 0.18);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.contact-button:active {
    transform: translateY(1px) scale(0.997);
    box-shadow: 0 4px 10px rgba(18, 52, 86, 0.12);
}

/* mailto icon/link next to email */
/* mailto-link removed - styles intentionally left out */

/* visually-hidden helper (for aria-live region) */
.visually-hidden {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.contact-button:focus,
.contact-button:hover {
    transform: translateY(-2px);
}

.contact-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.contact-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 400;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.contact-link:hover {
    color: var(--text-primary);
    transform: translateX(10px);
}

.contact-link .arrow {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

/* Footer */
.footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Magnification Effect Styles for Bubble Interaction */
.magnified-text {
    position: relative;
    z-index: 10;
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Ensure text elements can be magnified smoothly */
h1, h2, h3, h4, h5, h6,
.greeting-text, .name-primary, .role-description, .role-line,
.section-title, .section-subtitle,
.tech-title, .tech-item,
.about-card h3, .about-card p,
.project-item h3, .project-item p,
.contact-item h4, .contact-item p,
.spec-item span, .stat-label, .stat-number,
.project-link, .social-link, .action-link,
.tag {
    will-change: transform, filter;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Special handling for text that might be magnified */
.tech-item:hover,
.project-link:hover,
.social-link:hover,
.action-link:hover {
    transform: translateX(5px) !important;
}

/* Ensure magnification doesn't break layout */
.tech-grid, .projects-grid, .about-grid, .contact-content {
    isolation: isolate;
}

/* Enhanced visibility for magnified elements */
.section-title,
.name-primary,
.greeting-text {
    position: relative;
    overflow: visible;
}

/* Smooth magnification transitions */
@supports (transform: scale(1.1)) {
    .magnified-text {
        transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                   filter 0.25s ease-out,
                   text-shadow 0.25s ease-out;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .greeting-text {
        font-size: 1.5rem;
    }
    
    .name-primary {
        font-size: 2.8rem;
    }
    
    .role-description {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .main-avatar {
        width: 100px;
        height: 100px;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-item {
        padding: 1.5rem;
    }
    
    .contact-details {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .name-primary {
        font-size: 2.2rem;
    }
    
    .role-description {
        font-size: 1.1rem;
    }
    
    .main-avatar {
        width: 80px;
        height: 80px;
    }
}
