:root {
    --bg-primary: #0a0f1d;
    --bg-secondary: #111827;
    --bg-card: #1f293d;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.25);
    --border-color: #374151;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Fluid spacing tokens */
    --gutter: clamp(1rem, 4vw, 2rem);
    --section-y: clamp(3rem, 7vw, 6rem);
    --header-h: 4.5rem;
    --radius: 12px;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Header / Navigation ---------- */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 15, 29, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0.85rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0 var(--gutter);
    min-height: 2.75rem;
}

.logo {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: clamp(1rem, 2.2vw, 2rem);
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
}

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

/* Hamburger button (mobile only) */
.nav-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    padding: 0;
    position: relative;
    flex-shrink: 0;
}

.nav-toggle span {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}

.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    top: 20px;
    transform: translateX(-50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    top: 20px;
    transform: translateX(-50%) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(1.5rem, 4vw, 3rem);
    flex-wrap: wrap;
    padding: calc(var(--header-h) + 2.5rem) var(--gutter) 4rem;
    text-align: center;
    position: relative;
    background: radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
}

.hero-photo img {
    width: clamp(140px, 30vw, 220px);
    height: clamp(140px, 30vw, 220px);
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 40px var(--accent-glow);
}

.hero-content {
    max-width: 900px;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 50px;
    font-size: clamp(0.75rem, 2.4vw, 0.85rem);
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero h1 {
    font-size: clamp(2rem, 7vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
    overflow-wrap: break-word;
}

.hero h1 .accent,
.hero h2 .accent {
    color: var(--accent);
}

.hero h2 {
    font-size: clamp(1rem, 3.2vw, 1.35rem);
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.hero p {
    font-size: clamp(0.95rem, 2.6vw, 1.15rem);
    color: var(--text-muted);
    max-width: 750px;
    margin: 0 auto 2.5rem;
}

.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 46px;
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-card);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

/* ---------- Sections ---------- */
.section {
    padding: var(--section-y) var(--gutter);
    max-width: 1200px;
    margin: 0 auto;
    scroll-margin-top: calc(var(--header-h) + 1rem);
}

.section-title {
    text-align: center;
    margin-bottom: clamp(2rem, 5vw, 4rem);
}

.section-title h2 {
    font-size: clamp(1.6rem, 5vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--text-muted);
    font-size: clamp(0.9rem, 2.4vw, 1rem);
}

/* ---------- Skills Grid ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1.5rem;
}

.skill-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 1.8rem);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

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

.skill-card h3 {
    font-size: 1.05rem;
    color: var(--accent);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-card h3 i {
    flex-shrink: 0;
}

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

.tag {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

/* ---------- Experience Timeline ---------- */
.timeline {
    position: relative;
    max-width: 850px;
    margin: 0 auto;
    padding-left: 2.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border-color);
}

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

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    transform: translateX(-5px);
}

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

.timeline-role {
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    font-weight: 700;
}

.timeline-company {
    color: var(--accent);
    font-weight: 600;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.timeline-body ul {
    list-style: none;
}

.timeline-body li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    overflow-wrap: break-word;
}

.timeline-body li:last-child {
    margin-bottom: 0;
}

.timeline-body li::before {
    content: '\25B8';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ---------- Projects Grid ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

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

.project-title {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.project-points {
    list-style: none;
    margin-bottom: 1.5rem;
}

.project-points li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.6rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    overflow-wrap: break-word;
}

.project-points li::before {
    content: '\25B8';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* ---------- Leadership ---------- */
.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.leadership-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: clamp(1.1rem, 2.6vw, 1.5rem);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

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

.leadership-card i {
    color: var(--accent);
    font-size: 1.15rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.leadership-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ---------- Education ---------- */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.edu-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 1.8rem);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

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

.edu-icon {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.edu-degree {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.edu-college {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
}

.edu-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* ---------- Contact ---------- */
.contact-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: clamp(1.5rem, 4vw, 3rem);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-box > p {
    color: var(--text-muted);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    justify-content: center;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: left;
}

.contact-item:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.contact-item i {
    font-size: 1.15rem;
    color: var(--accent);
    flex-shrink: 0;
}

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 2rem var(--gutter);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

footer .footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Large laptops & small desktops */
@media (max-width: 1200px) {
    .section,
    .nav-container {
        max-width: 100%;
    }
}

/* Small laptops & tablets: tighten the nav so 7 links always fit */
@media (max-width: 1200px) {
    .nav-links {
        gap: clamp(0.9rem, 1.6vw, 1.5rem);
    }

    .nav-links a {
        font-size: 0.88rem;
    }
}

/* Tablet landscape / small laptops */
@media (max-width: 1024px) {
    :root {
        --section-y: 4.5rem;
    }

    .hero {
        min-height: auto;
        padding-top: calc(var(--header-h) + 3.5rem);
    }
}

/* Below this the navigation collapses into the hamburger menu */
@media (max-width: 900px) {
    :root {
        --section-y: 4rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        padding: 0.5rem 0;
        max-height: 0;
        overflow: hidden;
        visibility: hidden;
        transition: max-height 0.35s ease, visibility 0.35s;
    }

    .nav-links.open {
        max-height: 80vh;
        overflow-y: auto;
        visibility: visible;
    }

    .nav-links li {
        border-bottom: 1px solid rgba(55, 65, 81, 0.5);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 0.95rem var(--gutter);
        font-size: 1rem;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(59, 130, 246, 0.1);
    }

    .contact-grid {
        gap: 0.75rem;
    }
}

/* Tablets portrait & large phones */
@media (max-width: 768px) {
    :root {
        --section-y: 3.5rem;
    }

    .hero p {
        margin-bottom: 2rem;
    }

    .timeline {
        padding-left: 1.75rem;
    }

    .timeline-item::before {
        left: -1.75rem;
        transform: translateX(-5px) scale(0.85);
    }

    .section-title {
        margin-bottom: 2.25rem;
    }
}

/* Phones */
@media (max-width: 640px) {
    :root {
        --section-y: 3rem;
        --gutter: 1.1rem;
    }

    .hero {
        gap: 1.5rem;
        padding-bottom: 3rem;
    }

    .hero-badge {
        letter-spacing: 0.5px;
    }

    .btn-group {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
        padding: 0.9rem 1.5rem;
    }

    .skills-grid,
    .projects-grid,
    .leadership-grid,
    .edu-grid {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }

    .timeline-item {
        margin-bottom: 2.25rem;
    }

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

    .contact-item {
        justify-content: flex-start;
    }
}

/* Small phones */
@media (max-width: 400px) {
    :root {
        --gutter: 0.9rem;
    }

    body {
        font-size: 15px;
    }

    .hero h1 {
        letter-spacing: -0.5px;
    }

    .timeline {
        padding-left: 1.4rem;
    }

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

    .timeline-body li,
    .project-points li {
        padding-left: 1rem;
    }
}

/* Hover-capable devices only (keeps mobile from sticky-hovering) */
@media (hover: none) {
    .skill-card:hover,
    .project-card:hover,
    .leadership-card:hover,
    .edu-card:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}

/* Accessibility: respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print / PDF export */
@media print {
    :root {
        --bg-primary: #fff;
        --bg-secondary: #fff;
        --bg-card: #f3f4f6;
        --text-main: #111827;
        --text-muted: #374151;
        --accent: #1d4ed8;
        --border-color: #d1d5db;
    }

    header,
    .btn-group,
    footer .footer-links {
        display: none !important;
    }

    body {
        background: #fff;
        color: #111827;
    }

    .hero {
        min-height: auto;
        padding: 1rem 0;
        page-break-after: avoid;
    }

    .section {
        padding: 1.5rem 0;
        page-break-inside: avoid;
    }

    .skill-card,
    .project-card,
    .leadership-card,
    .edu-card,
    .contact-box {
        break-inside: avoid;
        box-shadow: none;
    }
}