/* ==========================================================================
   Base Variables & Global Styles
   ========================================================================== */
:root {
    --primary: #0077b5;
    --accent: #0062a8;
    --muted: #6b7280;
    --bg: #f4f4f4;
    --card: #ffffff;
    --max-width: 1100px;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    --gap: 18px;
    --text: #222;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background .2s ease, color .2s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 92%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 12px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
header {
    background: var(--card);
    padding: .9rem 0;
    border-bottom: 1px solid #eee;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 20;
}

header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .2px;
}

header h1,
header h1 a {
    color: var(--accent);
}

header h1 a:hover {
    text-decoration: none;
}

header nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-top: 6px;
}

header nav a {
    color: #555;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    transition: color .18s ease, background .18s ease, transform .12s ease;
    background: transparent;
    border: 1px solid transparent;
}

header nav a i,
header nav .dropbtn i:first-child {
    width: 18px;
    text-align: center;
}

header nav a:hover {
    color: var(--primary);
    background: rgba(0, 119, 181, 0.06);
    transform: translateY(-2px);
}

/* ==========================================================================
   Dropdown Nav
   ========================================================================== */
.dropdown {
    position: relative;
    display: inline-flex;
}

.dropbtn {
    color: #555;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    transition: color .18s ease, background .18s ease, transform .12s ease;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.dropbtn:hover,
.dropdown:focus-within .dropbtn,
.dropdown:hover .dropbtn {
    color: var(--primary);
    background: rgba(0, 119, 181, 0.06);
    transform: translateY(-2px);
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--card);
    min-width: 260px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 30;
    border-radius: 12px;
    padding: 8px;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

header nav .dropdown-content a {
    padding: 10px 14px;
    justify-content: flex-start;
    width: 100%;
    border-radius: 6px;
    margin: 2px 0;
    white-space: nowrap;
}

/* Social icons specific styling */
nav a.youtube-link {
    color: #d93025;
    font-weight: 700;
}

nav a.youtube-link:hover {
    color: #b1271a;
}

nav a[href*="instagram.com"],
nav a.instagram-link {
    color: #e1306c;
    font-weight: 700;
}

nav a[href*="instagram.com"]:hover,
nav a.instagram-link:hover {
    color: #c21a5a;
}

nav a.github-link,
nav a[href*="github.com"] {
    color: #0f1720;
    font-weight: 700;
}

nav a.github-link:hover,
nav a[href*="github.com"]:hover {
    color: #000000;
}

nav a.blogs-link,
nav a[href*="blogs"] {
    color: #0062a8;
    font-weight: 700;
}

nav a.blogs-link:hover,
nav a[href*="blogs"]:hover {
    color: #05478a;
}

nav a.certifications-link {
    color: #0f9d58;
    font-weight: 700;
}

nav a.certifications-link:hover {
    color: #0b7d46;
}

nav a.projects-link {
    color: #8e24aa;
    font-weight: 700;
}

nav a.projects-link:hover {
    color: #6a1b9a;
}

/* ==========================================================================
   Project Cards & Main Content
   ========================================================================== */
main {
    padding: 2.5rem 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 2rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--gap);
}

.project-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 119, 181, 0.1);
}

.project-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--accent);
}

.project-desc {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0 0 1rem 0;
    flex-grow: 1;
}

.project-link-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.project-card:hover .project-link-text i {
    transform: translateX(4px);
}

.project-link-text i {
    transition: transform 0.2s ease;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--muted);
    margin-top: 28px;
}

footer .container p {
    margin: 0;
}

/* ==========================================================================
   Focus & Accessibility
   ========================================================================== */
header nav a:focus,
.project-card:focus {
    outline: 3px solid rgba(11, 116, 218, 0.18);
    outline-offset: 3px;
    border-radius: 8px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 880px) {
    header h1 {
        font-size: 1.35rem;
    }

    nav {
        gap: 10px;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 94%;
    }

    header h1 {
        font-size: 1.25rem;
    }
}