/* --- Variables & Reset --- */
:root {
    /* Color Palette: Dark Slate & Electric Teal */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #2dd4bf; /* Electric Teal */
    --accent-dim: rgba(45, 212, 191, 0.1);

    --font-main: 'Inter', sans-serif;
    --transition: all 0.3s ease;
    --spacing-section: 5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* --- Utilities --- */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: var(--bg-dark);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
    font-weight: 600;
    font-size: 0.9rem;
}

.skip-to-main:focus {
    top: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-pad {
    padding: var(--spacing-section) 0;
}

.section-title {
    font-size: 1.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
}

.bg-offset {
    background-color: rgba(255,255,255, 0.02);
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

.btn-small {
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent);
    color: var(--accent) !important;
    border-radius: 4px;
}

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

/* --- Hero Section --- */
.hero-section {
    height: 90vh;
    display: flex;
    align-items: center;
    padding-top: 70px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-text {
    flex: 1;
}

.hero-avatar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.avatar-placeholder {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-dim), rgba(45, 212, 191, 0.05));
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: var(--accent);
}

.avatar-image {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    object-fit: cover;
    object-position: center;
    display: block;
    box-shadow: 0 8px 32px rgba(45, 212, 191, 0.2);
    transition: var(--transition);
}

.avatar-image:hover {
    box-shadow: 0 12px 48px rgba(45, 212, 191, 0.3);
    transform: scale(1.02);
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin: 2rem 0;
    padding: 2rem 0;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overline {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.role-title {
    font-size: 2rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.tagline {
    max-width: 600px;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.hero-social-links {
    display: flex;
    gap: 1.5rem;
    margin: 1.5rem 0;
    align-items: center;
}

.hero-social-links a {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(45, 212, 191, 0.1);
}

.hero-social-links a:hover {
    color: var(--accent);
    background: rgba(45, 212, 191, 0.2);
    transform: translateY(-3px);
}

.hero-cta {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: #fff;
}

.btn-outline {
    border: 1px solid var(--text-muted);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-main);
}

.btn:focus-visible,
.btn-outline:focus-visible,
.btn-small:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.nav-links a:focus-visible,
.link-arrow:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Skills Grid --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.skill-category h4 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

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

.tags span {
    background: var(--bg-card);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.05);
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.tags span:hover {
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent);
    cursor: default;
}

.proficiency-expert {
    border-left-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.05) !important;
}

.proficiency-expert:hover {
    background: rgba(16, 185, 129, 0.15) !important;
}

.proficiency-proficient {
    border-left-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.05) !important;
}

.proficiency-proficient:hover {
    background: rgba(245, 158, 11, 0.15) !important;
}

.proficiency-familiar {
    border-left-color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.05) !important;
}

.proficiency-familiar:hover {
    background: rgba(99, 102, 241, 0.15) !important;
}

/* --- Experience Timeline --- */
.timeline {
    position: relative;
    border-left: 2px solid var(--bg-card);
    margin-left: 1rem;
    padding-left: 2rem;
}

.company-group {
    margin-bottom: 2.5rem;
}

.company-header {
    margin-bottom: 1.5rem;
    margin-left: -2rem;
    padding-left: 2rem;
    position: relative;
}

.company-header::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
}

.company-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.timeline-item {
    margin-bottom: 1.5rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 5px;
    width: 8px;
    height: 8px;
    background: rgba(45, 212, 191, 0.6);
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
}

.timeline-item-button {
    background: none;
    border: none;
    padding: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font-family: inherit;
}

.timeline-item-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.timeline-header {
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.timeline-item-button.active .timeline-header {
    margin-bottom: 1rem;
}

.timeline-header h4 {
    font-size: 1.25rem;
    color: var(--text-main);
    flex: 1;
}

.timeline-header .company {
    display: none;
}

.timeline-header .date {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: var(--accent);
    transition: transform 0.3s ease;
}

.timeline-item-button:not(.active) .toggle-icon {
    transform: rotate(-90deg);
}

.timeline-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.timeline-item-button.active .timeline-content {
    max-height: 500px;
}

.timeline-content ul {
    list-style: disc;
    margin-left: 1rem;
}

.timeline-content li {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Projects/Initiatives --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.card-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-icon {
    color: var(--accent);
    font-size: 1.5rem;
}

.stats {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-main);
}

.stats i {
    color: var(--accent);
    margin-right: 0.3rem;
}

.tech-tags-mini {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tech-tags-mini span {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

/* --- Open Source Grid --- */
.opensource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.opensource-card {
    background: var(--bg-card);
    border: 1px solid rgba(45, 212, 191, 0.2);
    padding: 2rem;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.opensource-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(45, 212, 191, 0.1);
}

.opensource-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.opensource-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.opensource-card p {
    flex: 1;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.opensource-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.opensource-tags span {
    display: inline-block;
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(45, 212, 191, 0.3);
}

/* --- Certifications Grid --- */
.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.certification-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 2rem;
    border-radius: 8px;
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.certification-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background: rgba(45, 212, 191, 0.05);
}

.cert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(45, 212, 191, 0.1);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--accent);
    margin: 0 auto 1.5rem;
}

.certification-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-main);
    font-size: 1.1rem;
}

.cert-issuer {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.cert-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 1rem 0;
}

.cert-description {
    flex: 1;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.cert-credential {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1rem;
    font-style: italic;
}

.cert-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.cert-tags span {
    display: inline-block;
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent);
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.75rem;
    border: 1px solid rgba(45, 212, 191, 0.3);
}

/* --- Writing Grid --- */
.subtitle {
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.writing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition);
}

.article-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-dim);
}

.article-card {
    border: 1px solid rgba(255,255,255,0.05);
}

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

.article-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.article-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.read-link {
    margin-top: auto;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Skeleton Loading for Articles */
.skeleton-card {
    height: 200px;
    background: var(--bg-card);
    border-radius: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.link-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.link-arrow:hover {
    color: var(--accent);
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 999;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(45, 212, 191, 0.4);
}

.back-to-top.show {
    display: flex;
}

/* --- Footer --- */
footer {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 4rem 0 2rem;
    background: var(--bg-dark);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-left h5 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.email-link {
    color: var(--accent);
    font-size: 0.9rem;
}

.footer-right {
    display: flex;
    gap: 1.5rem;
}

.footer-right a {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.footer-right a:hover {
    color: var(--text-main);
}

.copyright {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2rem;
    opacity: 0.5;
}

/* --- Mobile Menu Toggle --- */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .role-title {
        font-size: 1.4rem;
    }

    .hero-section {
        height: auto;
        padding: 100px 0 60px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin: 1.5rem 0;
        padding: 1.5rem 0;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .avatar-placeholder {
        width: 200px;
        height: 200px;
        font-size: 3rem;
    }

    .avatar-image {
        width: 200px;
        height: 200px;
    }

    .hero-cta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        left: 0;
        top: 70px;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(15, 23, 42, 0.98);
        flex-direction: column;
        gap: 0;
        align-items: stretch;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-links.active {
        max-height: 500px;
    }

    .nav-links li {
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .nav-links a {
        display: block;
        padding: 1rem 1.5rem;
    }

    .btn-small {
        margin: 1rem 1.5rem;
        display: block;
        text-align: center;
    }

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

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

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

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-right {
        justify-content: center;
    }

    .section-pad {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }

    .timeline {
        margin-left: 0;
        padding-left: 1rem;
        border-left: 2px solid var(--bg-card);
    }

    .company-header {
        margin-left: -1rem;
        padding-left: 1rem;
    }

    .company-header::before {
        left: -1.6rem;
    }

    .company-name {
        font-size: 1rem;
    }

    .timeline-item::before {
        left: -1.6rem;
    }
}

/* --- Tooltip --- */
.tooltip-trigger {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--accent);
    color: var(--accent);
    font-weight: 500;
    display: inline-block;
}

.tooltip-box {
    position: fixed;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: normal;
    max-width: 300px;
    z-index: 10000;
    border: 1px solid var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    line-height: 1.5;
    display: none;
}

@media (max-width: 768px) {
    .tooltip-box {
        max-width: calc(100vw - 2rem);
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
}