@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;700;800&display=swap');

:root {
    --bg-base: #030712;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent: #6366f1;
    --accent-glow: #8b5cf6;
    --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 15% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 100%, rgba(139, 92, 246, 0.15) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    opacity: 0;
    animation: fadeInPage 0.8s ease forwards;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@keyframes fadeInPage { to { opacity: 1; } }

/* --- Navigation --- */
nav {
    position: fixed;
    top: 20px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 900px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 50px;
    z-index: 1000;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.nav-container { padding: 1rem 2.5rem; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); text-decoration: none; letter-spacing: -0.5px; }
.logo span { background: linear-gradient(to right, #818cf8, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 2.5rem; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: all 0.3s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); text-shadow: 0 0 15px rgba(255,255,255,0.5); }

/* --- Layout --- */
main { flex: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 140px 2rem 4rem 2rem; }
.section-padding { padding: 4rem 0; }

h1 { font-size: 4.5rem; line-height: 1.1; margin-bottom: 1.5rem; font-weight: 800; letter-spacing: -2px; background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h2 { font-size: 2.8rem; margin-bottom: 1.5rem; font-weight: 700; letter-spacing: -1px; }
h3 { font-size: 1.5rem; margin-bottom: 0.5rem; font-weight: 700; letter-spacing: -0.5px; }
p { color: var(--text-secondary); font-size: 1.15rem; margin-bottom: 1.5rem; font-weight: 400; }

/* --- Buttons --- */
.btn { display: inline-block; padding: 1rem 2.5rem; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #ffffff; text-decoration: none; font-weight: 600; border-radius: 50px; transition: all 0.4s ease; border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 0 20px rgba(99, 102, 241, 0.4); }
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(139, 92, 246, 0.6); }
.btn-secondary { background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px); color: var(--text-primary); border: 1px solid var(--border); box-shadow: none; }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--border-highlight); box-shadow: 0 0 20px rgba(255,255,255,0.1); }

/* --- Symmetric Portfolio Grid --- */
.premium-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2.5rem; }
.portfolio-card { background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%); border: 1px solid var(--border); border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease; }
.portfolio-card:hover { transform: translateY(-8px); border-color: rgba(99, 102, 241, 0.5); box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(99, 102, 241, 0.15); }
.card-img-wrapper { width: 100%; height: 220px; border-bottom: 1px solid rgba(255,255,255,0.05); overflow: hidden; }
.project-img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.6s ease; }
.portfolio-card:hover .project-img { transform: scale(1.05); }
.card-content { padding: 2rem; display: flex; flex-direction: column; flex: 1;display: -webkit-box;
  -webkit-line-clamp: 3; /* Limits the text to exactly 3 lines */
  -webkit-box-orient: vertical;  
  overflow: hidden; }
.card-link { margin-top: auto; display: inline-block; padding-top: 1.5rem; font-weight: 600; color: #a5b4fc; text-decoration: none; transition: 0.3s; }
.card-link:hover { color: #ffffff; text-shadow: 0 0 10px rgba(165, 180, 252, 0.6); }

/* --- General Grid & Badges --- */
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.badge-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem 1rem; text-align: center; transition: 0.3s; }
.badge-card:hover { transform: translateY(-5px); border-color: var(--border-highlight); background: var(--surface-hover); }
.badge-img { width: 120px; height: 120px; object-fit: contain; margin: 0 auto 1.5rem auto; display: block; border-radius: 12px; }

/* --- Tags --- */
.tech-stack { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tech-pill { background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.3); padding: 0.4rem 1rem; border-radius: 50px; font-size: 0.85rem; font-weight: 600; color: #a5b4fc; }

/* --- Footer --- */
footer { border-top: 1px solid var(--border); padding: 4rem 2rem; text-align: center; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); margin-top: auto; }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.footer-nav a { color: var(--text-secondary); text-decoration: none; margin: 0 1rem; font-weight: 500; transition: 0.3s; }
.footer-nav a:hover { color: var(--text-primary); }
.social-links a { display: inline-block; margin: 0 0.5rem; padding: 0.8rem 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 50px; color: var(--text-primary); text-decoration: none; font-weight: 600; transition: 0.3s; }
.social-links a:hover { background: rgba(99, 102, 241, 0.2); border-color: var(--border-highlight); }

/* --- Animations --- */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
    h1 { font-size: 3rem; }
    .nav-container { padding: 1rem; justify-content: center; }
    .nav-links { display: none; }
    nav { width: 95%; top: 10px; }
    .premium-grid, .grid-4 { grid-template-columns: 1fr; }
}
/* --- PREMIUM CONTACT COMMAND NODE --- */
.contact-glass-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    padding: 5rem 3rem;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

/* Background ambient glow inside the card */
.contact-glass-panel::before {
    content: '';
    position: absolute;
    top: -50%; left: 50%;
    transform: translateX(-50%);
    width: 150%; height: 150%;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1), transparent 60%);
    z-index: -1;
    pointer-events: none;
}

/* Pulsing Availability Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.status-dot {
    width: 8px; height: 8px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 10px #34d399;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Sleek Platform Pills */
.platform-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.platform-pill {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 30px;
    border-radius: 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.platform-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(99, 102, 241, 0.2);
}

@media (max-width: 768px) {
    .contact-glass-panel { padding: 3rem 1.5rem; }
    .platform-links { flex-direction: column; gap: 1rem; }
}

/* Container for the 4 cards */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns */
    /* REMOVED grid-template-rows and height: 75vh so it can expand naturally */
    gap: 2rem;
    max-width: 1100px;
    margin: 120px auto 40px; 
}

/* Flexbox controls for every card */
.portfolio-card {
    display: flex;
    flex-direction: column;
    height: 100%; /* Grid automatically stretches all cards in a row to match the tallest one */
    overflow: hidden;
    border-radius: 20px;
}

/* Fixed height for images so they never squish */
.card-img-wrapper {
    height: 220px; 
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top; /* Anchors screenshots to the top */
}

/* Let the content area expand to fill the bottom half */
.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

.card-content p {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Allows up to 3 lines of text */
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1; /* This acts like a spring, pushing the link to the very bottom */
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}


/* Styling and Animation for Card 4 */
.coming-soon-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    position: relative;
}

.coming-soon-card::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(188, 52, 250, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse-glow 2.5s infinite alternate;
    z-index: 0;
}

.coming-soon-content {
    position: relative;
    z-index: 1;
}

.coming-soon-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.coming-soon-content p {
    color: #aaa;
    font-size: 0.9rem;
}

@keyframes pulse-glow {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 1; }
}
/* --- PORTFOLIO PAGE ENHANCEMENTS --- */

.portfolio-intro {
    max-width: 760px;
    margin-bottom: 3rem;
}

.portfolio-intro > .tech-pill {
    display: inline-block;
    margin-bottom: 1.25rem;
}

.portfolio-intro h2 {
    margin-bottom: 1rem;
}

.portfolio-intro p {
    max-width: 680px;
    margin-bottom: 0;
}

.portfolio-grid {
    margin-top: 3rem;
    row-gap: 2rem;
}

.portfolio-card {
    min-width: 0;
}

.card-content {
    min-width: 0;
}

.card-content h3 {
    line-height: 1.35;
}

.project-label {
    margin-bottom: 0.9rem;
    color: #a5b4fc;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: auto;
}

.project-links .card-link {
    padding-top: 0.5rem;
}

.card-link:focus-visible,
.nav-links a:focus-visible,
.footer-nav a:focus-visible,
.social-links a:focus-visible {
    outline: 2px solid #a5b4fc;
    outline-offset: 5px;
    border-radius: 4px;
}

/* --- FUTURE PROJECT CARD --- */

.coming-soon-card {
    min-height: 350px;
    padding: 2rem;
}

.coming-soon-content {
    width: 100%;
    max-width: 360px;
}

.future-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(165, 180, 252, 0.3);
    border-radius: 18px;
    background: rgba(99, 102, 241, 0.12);
    color: #c4b5fd;
    font-size: 1.4rem;
    font-weight: 800;
}

.coming-soon-content .project-label {
    margin-bottom: 0.75rem;
}

.coming-soon-content p {
    line-height: 1.8;
}

.future-tech-stack {
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
}

.future-note {
    display: inline-block;
    color: #a5b4fc;
    font-size: 0.82rem;
    font-weight: 600;
}

/* --- PORTFOLIO RESPONSIVENESS --- */

@media (max-width: 640px) {
    .portfolio-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
        margin-top: 2rem;
    }

    .portfolio-intro {
        margin-bottom: 2rem;
    }

    .card-img-wrapper {
        height: 200px;
    }

    .coming-soon-card {
        min-height: 320px;
        padding: 1.5rem;
    }
}

/* --- RESPECT REDUCED-MOTION PREFERENCES --- */

@media (prefers-reduced-motion: reduce) {
    .coming-soon-card::before,
    .status-dot {
        animation: none;
    }

    .portfolio-card,
    .project-img,
    .card-link {
        transition: none;
    }
}

/* ===== SHARED, ACCESSIBLE MOBILE NAVIGATION ===== */
/* Desktop: keep the original inline navigation and hide the menu button. */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    flex: 0 0 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle:focus-visible,
.nav-links a:focus-visible,
.footer-nav a:focus-visible,
.social-links a:focus-visible,
.btn:focus-visible,
.platform-pill:focus-visible {
    outline: 2px solid #a5b4fc;
    outline-offset: 4px;
}

@media (max-width: 767px) {
    nav {
        width: calc(100% - 24px);
        top: 10px;
        border-radius: 22px;
    }

    .nav-container {
        padding: 0.8rem 1rem;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .logo {
        font-size: clamp(0.95rem, 4vw, 1.2rem);
    }

    .menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-container .nav-links {
        display: none;
        flex: 0 0 100%;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 0.5rem 0 0.25rem;
    }

    .nav-container .nav-links.is-open {
        display: flex;
    }

    .nav-container .nav-links a {
        display: block;
        padding: 0.7rem 0.8rem;
        border-radius: 10px;
    }

    .container {
        padding-right: 1.1rem;
        padding-left: 1.1rem;
    }

    .contact-glass-panel {
        padding: 2.5rem 1.25rem;
    }

    .contact-glass-panel h1 {
        font-size: clamp(2rem, 8vw, 3rem) !important;
    }

    .container section > div[style*="display: flex"] {
        flex-wrap: wrap;
    }
}

.menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
