:root{
    color-scheme: light dark;

    /* Brand */
    --primary:#2563eb;
    --primary-hover:#1d4ed8;
    --accent:#0ea5e9;

    /* Light Theme */
    --bg:#ffffff;
    --bg-secondary:#f8fafc;
    --surface:#ffffff;

    --text:#1e293b;
    --text-secondary:#64748b;

    --border:#e2e8f0;

    --hero-gradient:
        linear-gradient(135deg,#2563eb,#0ea5e9);

    --shadow:
        0 10px 30px rgba(0,0,0,.08);
}

/* Dark Theme */

@media (prefers-color-scheme: dark){

    :root{

        --primary:#60a5fa;
        --primary-hover:#93c5fd;
        --accent:#38bdf8;

        --bg:#0f172a;
        --bg-secondary:#111827;
        --surface:#1e293b;

        --text:#f8fafc;
        --text-secondary:#94a3b8;

        --border:#334155;

        --hero-gradient:
            linear-gradient(
                135deg,
                #1e3a8a,
                #0369a1
            );

        --shadow:
            0 10px 30px rgba(0,0,0,.45);
    }
}

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

    transition:
        background-color .3s ease,
        color .3s ease,
        border-color .3s ease;
}

html{
    scroll-behavior:smooth;
}

body{
    font-family:'Inter',sans-serif;
    background:var(--bg);
    color:var(--text);
    line-height:1.6;
}

/* Layout */

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

section{
    padding:80px 0;
}

.section-title{
    text-align:center;
    margin-bottom:50px;
}

.section-title h2{
    font-size:2.5rem;
    margin-bottom:10px;
}

.section-title p{
    color:var(--text-secondary);
}

h1,h2,h3,h4{
    color:var(--text);
    line-height:1.2;
}

p,
li,
.caption,
.stat-label{
    color:var(--text-secondary);
}

/* Navigation */

.navbar{
    position:sticky;
    top:0;
    z-index:1000;

    background:var(--surface);
    border-bottom:1px solid var(--border);

    box-shadow:0 2px 15px rgba(0,0,0,.05);
    backdrop-filter:blur(12px);
}

.nav-container{
    display:flex;
    justify-content:space-between;
    align-items:center;
    height:70px;
}

.logo{
    font-size:1.2rem;
    font-weight:700;
    color:var(--primary);
}

.nav-links{
    list-style:none;
    display:flex;
    gap:30px;
}

.nav-links a{
    text-decoration:none;
    color:var(--text);
    font-weight:600;
}

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

/* Buttons */

.btn{
    display:inline-block;
    padding:14px 28px;
    border-radius:8px;
    text-decoration:none;
    font-weight:600;
    transition:.3s;
}

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

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

.btn-outline{
    border:2px solid white;
    color:white;
}

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

/* Hero */

header{
    background:var(--hero-gradient);
    color:white;
    padding:120px 0;
}

.hero{
    display:grid;
    grid-template-columns:2fr 1fr;
    gap:60px;
    align-items:center;
}

.hero-content h1{
    font-size:4rem;
    color:white;
    margin-bottom:15px;
}

.hero-content h2{
    color:white;
    opacity:.9;
    font-weight:400;
    margin-bottom:25px;
}

.hero-content p{
    color:white;
    font-size:1.1rem;
    margin-bottom:30px;
}

.hero-buttons{
    display:flex;
    flex-wrap:wrap;
    gap:15px;
}

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

.btn-contact:hover{
    background:transparent;
    color:white;
}

.hero-card{
    background:rgba(255,255,255,.95);
    color:#0f172a;

    border:1px solid rgba(255,255,255,.3);
    border-radius:20px;

    padding:35px;

    backdrop-filter:blur(12px);

    box-shadow:
        0 20px 40px rgba(0,0,0,.15);
}

.hero-card h3,
.hero-card strong{
    color:#0f172a;
}

.hero-card li {
    list-style-type: none;
}

@media (prefers-color-scheme: dark){

    .hero-card{
        background:rgba(15,23,42,.85);
        color:#f8fafc;

        border:1px solid rgba(255,255,255,.08);
    }

    .hero-card h3,
    .hero-card strong{
        color:#ffffff;
    }
}

.hero-metric{
    line-height:1.8;
}

/* Statistics */

.stats-section{
    padding:50px 0;
}

.stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:25px;
}

.stat-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:16px;
    padding:35px;
    text-align:center;
    box-shadow:var(--shadow);
}

.stat-number{
    font-size:3rem;
    font-weight:800;
    color:var(--primary);
}

/* About */

.about{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:60px;
    align-items:center;
}

.skills{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:15px;
}

.skill{
    background:var(--bg-secondary);
    border:1px solid var(--border);
    border-radius:8px;
    padding:12px 16px;
    font-weight:500;
    color:var(--text);
}

/* Products */

.projects{
    background:var(--bg-secondary);
}

.project{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:20px;
    overflow:hidden;
    margin-bottom:40px;
    box-shadow:var(--shadow);
}

.project-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
}

.project-image{
    min-height:350px;
    background:linear-gradient(
        135deg,
        rgba(37,99,235,.15),
        rgba(14,165,233,.15)
    );
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:1.5rem;
    font-weight:700;
    color:var(--primary);
}

.project-image img {
    max-height: 300px;
}

.project-content{
    padding:40px;
}

.project-content ul {
    margin-left: 20px;
}

.project-actions{
    display:flex;
    gap:12px;
    margin-top:30px;
    flex-wrap:wrap;
}

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

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

/* Screenshot Gallery */

.screenshot-grid{
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(280px,1fr));
    gap:25px;
}

.screenshot-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:18px;
    overflow:hidden;
    box-shadow:var(--shadow);
}

.screenshot-card img{
    width:100%;
    height:250px;
    object-fit:cover;
    display:block;
}

.caption{
    padding:18px;
    font-weight:600;
}

/* Tech */

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

.tech-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:15px;
    padding:30px;
    box-shadow:var(--shadow);
}

.tech-card h3{
    color:var(--primary);
    margin-bottom:15px;
}

/* Architecture */

.architecture-intro{
    max-width:900px;
    margin:0 auto 50px;
    text-align:center;
}

.architecture-intro p{
    margin-bottom:20px;
}

.architecture-diagram{
    margin-top:60px;
    text-align:center;
}

.architecture-diagram h3{
    margin-bottom:30px;
}

.architecture-flow{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:15px;
    flex-wrap:wrap;
}

.arch-box{
    min-width:175px;
    padding:25px;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:15px;
    box-shadow:var(--shadow);

    font-weight:600;
}

.arch-box span{
    display:block;
    margin-top:8px;
    font-size:.9rem;
    color:var(--text-secondary);
    font-weight:400;
}

.arch-arrow{
    font-size:2rem;
    color:var(--primary);
    font-weight:bold;
}

.architecture-highlights{
    margin-top:60px;
}

.architecture-highlights h3{
    text-align: center;
    margin-bottom:20px;
}

.architecture-highlights ul{
    max-width:900px;
    margin:auto;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(350px,1fr));
    gap:12px 40px;
}

.architecture-highlights li{
    list-style:none;
    position:relative;
    padding-left:24px;
}

.architecture-highlights li::before{
    content:"✓";
    position:absolute;
    left:0;
    color:var(--primary);
    font-weight:bold;
}

/* Case Study */

.case-study{
    background:var(--bg-secondary);
    text-align:center;
}

.case-study h2{
    margin-bottom:20px;
}

.case-study p{
    max-width:800px;
    margin:auto;
}

/* Timeline */

.timeline{
    max-width:800px;
    margin:auto;
}

.timeline-item{
    border-left:4px solid var(--primary);
    padding-left:25px;
    margin-bottom:40px;
}

.timeline-item h3{
    color:var(--primary);
}

/* Testimonials */

.testimonials{
    background:var(--bg-secondary);
}

.testimonial-grid{
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(300px,1fr));
    gap:25px;
}

.testimonial{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:15px;
    padding:30px;
    box-shadow:var(--shadow);
}

/* Contact */

.contact{
    text-align:center;
}

.contact-intro{
    max-width:700px;
    margin:0 auto 40px;
    text-align:center;
}

.contact-card p{
    margin-top:12px;
    font-size:.95rem;
    color:var(--text-secondary);
}

.contact-links{
    display:grid;
    grid-template-columns:
        repeat(auto-fit,minmax(250px,1fr));
    gap:25px;
    margin-top:50px;
}

.contact-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:16px;
    padding:30px;
    box-shadow:var(--shadow);
}

.contact-card h3{
    margin-bottom:12px;
    color:var(--primary);
}

.contact-card a{
    color:var(--text);
    text-decoration:none;
    font-weight:500;
    word-break:break-word;
}

.contact-card a:hover{
    color:var(--primary);
}

/* Footer */

footer{
    background:var(--bg-secondary);
    border-top:1px solid var(--border);
    text-align:center;
    padding:30px;
}

/* Dark Mode Screenshot Tuning */

@media (prefers-color-scheme: dark){

    .screenshot-card img{
        filter:brightness(.92);
    }

}

/* Responsive */

@media(max-width:900px){

    .hero,
    .about,
    .project-grid{
        grid-template-columns:1fr;
    }

    .hero-content h1{
        font-size:2.8rem;
    }

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

    .nav-links{
        display:none;
    }

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