/* ==============================
   GENERAL STYLES
============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(-45deg, #0f172a, #020617, #020617, #0f172a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #f1f5f9;
    overflow-x: hidden;
}

/* Animated Background */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px 20px;
    animation: fadeInDown 1s ease-in-out;
}

header h1 {
    font-size: 42px;
}

.header-buttons {
    margin-top: 15px;
}

.typing-text {
    color: #38bdf8;
    font-weight: 600;
    font-size: 18px;
    margin-top: 10px;
}

#typing::after {
    content: "|";
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Profile Photo */
.profile-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: block;
    border: 4px solid #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
    transition: all 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.9);
}

/* Layout */
.container {
    max-width: 1100px;
    margin: auto;
    padding: 20px;
}

h2 {
    color: #38bdf8;
    margin-bottom: 15px;
}

/* ==============================
   GRID
============================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    align-items: stretch;
}

/* ==============================
   CARDS
============================== */
.card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 15px 40px rgba(56, 189, 248, 0.25);
}

/* Card Content */
.card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.card-content h3 {
    text-align: center;
}

.card-content p {
    text-align: justify;
}

/* Tech Stack */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 5px;
}

.tech-stack span {
    font-size: 11px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    background: #38bdf8;
    color: #001018;
    font-weight: bold;
    text-decoration: none;
    margin: 10px 5px;
    margin-top: auto;
    align-self: center;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #0ea5e9;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.4);
}

/* Project Images */
.project-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    display: block;
    margin-top: auto;
    margin-bottom: 15px;
    align-self: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.project-image:hover {
    transform: scale(1.03);
}

/* Tags */
.tag {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(56, 189, 248, 0.15);
    border-radius: 20px;
    margin: 5px 5px 0 0;
    font-size: 13px;
    transition: all 0.3s ease;
}

.tag:hover {
    background: #38bdf8;
    color: #001018;
    transform: scale(1.1);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    background: #020617;
    margin-top: 40px;
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

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

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================
   RESPONSIVE DESIGN
============================== */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 30px;
    }

    .typing-text {
        font-size: 16px;
    }

    .container {
        padding: 15px;
    }

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

    .card {
        padding: 18px;
    }

    .profile-photo {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 30px 15px 15px;
    }

    header h1 {
        font-size: 26px;
    }

    .typing-text {
        font-size: 14px;
    }

    .btn {
        padding: 9px 16px;
        font-size: 14px;
    }

    .tag {
        font-size: 12px;
        padding: 5px 10px;
    }
}
