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

:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --accent-color: #10b981;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --text-light: #f8fafc;
    --text-gray: #94a3b8;
    --card-bg: #1e293b;
    --border-color: #334155;
}

/* Font Loading and Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Device-specific font adjustments */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    /* High DPI displays (Retina, etc.) */
    body {
        font-weight: 400;
        letter-spacing: -0.01em;
    }
}

/* Android specific */
@media screen and (max-width: 768px) and (-webkit-min-device-pixel-ratio: 1) {
    body {
        font-family: 'Inter', 'Roboto', 'Droid Sans', sans-serif;
        font-size: 14px;
        line-height: 1.5;
    }
    
    .hero-title {
        font-size: 2.2rem !important;
        line-height: 1.2;
    }
    
    .section-title {
        font-size: 2rem !important;
    }
}

/* iOS/Mac specific */
@media screen and (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    body {
        font-family: 'Inter', -apple-system, 'San Francisco', 'Helvetica Neue', sans-serif;
        font-size: 15px;
        font-weight: 400;
    }
    
    .hero-title {
        font-size: 2.4rem !important;
        font-weight: 700;
    }
}

/* Desktop fonts */
@media screen and (min-width: 1024px) {
    body {
        font-size: 17px;
        line-height: 1.7;
    }
    
    .hero-title {
        font-size: 4rem;
        font-weight: 800;
        letter-spacing: -0.02em;
    }
}

/* Code elements */
code, .project-tech, .skill-tag {
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-weight: 500;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    padding-top: 80px;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.hero-image {
    display: flex;
    justify-content: center;
}

.hero-image {
    display: flex;
    justify-content: center;
}

.avatar {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
}

.avatar-placeholder {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
    color: white;
}

/* Section Styles */
section {
    padding: 80px 0;
}

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

/* About Section */
.about {
    background: var(--bg-darker);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Projects Section */
.projects {
    background: var(--bg-darker);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
}

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

.project-image {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.project-tech {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.project-content p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Experience Section */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    width: 45%;
    border: 1px solid var(--border-color);
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-gray);
}

/* Contact Section */
.contact {
    background: var(--bg-darker);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

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

.contact-link i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-link:hover i {
    color: white;
}

/* Footer */
.footer {
    background: var(--bg-darker);
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Project Detail Pages */
.project-detail {
    min-height: 100vh;
    background: var(--bg-dark);
}

.project-header {
    text-align: center;
    margin-bottom: 4rem;
}

.project-header h1 {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.project-subtitle {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
    font-family: 'JetBrains Mono', monospace;
}

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

.project-content {
    max-width: 800px;
    margin: 0 auto;
}

.project-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.project-content p {
    color: var(--text-gray);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.project-overview,
.tech-stack,
.features,
.development-process,
.project-impact {
    margin-bottom: 3rem;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

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

.tech-item {
    background: var(--primary-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.feature-list,
.process-list {
    list-style: none;
    padding: 0;
}

.feature-list li,
.process-list li {
    color: var(--text-gray);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.feature-list i {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.process-list li {
    padding-left: 1.5rem;
    position: relative;
}

.process-list li::before {
    content: '•';
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* Responsive adjustments for project pages */
@media (max-width: 768px) {
    .project-header h1 {
        font-size: 2.2rem;
    }
    
    .project-content {
        padding: 0 1rem;
    }
    
    .project-overview,
    .tech-stack,
    .features,
    .development-process,
    .project-impact {
        padding: 1.5rem;
    }
}
@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        flex-direction: row !important;
        padding-left: 50px;
    }
    
    .timeline-dot {
        left: 20px;
    }
    
    .timeline-content {
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }
}
