:root {
    --bg: #0d1117;
    --panel: #161b22;
    --text: #e6edf3;
    --muted: #7d8590;
    --brand: #2563eb;
    --brand-strong: #1d4ed8;
    --accent: #14b8a6;
    --card: #21262d;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Theme toggle */
.theme-light {
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #0f172a;        /* Darker text for better readability */
    --muted: #475569;       /* More professional muted text */
    --brand: #2563eb;       /* Kept main blue */
    --brand-strong: #1e40af; /* Darker blue for stronger emphasis */
    --accent: #0891b2;      /* Adjusted teal for professionalism */
    --card: #ffffff;
    --border: #e2e8f0;      /* Softer border color */
    --shadow: 0 4px 20px rgba(148, 163, 184, 0.08), 0 1px 6px rgba(148, 163, 184, 0.04);
}

/* Light mode specific enhancements */
@media (prefers-color-scheme: light) {
    body {
        background: radial-gradient(1200px 600px at 20% -10%, rgba(37,99,235,.08), transparent 60%),
                    radial-gradient(800px 400px at 120% 20%, rgba(8,145,178,.08), transparent 60%),
                    var(--bg);
    }

    .card {
        background: rgba(255, 255, 255, 0.95);
        border-color: color-mix(in srgb, var(--brand) 8%, var(--border));
        box-shadow: 0 4px 20px rgba(148, 163, 184, 0.08);
    }

    .contact-form {
        background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.95));
        border-color: color-mix(in srgb, var(--brand) 12%, var(--border));
        box-shadow: 0 8px 32px rgba(148, 163, 184, 0.12);
    }

    .field input, .field textarea {
        background: #ffffff;
        border-color: #e2e8f0;
        color: var(--text);
    }

    .field input:hover, .field textarea:hover {
        border-color: color-mix(in srgb, var(--brand) 30%, #cbd5e1);
        background: #ffffff;
    }

    .field input:focus-visible, .field textarea:focus-visible {
        background: #ffffff;
        border-color: var(--brand);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
    }

    .social {
        background: #ffffff;
        border-color: #e2e8f0;
        box-shadow: 0 2px 8px rgba(148, 163, 184, 0.04);
    }

    .social:hover {
        background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.95));
        border-color: var(--brand);
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
    }

    .btn {
        background: #ffffff;
        border-color: #e2e8f0;
        color: var(--text);
    }

    .btn:hover {
        background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.95));
        border-color: var(--brand);
        box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
    }

    .btn.primary {
        background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
    }

    .site-header {
        background: rgba(255, 255, 255, 0.8);
        border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    }

    .form-status.success {
        background: rgba(34, 197, 94, 0.08);
        color: #15803d;
        border-color: rgba(34, 197, 94, 0.2);
    }

    .form-status.error {
        background: rgba(239, 68, 68, 0.08);
        color: #b91c1c;
        border-color: rgba(239, 68, 68, 0.2);
    }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: radial-gradient(1200px 600px at 20% -10%, rgba(37,99,235,.15), transparent 60%),
                radial-gradient(800px 400px at 120% 20%, rgba(20,184,166,.15), transparent 60%),
                var(--bg);
    line-height: 1.6;
}
/* Prevent horizontal scroll on small screens */
html, body { overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }
/* Type scale */
h1 { font-size: clamp(2rem, 1.1rem + 2.6vw, 3.25rem); line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 1.05rem + 1.2vw, 2rem); line-height: 1.25; }
h3 { font-size: clamp(1.15rem, .9rem + .6vw, 1.35rem); line-height: 1.35; }
p, li { font-size: clamp(.99rem, .92rem + .28vw, 1.06rem); }
small { font-size: .92rem; }

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
}
.skip-link:focus { left: 0; background: var(--brand); color: white; padding: .5rem .75rem; }

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
    position: relative;
}

/* Enhanced container with subtle background for better content separation */
.container::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: 0;
    right: 0;
    bottom: -2rem;
    background: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    border-radius: 1rem;
}

.site-header {
    position: sticky;
    top: 0; z-index: 1000;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: grid; grid-template-columns: 1fr auto auto; align-items: center;
    gap: 1rem; padding: .8rem 0;
}
.brand { display: flex; align-items: center; gap: .9rem; }
.brand-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid color-mix(in srgb, var(--brand) 60%, transparent); filter: none; }
@media (prefers-color-scheme: dark) {
    .brand-avatar { filter: none; }
}
.brand-name { font-size: 1rem; }
.brand-role { display: block; font-size: .8rem; color: var(--muted); }

.nav-toggle { display: none; background: none; border: 0; color: var(--text); }
.nav-toggle span { display: block; width: 22px; height: 2px; background: currentColor; margin: 5px 0; border-radius: 2px; }
.nav-list { display: flex; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.nav-list a { color: var(--text); text-decoration: none; opacity: .9; position: relative; padding: .5rem .25rem; transition: color 0.3s ease; }
.nav-list a:hover { color: var(--brand); }
.nav-list a::after { content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .25s ease; border-radius: 2px; }
.nav-list a:hover::after, .nav-list a:focus-visible::after { width: 100%; }
.nav-list a.is-active { color: var(--brand); }
.nav-list a.is-active::after { width: 100%; }
/* Desktop/nav focus ring and aria-current fallback */
.nav-list a:focus-visible { outline: none; border-radius: .5rem; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent); }
.nav-list a[aria-current="true"] { color: var(--brand); }
.nav-list a[aria-current="true"]::after { width: 100%; }

/* Sidebar header in drawer */
.nav-profile { display: none; }
.nav-profile-inner { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem .5rem; border-bottom: 1px dashed var(--border); margin-bottom: .5rem; }
.nav-profile-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--brand) 60%, transparent); object-fit: cover; }
.nav-profile-text { display: grid; line-height: 1.2; }
.nav-profile-text small { color: var(--muted); }
.nav-close { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: color-mix(in srgb, var(--panel) 86%, transparent); color: var(--text); cursor: pointer; }
.nav-close:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.nav-social { display: flex; gap: .5rem; padding: .5rem; }
.nav-social a { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); text-decoration: none; padding: .35rem .5rem; border-radius: .5rem; }
.nav-social a:hover { color: var(--brand); background: color-mix(in srgb, var(--panel) 90%, transparent); }

.actions { display: flex; align-items: center; gap: .6rem; }
.btn { 
    --btn-py: .6rem; 
    --btn-px: .9rem; 
    --btn-radius: .6rem; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: .5rem; 
    padding: var(--btn-py) var(--btn-px); 
    border-radius: var(--btn-radius); 
    border: 1px solid var(--border); 
    color: var(--text); 
    text-decoration: none; 
    background: rgba(31, 41, 55, 0.5); 
    box-shadow: var(--shadow); 
    font-size: 1rem; 
    line-height: 1.2; 
    transition: all 0.3s ease;
}
.btn:hover { 
    border-color: var(--brand); 
    background-color: rgba(31, 41, 55, 0.8); 
    transform: translateY(-2px); 
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.18), var(--shadow); 
}
.btn:active { transform: translateY(0); }
.btn { position: relative; overflow: hidden; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 30%, transparent), 0 0 0 7px color-mix(in srgb, var(--accent) 20%, transparent), var(--shadow); }
.btn.primary { 
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%); 
    color: white; 
    border-color: var(--brand); 
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}
.btn.primary::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120px 60px at -20% 10%, rgba(255,255,255,.5), transparent 60%); transform: translateX(-60%); transition: transform .5s ease; }
.btn.primary:hover::after { transform: translateX(40%); }
.btn.ghost { background: transparent; }
.btn.small { padding: .45rem .7rem; font-size: .92rem; }
.btn-sm { --btn-py: .45rem; --btn-px: .7rem; --btn-radius: .55rem; font-size: .92rem; }
.btn-md { --btn-py: .6rem; --btn-px: .9rem; --btn-radius: .6rem; font-size: 1rem; }
.btn.icon-btn { padding: .5rem; width: 36px; height: 36px; }
.btn .icon { width: 18px; height: 18px; flex-shrink: 0; }
.header-cta { padding: .55rem .8rem; gap: .45rem; }
.header-cta .icon { display: none; }
.btn.cta { gap: .5rem; padding: .5rem .8rem; border-radius: .8rem; background: color-mix(in srgb, var(--panel) 90%, transparent); border-color: color-mix(in srgb, var(--brand) 25%, var(--border)); overflow: visible; }
.btn.cta:hover { background: color-mix(in srgb, var(--panel) 82%, transparent); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.btn .icon { display: inline-block; }
/* Active/pressed feedback */
.btn.primary:active { filter: brightness(.96); }
.btn.cta:active { background: color-mix(in srgb, var(--panel) 78%, transparent); }
.btn.ghost:active { background: color-mix(in srgb, var(--panel) 90%, transparent); }

/* CTA hover waves */
.btn.cta::before,
.btn.cta::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    border: 2px solid color-mix(in srgb, var(--brand) 55%, transparent);
    opacity: 0;
    transform: scale(.95);
    pointer-events: none;
}
.btn.cta:hover::before,
.btn.cta:focus-visible::before { animation: cta-wave 1.8s ease-out infinite; }
.btn.cta:hover::after,
.btn.cta:focus-visible::after { animation: cta-wave 1.8s ease-out infinite .45s; }

@keyframes cta-wave {
    0% { opacity: .3; transform: scale(1); }
    70% { opacity: .08; transform: scale(1.28); }
    100% { opacity: 0; transform: scale(1.4); }
}

@media (prefers-reduced-motion: reduce) {
    .btn.cta::before,
    .btn.cta::after { animation: none !important; }
}

.hero { padding: 4.5rem 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(1.8rem, 2.5vw + 1rem, 3rem); line-height: 1.2; margin: 0 0 1rem; }
.lead { font-size: 1.05rem; color: var(--text); opacity: .9; }
.cta-row { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.hero-highlights { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1.25rem 0 0; list-style: none; }
.hero-highlights .badge { background: color-mix(in srgb, var(--panel) 86%, transparent); border-color: color-mix(in srgb, var(--brand) 18%, var(--border)); }
.hero-highlights .badge:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); transform: translateY(-2px); transition: transform .15s ease; }
.hero-media { display: flex; justify-content: center; }
.avatar-frame {
    position: relative; border-radius: 1.25rem; overflow: hidden;
    background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 60%),
                radial-gradient(120% 120% at 100% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
                color-mix(in srgb, var(--panel) 80%, transparent);
    box-shadow: var(--shadow);
    max-width: 420px; width: 100%;
}
.avatar-frame::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    padding: 2px; /* gradient ring thickness */
    background: conic-gradient(from 180deg, var(--brand), var(--accent), var(--brand));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: .35;
}
.avatar-frame img { width: 100%; height: auto; display: block; border-radius: inherit; transition: transform .6s cubic-bezier(.2,.8,.2,1); object-fit: cover; }
.avatar-frame:hover img { transform: scale(1.03); }

/* Button spinner (used on submit) */
.spinner {
    width: 14px; height: 14px; border: 2px solid color-mix(in srgb, var(--panel) 50%, transparent);
    border-top-color: white; border-radius: 50%; display: inline-block; margin-inline-end: .4rem;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }

.section { 
    padding: clamp(2.5rem, 6vw, 4rem) 0; 
    scroll-margin-top: 84px;
    position: relative;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(60px, 15vw, 100px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    opacity: 0.6;
}

/* Enhanced section spacing for better visual hierarchy */
.section + .section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: clamp(3rem, 7vw, 5rem);
}

.section:first-child {
    padding-top: clamp(2rem, 5vw, 3rem);
}
/* Enhanced section headers */
.section-header { 
    display: flex; 
    align-items: baseline; 
    justify-content: space-between; 
    gap: 1rem; 
    margin-bottom: 2rem; 
    position: relative; 
    text-align: center;
}

.section h2 { 
    margin: 0; 
    font-size: clamp(1.6rem, 4vw, 2.2rem); 
    font-weight: 800; 
    letter-spacing: .02em;
    line-height: 1.2;
    color: var(--text);
    position: relative;
    padding-bottom: 1rem;
    transition: all 0.3s ease;
    cursor: default;
}

.section h2:hover {
    color: var(--brand);
    transform: translateY(-1px);
}

.section-header h2::after { 
    content: ""; 
    display: block; 
    height: 4px; 
    width: clamp(60px, 15vw, 120px); 
    background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 50%, var(--brand) 100%); 
    border-radius: 2px; 
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

.section-header:hover h2::after,
.section-header:focus-within h2::after {
    width: clamp(80px, 20vw, 140px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    background: linear-gradient(90deg, var(--accent) 0%, var(--brand) 50%, var(--accent) 100%);
}

/* Responsive adjustments for section headers */
@media (max-width: 768px) {
    .section-header h2 {
        padding-bottom: 0.75rem;
        font-size: clamp(1.4rem, 5vw, 1.8rem);
    }
    
    .section-header h2::after {
        height: 3px;
        width: clamp(50px, 25vw, 80px);
    }
    
    .section-header:hover h2::after {
        width: clamp(60px, 30vw, 100px);
    }
    
    .section-header .subtitle {
        margin-top: 0.5rem;
        padding: 0 1rem;
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }
}

@media (max-width: 480px) {
    .section-header h2 {
        font-size: clamp(1.3rem, 6vw, 1.6rem);
        padding-bottom: 0.6rem;
    }
    
    .section-header h2::after {
        height: 2.5px;
        width: clamp(40px, 30vw, 60px);
    }
    
    .section-header:hover h2::after {
        width: clamp(50px, 35vw, 70px);
    }
    
    .section-header .subtitle {
        font-size: clamp(0.85rem, 3.5vw, 1rem);
    }
}
.location { font-style: normal; }
.location a { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--panel) 90%, transparent); color: var(--muted); border: 1px solid var(--border); text-decoration: none; white-space: nowrap; }
.location a:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); box-shadow: var(--shadow); }
.location svg { opacity: .9; }
.muted { color: var(--muted); }
.prose { color: var(--text); opacity: .95; line-height: 1.75; max-width: 68ch; }

/* Section intro and chips */
.section-intro { display: grid; gap: .6rem; margin-bottom: 1rem; }
.eyebrow { margin: 1rem 0 .5rem; font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { border: 1px solid var(--border); background: color-mix(in srgb, var(--panel) 82%, transparent); color: var(--text); border-radius: 999px; padding: .4rem .75rem; font-size: .9rem; display: inline-flex; align-items: center; gap: .4rem; }
.chip strong { font-weight: 700; }
.chip span { color: var(--muted); }
.chip strong + span { margin-left: .35rem; }
@media (max-width: 720px) {
    .chips { gap: .4rem; }
    .chip { padding: .35rem .6rem; font-size: .88rem; }
}

.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.card { 
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: .9rem;
    padding: 1rem;
    box-shadow: var(--shadow);
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
}
.badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.badge { display: inline-flex; align-items: center; padding: .25rem .5rem; font-size: .85rem; border-radius: .65rem; border: 1px solid var(--border); color: var(--text); background: color-mix(in srgb, var(--panel) 70%, transparent); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; align-items: stretch; }
.card-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card.project { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: center; }
.project-media { background: color-mix(in srgb, var(--panel) 85%, transparent); border: 1px solid var(--border); border-radius: .6rem; display: grid; place-items: center; padding: 0; overflow: hidden; aspect-ratio: 16 / 9; }
.project-media img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transition: transform .45s ease; }
.card.project:hover .project-media img { transform: scale(1.03); }
.card.project:hover { 
    border-color: var(--brand);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.2), 0 0 30px rgba(20, 184, 166, 0.1);
    transition: all .3s ease;
}
.project-body { margin-top: 0; }
.project-body .btn.cta { margin: .75rem auto 0; align-self: center; }
.project-body { margin-top: .75rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }

/* Project badges */
.project-badge {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
}

.project-badge .badge {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    padding: .5rem .8rem;
    border-radius: 1rem;
    border: 1px solid transparent;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.project-badge .badge.graduation {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 15px rgba(37, 99, 235, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.project-badge .badge.teamwork {
    background: linear-gradient(135deg, var(--accent) 0%, #0d9488 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 15px rgba(20, 184, 166, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.project-badge .badge:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 4px 10px rgba(0, 0, 0, 0.1);
}

.project-badge .badge:active {
    transform: translateY(0) scale(0.98);
    transition: all 0.1s ease;
}

/* Badge icon styling */
.project-badge .badge .icon {
    width: 14px;
    height: 14px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.edu { display: grid; grid-template-columns: 140px 1fr; gap: 1rem; align-items: center; }
.edu-media { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* Mobile education layout */
@media (max-width: 720px) {
    .edu { grid-template-columns: 1fr; gap: 1rem; align-items: start; }
    .edu-media { flex-direction: column; gap: .5rem; align-items: center; }
    .edu-media img { width: 56px; height: 56px; }
    .edu-body { text-align: center; }
}
.edu-media img {
    width: 64px; height: 64px; object-fit: contain;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: .75rem; padding: .4rem; border: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(0,0,0,.2);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.edu-media img:hover { 
    transform: translateY(-2px) scale(1.03); 
    box-shadow: 0 10px 24px rgba(0,0,0,.3); 
    border-color: var(--brand); 
}
.edu-media img:active { transform: translateY(0) scale(1.01); }

.accordion details { border: 1px solid var(--border); border-radius: .75rem; padding: .75rem 1rem; background: var(--card); }
.accordion details + details { margin-top: .75rem; }
.accordion summary { cursor: pointer; font-weight: 600; }
.cert-list { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .75rem; }
.cert-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: .9rem; background: var(--card); transition: transform .2s ease, border-color .2s ease; }
.cert-list li:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.cert-list a {
    display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
    color: var(--brand); border: 1px solid var(--border); border-radius: .7rem;
    padding: .5rem .8rem; background: color-mix(in srgb, var(--panel) 92%, transparent);
    font-weight: 600; line-height: 1.1; white-space: nowrap;
}
.cert-list a:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); background: color-mix(in srgb, var(--panel) 88%, transparent); }
.cert-list a::after { content: ""; flex: 0 0 16px; width: 16px; height: 16px; background: currentColor; opacity: .9; margin-left: .1rem;
    -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17L17 7M8 7h9v9"/></svg>') center / contain no-repeat;
            mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17L17 7M8 7h9v9"/></svg>') center / contain no-repeat;
}

/* removed email shortcut styles */

/* Smooth scrolling */
html { scroll-behavior: smooth; }

/* Contact form */
.contact-form { margin-top: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; align-items: start; }
.field { display: grid; gap: .4rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field textarea {
    width: 100%; 
    padding: .9rem 1rem; 
    border-radius: .8rem; 
    border: 1px solid var(--border);
    background: rgba(31, 41, 55, 0.5); 
    color: var(--text);
    transition: all 0.3s ease;
}
.field .error { display: none; color: #dc2626; font-size: .85rem; }
.field.invalid input, .field.invalid textarea { border-color: color-mix(in srgb, #dc2626 60%, var(--border)); }
.field.invalid .error { display: block; }
.field.valid input, .field.valid textarea { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.field textarea { resize: none; min-height: 160px; max-height: 160px; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.field input:focus-visible, .field textarea:focus-visible { 
    outline: none; 
    border-color: var(--brand); 
    background-color: rgba(31, 41, 55, 0.8); 
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2); 
}
.form-actions { margin-top: .5rem; display: flex; justify-content: flex-end; }
.form-hint { margin-top: .4rem; font-size: .9rem; }

/* Submission feedback */
.form-status { margin-bottom: .75rem; font-size: .95rem; padding: .6rem .8rem; border-radius: .65rem; border: 1px solid transparent; display: none; align-items: center; gap: .5rem; }
.form-status.show { display: inline-flex; }
.form-status.success { color: #16a34a; background: color-mix(in srgb, #22c55e 8%, transparent); border-color: color-mix(in srgb, #16a34a 40%, var(--border)); }
.form-status.error { color: #dc2626; background: color-mix(in srgb, #ef4444 8%, transparent); border-color: color-mix(in srgb, #dc2626 40%, var(--border)); }

/* Custom toast for submission feedback */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    color: var(--text);
    border: 1px solid var(--border);
    padding: .75rem 1rem; border-radius: .9rem; box-shadow: var(--shadow); opacity: 0;
    display: flex; align-items: center; gap: .6rem; z-index: 3000;
}
.toast.success { border-color: color-mix(in srgb, #22c55e 50%, var(--border)); }
.toast.error { border-color: color-mix(in srgb, #ef4444 50%, var(--border)); }
.toast .icon { width: 18px; height: 18px; display: inline-block; }

/* Social links */
.social-links { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.social { 
    display: inline-flex; 
    align-items: center; 
    gap: .45rem; 
    color: var(--muted); 
    text-decoration: none; 
    border: 1px solid var(--border); 
    border-radius: .7rem; 
    padding: .45rem .6rem; 
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}
.social:hover { 
    color: var(--brand); 
    border-color: var(--brand); 
    background-color: rgba(17, 24, 39, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}
.social .icon { width: 16px; height: 16px; opacity: .95; }

@media (max-width: 720px) {
    .form-grid { grid-template-columns: 1fr; }
}

/* Mobile alignment for certification items */
@media (max-width: 720px) {
    .cert-list { gap: .75rem; }
    .cert-list li { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: .9rem; background: var(--card); }
    .cert-list li > div { width: 100%; }
    .cert-list a { width: 100%; justify-content: center; }
}

/* Tablet/Desktop certifications grid */
@media (min-width: 900px) {
    .cert-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.site-footer { border-top: 1px solid var(--border); padding: 1.25rem 0; background: color-mix(in srgb, var(--panel) 92%, transparent); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-footer a { color: var(--muted); text-decoration: none; margin-left: .75rem; }
.site-footer a:hover { color: var(--brand); }

/* Micro-interactions */
[data-elevate] { box-shadow: var(--shadow); }
[data-reveal] { opacity: 0; transform: translateY(10px); animation: reveal .6s ease forwards; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }

/* Timeline Styles for Certifications */
.timeline { 
    position: relative; 
    max-width: 1000px; 
    margin: 0 auto; 
}

.timeline::after { 
    content: ''; 
    position: absolute; 
    width: 3px; 
    background: linear-gradient(180deg, var(--brand), var(--accent)); 
    top: 0; 
    bottom: 0; 
    left: 50%; 
    transform: translateX(-1.5px); 
    border-radius: 3px; 
}

.timeline-item { 
    padding: 10px 40px; 
    position: relative; 
    width: 50%; 
}

.timeline-item .timeline-dot { 
    content: ''; 
    position: absolute; 
    width: 20px; 
    height: 20px; 
    right: -10px; 
    background-color: var(--bg); 
    border: 4px solid var(--brand); 
    top: 25px; 
    border-radius: 50%; 
    z-index: 1; 
    transition: all 0.3s ease; 
}

.timeline-item.left { left: 0; }
.timeline-item.right { left: 50%; }
.timeline-item.right .timeline-dot { left: -10px; }

.timeline-content { 
    padding: 20px; 
    position: relative; 
    border-radius: 0.75rem; 
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.2), 0 0 30px rgba(20, 184, 166, 0.1);
    border-color: var(--brand);
}

.timeline-item:hover .timeline-dot { 
    transform: scale(1.2); 
    box-shadow: 0 0 15px var(--brand); 
}

.timeline-content h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
}

.timeline-content p {
    margin: 0.25rem 0 0.75rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.timeline-content .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(20, 184, 166, 0.15);
    transition: all 0.3s ease;
}

.timeline-content .status-completed {
    color: var(--accent);
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.timeline-content .status-progress {
    background: rgba(37, 99, 235, 0.15);
    color: var(--brand);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.timeline-content .verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.75rem;
    font-weight: 500;
}

.timeline-content .badges-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.timeline-content .status-badge:hover,
.timeline-content .verified-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timeline-content .links {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.timeline-content .links a {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 2.5rem 0.5rem 2rem; /* Increase padding to make room for icons */
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--accent);
    position: relative;
    transition: all 0.3s ease;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    border: 1px solid var(--border);
    border-radius: 0.7rem;
}

.timeline-content .links a .uni-icon {
    position: absolute;
    left: 0.75rem; /* Position from left edge */
    width: 16px;
    height: 16px;
    opacity: 0.9;
}

.timeline-content .links a .arrow-icon {
    position: absolute;
    right: 0.75rem; /* Position from right edge */
    width: 14px;
    height: 14px;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.timeline-content .links a:hover .arrow-icon {
    transform: translateX(3px);
}

.timeline-content .links a span {
    z-index: 1; /* Ensure text stays above icons */
}

@media screen and (max-width: 768px) {
    .timeline::after { 
        left: 20px; 
        transform: translateX(0); 
    }
    .timeline-item { 
        width: 100%; 
        padding-left: 50px; 
        padding-right: 10px; 
    }
    .timeline-item.left, 
    .timeline-item.right { 
        left: 0; 
    }
    .timeline-item .timeline-dot { 
        left: 10px; 
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .container { width: min(1100px, 94%); }
    .hero { padding: 3.5rem 0 2rem; }
    .card-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}
@media (max-width: 900px) {
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .header-inner { grid-template-columns: 1fr auto; }
    .nav-toggle { display: inline-block; }
    /* Off-canvas drawer */
    .nav-list { position: fixed; inset: 0 0 0 20%; margin-left: auto; top: 0; height: 100dvh; background: var(--panel); border-left: 1px solid var(--border); border-radius: 0; padding: .75rem; display: flex; flex-direction: column; width: clamp(260px, 70vw, 320px); max-width: 90vw; box-shadow: var(--shadow); transform: translate3d(104%,0,0); transition: transform .32s cubic-bezier(.22,.72,.22,1); z-index: 9999; will-change: transform; backface-visibility: hidden; overscroll-behavior: contain; overflow-y: auto; contain: paint; }
    .nav-list.show { transform: translateX(0); }
    /* Staggered items */
    .nav-list > li { opacity: 0; transform: translateX(10px); transition: opacity .25s ease, transform .25s ease; }
    .nav-list.show > li { opacity: 1; transform: translateX(0); }
    .nav-list.show > li:nth-child(1) { transition-delay: .04s; }
    .nav-list.show > li:nth-child(2) { transition-delay: .08s; }
    .nav-list.show > li:nth-child(3) { transition-delay: .12s; }
    .nav-list.show > li:nth-child(4) { transition-delay: .16s; }
    .nav-list.show > li:nth-child(5) { transition-delay: .20s; }
    .nav-list.show > li:nth-child(6) { transition-delay: .24s; }
    .nav-list.show > li:nth-child(7) { transition-delay: .28s; }
    .nav-list.show > li:nth-child(8) { transition-delay: .32s; }
    .nav-profile-inner { opacity: 0; transform: translateY(-6px); transition: opacity .25s ease, transform .25s ease; }
    .nav-list.show .nav-profile-inner { opacity: 1; transform: translateY(0); transition-delay: .02s; }
    .nav-list a { padding: .6rem .75rem; border-radius: .6rem; }
    .nav-list a:active { background: color-mix(in srgb, var(--panel) 86%, transparent); }
    .brand-role { display: none; }
    .nav-profile { display: block; }
    .nav-list a.is-active { color: var(--brand); background: color-mix(in srgb, var(--panel) 90%, transparent); }
    .card-grid { grid-template-columns: 1fr; gap: 1rem; }
    .project-media { aspect-ratio: 16/10; }
    .site-footer .footer-inner { flex-direction: column; gap: .5rem; text-align: center; }
    .header-cta { padding: .5rem .65rem; font-size: .95rem; z-index: 0; position: relative; }
    .header-cta .icon { display: inline-block; width: 18px; height: 18px; }
}

/* Drawer overlay */
.overlay { position: fixed; inset: 0; background: rgba(2,6,23,.55); backdrop-filter: blur(1px); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; z-index: 900; }
.overlay.show { opacity: 1; visibility: visible; }

.fab-to-top {
    position: fixed; 
    right: 20px; 
    bottom: 24px; 
    width: 44px; 
    height: 44px;
    display: grid; 
    place-items: center; 
    border-radius: 999px; 
    border: 1px solid var(--border);
    background: linear-gradient(45deg, var(--brand), var(--accent)); 
    color: white;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3), inset 0 0 0 1px rgba(255,255,255,.08);
    cursor: pointer; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s, box-shadow .25s ease, filter .25s ease;
    z-index: 1200;
}

.fab-to-top.show { 
    opacity: 1; 
    visibility: visible; 
    transform: translateY(0); 
}

.fab-to-top:hover { 
    filter: brightness(1.07); 
    box-shadow: 0 12px 28px rgba(0,0,0,.3), 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); 
}

.fab-to-top:focus-visible { 
    outline: none; 
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 35%, transparent), var(--shadow); 
}

.fab-to-top svg { 
    width: 18px; 
    height: 18px; 
}

.fab-to-top::before {
    content: ""; 
    position: absolute; 
    inset: -2px; 
    border-radius: inherit; 
    padding: 2px;
    background: conic-gradient(from 0deg, var(--brand), var(--accent), var(--brand));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; 
    mask-composite: exclude; 
    opacity: .35; 
    pointer-events: none;
}

/* Consolidated media queries */
@media (prefers-reduced-motion: reduce) {
    .fab-to-top,
    .nav-list,
    .nav-list > li, 
    .nav-profile-inner,
    .overlay { 
        transition: none; 
    }
}

@media (pointer: coarse) {
    .fab-to-top { 
        width: 52px; 
        height: 52px; 
        right: clamp(12px, 4vw, 20px); 
        bottom: calc(20px + env(safe-area-inset-bottom)); 
    }
}

/* Contact form enhancements */
.contact-form {
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 15%, var(--border));
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.field input, .field textarea {
    background: color-mix(in srgb, var(--panel) 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--border));
    color: var(--text);
    transition: all 0.3s ease;
}

.field input:hover, .field textarea:hover {
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
}

.field input:focus-visible, .field textarea:focus-visible {
    background: color-mix(in srgb, var(--panel) 85%, transparent);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent);
}

/* Enhanced social icons */
.social {
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--border));
    padding: 0.5rem 0.8rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social:hover {
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}

.social:active {
    transform: translateY(-1px);
}

/* Light mode adjustments */
@media (prefers-color-scheme: light) {
    .contact-form {
        background: rgba(255, 255, 255, 0.9);
        border-color: color-mix(in srgb, var(--brand) 25%, #e2e8f0);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    }

    .field input, .field textarea {
        background: rgba(255, 255, 255, 0.95);
        border-color: color-mix(in srgb, var(--brand) 30%, #cbd5e1);
    }

    .field input:hover, .field textarea:hover {
        background: #ffffff;
        border-color: color-mix(in srgb, var(--brand) 40%, #cbd5e1);
    }

    .social {
        background: rgba(255, 255, 255, 0.9);
        border-color: color-mix(in srgb, var(--brand) 30%, #cbd5e1);
    }

    .social:hover {
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
    }
}


