:root {
    /* Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.3);
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(148, 163, 184, 0.1);

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --gradient-text: linear-gradient(to right, #38bdf8, #818cf8);

    /* Spacing */
    --container-padding: 2rem;
    --max-width: 1200px;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

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

/* Typography */
h1,
h2,
h3,
h4 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}

span.highlight {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Utility */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

.btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--accent);
    color: #0f172a;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

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

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.95);
    /* Slightly less transparent for better readability */
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: box-shadow 0.3s;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
    /* Subtle bottom border */
}

header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

nav {
    width: 100%;
    display: flex;
    /* IMPORTANT */
    justify-content: space-between;
    /* IMPORTANT: Ensures separation */
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    /* Clear default margins */
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s;
}

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

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--gradient-hero);
    position: relative;
    padding-top: var(--header-height);
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.hero-text {
    flex: 1;
    max-width: 600px;
    animation: fadeInUp 1s ease-out;
}

.hero-text h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

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

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    position: relative;
    animation: fadeInUp 1.2s ease-out;
}

.phone-mockup {
    width: 300px;
    /* Reduced specific size for banner */
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 30px var(--accent-glow));
    transition: transform 0.3s ease;
}

.phone-mockup:hover {
    transform: scale(1.02);
}

/* Sections */
section {
    padding: 100px 0;
}

/* Service/Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    background: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.skill-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.skill-card i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.skill-card h3 {
    margin-bottom: 1rem;
}

.skill-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Work / Portfolio */
#portfolio {
    background: var(--bg-secondary);
    position: relative;
}

#portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.card {
    background: var(--bg-primary);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-image {
    position: relative;
    height: 220px;
    width: 100%;
    background: #0f172a;
    overflow: hidden;
    display: flex;
    /* Centering image */
    justify-content: center;
    align-items: center;
}

.card-image img {
    width: auto;
    height: 90%;
    object-fit: contain;
    transition: transform 0.5s;
}

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

.card-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s;
}

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

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    border-radius: 12px;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: auto;
}

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

.app-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.app-link:hover {
    color: var(--accent);
}

.preview-btn {
    padding: 6px 16px;
    font-size: 0.8rem;
}

/* Contact */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

.contact-item:hover {
    border-color: var(--accent);
}

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

.contact-item a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Make the whole item clickable if wrapped in an anchor (optional enhancement) */
a.contact-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.form-group textarea {
    height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    background: #020617;
    padding: 3rem 0;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    background: var(--bg-secondary);
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive */
@media (max-width: 900px) {
    .contact-container {
        grid-template-columns: 1fr;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 3rem;
    }

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

    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        height: calc(100vh - var(--header-height));
        width: 70%;
        background: var(--bg-secondary);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.3s ease;
        gap: 2rem;
    }

    .nav-links.active {
        right: 0;
    }

    .menu-toggle {
        display: block;
        color: var(--text-primary);
    }

    section {
        padding: 60px 0;
    }
}