:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #38bdf8;
    --card-bg: #1e293b;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 6%;
}

section {
    padding: 100px 0;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid #334155;
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.nav-container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    z-index: 1001;
}

.nav-links {
    display: flex;
    gap: 30px;
    margin-left: auto;
}

.nav-links a {
    font-weight: 500;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: 0.4s;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--nav-height);
    gap: 40px;
}

.hero-content {
    flex: 1;
    padding-right: 50px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero span {
    color: var(--accent-color);
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #94a3b8;
    max-width: 520px;
    line-height: 1.8;
}

.hero-image img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.2);
    background-color: #1e293b;
    animation: float 6s ease-in-out infinite;
    z-index: 2;
}

.blob {
    position: absolute;
    width: 360px;
    height: 360px;
    background: var(--accent-color);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    animation: pulse 4s infinite alternate;
    z-index: 1;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--accent-color);
    color: var(--bg-color);
    font-weight: bold;
    border-radius: 5px;
    border: 2px solid var(--accent-color);
    margin: 20px 0;
}

.btn:hover {
    background-color: transparent;
    color: var(--accent-color);
}

.btn-outline {
    background-color: transparent;
    color: var(--accent-color);
}

.btn-outline:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

.section-title {
    font-size: 2rem;
    text-align: center;
    width: fit-content;
    display: block;
    margin: 0 auto 40px auto;
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 10px;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    padding-top: 20px;
    max-width: 850px;
    margin: 0 auto;
}

.skill-tag {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 140px;
    padding: 15px;
    background-color: transparent;
    border: none;
    transition: 0.3s;
    color: #94a3b8;
    font-weight: 500;
    text-align: center;
}

.skill-tag i {
    font-size: 4rem;
    transition: 0.3s;
}

.custom-icon {
    width: 4.8rem;
    height: 4.8rem;
    object-fit: contain;
    transition: 0.3s;
}

.skill-tag img[alt="HTML5 Canvas Logo"] {
    transform: scale(2.2);
}

.skill-tag:hover img[alt="HTML5 Canvas Logo"] {
    transform: scale(2.2) translateY(-5px);
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.4));
}

.icon-group {
    display: flex;
    gap: 10px;
    font-size: 4rem;
}

.skill-tag:hover {
    transform: translateY(-8px);
    color: var(--accent-color);
}

.skill-tag:hover i, .skill-tag:hover .custom-icon {
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.4));
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: transparent;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    transition: 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

.projects-grid {
    display: flex;
    flex-direction: column; 
    gap: 20px;
    margin-bottom: 60px;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden; 
    border: 1px solid #334155;
    display: flex;
    flex-direction: row; 
    align-items: stretch; 
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.project-card:nth-child(even) {
    flex-direction: row-reverse;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.project-card img {
    display: block;
    width: 45%; 
    height: 100%;
    min-height: 280px; 
    flex-shrink: 0; 
    object-fit: cover; 
    object-position: top center; 
    background-color: var(--card-bg);
}

.project-card:nth-child(odd) img {
    border-right: 1px solid #334155;
}

.project-card:nth-child(even) img {
    border-left: 1px solid #334155;
}

.card-content {
    width: 55%; 
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    background-color: var(--card-bg);
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.tech-stack {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 15px;
    font-style: italic;
}

.project-links {
    margin-top: auto;
    display: flex;
    width: 100%;
    align-items: center;
    gap: 15px;
    font-weight: bold;
    padding-top: 15px;
}

.project-links .live-link {
    color: var(--accent-color);
    position: relative;
    display: inline-block;
    transition: 0.3s;
    text-decoration: none;
}

.project-links .live-link::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s;
}

.project-links .live-link:hover::after {
    width: 100%;
}

.btn-admin {
    margin-left: auto;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
}

.btn-admin:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

.masonry-grid {
    column-count: 3;
    column-gap: 30px;
    margin-bottom: 60px;
    padding-top: 10px;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #334155;
    background-color: var(--card-bg);
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.masonry-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: 0.4s ease;
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    align-items: stretch;
}

.cert-grid .project-card {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    align-self: auto !important;
    margin: 0 !important;
}

.cert-grid .project-card img {
    width: 100% !important;
    height: 220px !important;
    border-right: none !important;
    border-left: none !important;
    border-bottom: 1px solid #334155 !important;
}

.cert-grid .card-content {
    width: 100% !important;
    padding: 25px !important;
}

.cert-issuer {
    color: #94a3b8;
    font-size: 0.9rem;
}

.cert-date {
    font-size: 0.8rem;
    color: #64748b;
}

.cert-link {
    display: inline-block;
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: bold;
    opacity: 0.8;
    cursor: pointer;
}

.cert-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 0;
}

.contact-subtitle {
    margin-bottom: 30px;
    color: #94a3b8;
    font-size: 1.1rem;
    max-width: 600px;
}

.contact-socials {
    display: flex;
    gap: 25px;
    justify-content: center;
    align-items: center;
}

.contact-socials a {
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 1px solid #334155;
    background-color: var(--card-bg);
    font-size: 1.8rem;
    transition: all 0.3s ease;
}

.contact-socials a:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.15);
}

footer {
    background-color: #080f1e;
    padding: 50px 0 30px 0;
    width: 100%;
    position: relative;
}

.footer-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

.footer-top {
    text-align: center;
    margin-bottom: 25px;
}

.footer-top h4 {
    color: #f8fafc;
    font-size: 1.1rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-weight: bold;
}

.footer-top ul {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.footer-top a {
    color: #64748b;
    font-size: 1rem;
    transition: color 0.3s;
}

.footer-top a:hover {
    color: var(--accent-color);
}

footer hr {
    width: 100%;
    border: none;
    border-top: 1px solid #1e293b;
    margin: 0 0 25px 0;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    color: #475569;
    font-size: 0.95rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
    z-index: 2000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: -48px;
    right: 0;
    color: #e2e8f0;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: Arial, sans-serif;
    cursor: pointer;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: color 0.3s, border-color 0.3s, transform 0.3s;
}

.close-modal:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: rotate(90deg);
}

.scroll-top {
    position: absolute;
    right: 0;
    bottom: -15px; 
    width: 50px;
    height: 50px;
    background-color: #93c5fd; 
    color: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: transform 0.3s ease;
    z-index: 10;
}

.scroll-top:hover {
    transform: translateY(-4px);
    background-color: #7dd3fc;
}

@keyframes float {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0%   { opacity: 0.1; transform: scale(0.9); }
    100% { opacity: 0.3; transform: scale(1.1); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
    .project-card, .project-card:nth-child(even) {
        flex-direction: column !important;
        width: 100%;
        max-width: 100%;
    }
    
    .project-card img {
        width: 100%;
        height: 250px;
        min-height: auto;
        border-right: none !important;
        border-left: none !important;
        border-bottom: 1px solid #334155;
    }
    
    .card-content {
        width: 100%;
    }

    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .hamburger {
        display: block;
        margin-left: auto;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 0;
        background-color: rgba(15, 23, 42, 0.98);
        border-bottom: 1px solid #334155;
        flex-direction: column;
        align-items: center;
        padding: 0;
        overflow: hidden;
        transform: none;
        transition: 0.4s ease-in-out;
    }

    .nav-links.active {
        height: auto;
        padding: 10px 0;
    }

    .nav-links li {
        margin: 5px 0;
    }

    .desktop-only {
        display: none;
    }

    section {
        padding: 80px 0;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .projects-grid {
        gap: 30px;
        margin-bottom: 60px;
    }

    .project-card img {
        height: 200px;
    }

    .card-content {
        padding: 20px;
    }

    .masonry-grid {
        column-count: 1;
    }

    .hero {
        flex-direction: column-reverse;
        text-align: center;
        justify-content: center;
        padding-top: 100px;
        gap: 20px;
    }

    .hero-content {
        padding-right: 0;
        margin-top: 30px;
        width: 100%;
    }

    .hero h1 {
        font-size: 1.8rem;
        word-break: break-word;
    }

    .hero p {
        font-size: 1rem;
        margin: 0 auto 30px auto;
    }

    .hero-image img {
        width: 220px;
        height: 220px;
    }

    .blob {
        width: 230px;
        height: 230px;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .skills-grid {
        gap: 15px 5px; 
    }

    .skill-tag {
        width: 31%; 
        justify-content: flex-start;
        padding: 5px;
        font-size: 0.85rem; 
        gap: 8px;
    }

    .skill-tag i, .icon-group {
        font-size: 2.8rem; 
    }

    .custom-icon {
        width: 3.2rem; 
        height: 3.2rem;
    }

    .skill-tag img[alt="HTML5 Canvas Logo"] {
        transform: scale(1.6);
    }

    .skill-tag:hover img[alt="HTML5 Canvas Logo"] {
        transform: scale(1.6) translateY(-3px);
    }

    .contact {
        padding: 60px 0 80px 0; 
    }

    .footer-top ul {
        flex-direction: column;
        gap: 15px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        justify-content: center;
        align-items: center;
    }

    .footer-bottom p:nth-child(2) {
        display: none;
    }

    .scroll-top {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        transform: none;
    }
        
    .scroll-top:hover {
        transform: scale(1.05);
    }

    .contact-socials {
        gap: 15px;
    }
    
    .contact-socials a {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        background-color: transparent;
    }
}