@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&display=swap');

/* ---------- Tokens ---------- */
:root {
    --bg: #14171a;
    --bg-elev: #1f2326;
    --bg-elev-2: #262b2f;
    --border: #2d3338;
    --text: #ededed;
    --text-dim: #c4c8cc;
    --text-mute: #9aa0a6;
    --accent: #4f8cff;          /* steel blue */
    --accent-2: #7aa9ff;        /* lighter steel blue */
    --accent-grad: linear-gradient(135deg, #4f8cff 0%, #7aa9ff 100%);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --space-5: 3rem;
    --space-6: 4rem;

    --nav-h: 64px;
    --container: 1100px;

    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --ring: 0 0 0 2px rgba(79, 140, 255, 0.35);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .2s ease;
}
a:hover { color: var(--accent-2); }

:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--radius-sm);
}

.accent {
    background: var(--accent-grad);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
}

/* ---------- Navbar ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-3);
    background: rgba(20, 23, 26, 0.75);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: 0.04em;
}
.brand:hover { color: var(--text); }
.brand-dot {
    background: var(--accent-grad);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--space-3);
}
.nav-links a {
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 4px;
    position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 0;
    height: 2px;
    background: var(--accent-grad);
    transition: width .25s ease;
}
.nav-links a:hover::after,
.nav-links a.is-active::after { width: 100%; }
.nav-links a.is-active { color: var(--text); }

/* Hamburger — hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    z-index: 1100;
    transition: border-color .2s ease;
}
.hamburger:hover { border-color: var(--accent); }
.hamburger span {
    display: block;
    margin: 0 auto;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 900;
}
.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.no-scroll { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-3);
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(600px 400px at 20% 20%, rgba(79, 140, 255, 0.12), transparent 60%),
        radial-gradient(500px 400px at 80% 70%, rgba(122, 169, 255, 0.08), transparent 60%);
    pointer-events: none;
}
.hero-inner {
    position: relative;
    max-width: var(--container);
    width: 100%;
    text-align: center;
}
.eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin: 0 0 var(--space-2);
}
.hero h1 {
    font-size: clamp(2.25rem, 6vw + 1rem, 4.5rem);
    line-height: 1.05;
    margin: 0 0 var(--space-2);
    font-weight: 800;
    letter-spacing: -0.02em;
}
.hero-sub {
    font-size: clamp(1rem, 1.5vw + 0.5rem, 1.25rem);
    color: var(--text-dim);
    max-width: 640px;
    margin: 0 auto var(--space-4);
}
.hero-cta {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Sections ---------- */
.section {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-6) var(--space-3);
    scroll-margin-top: calc(var(--nav-h) + 16px);
}
.section-head {
    margin-bottom: var(--space-4);
}
.section-head h2 {
    font-size: clamp(1.6rem, 2.5vw + 0.5rem, 2.25rem);
    font-weight: 700;
    margin: 0 0 var(--space-1);
    letter-spacing: -0.01em;
    position: relative;
    display: inline-block;
}
.section-head h2::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin-top: 10px;
    border-radius: 2px;
    background: var(--accent-grad);
}
.section-sub {
    color: var(--text-mute);
    margin: 0;
}

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: auto 1.4fr 1fr;
    gap: var(--space-4);
    align-items: start;
}

.about-photo-wrap {
    display: flex;
    justify-content: center;
}

.profile-photo {
    width: 160px;
    height: 160px;
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 6px rgba(79, 140, 255, 0.12);
}
.about-text p {
    margin: 0 0 var(--space-2);
    color: var(--text-dim);
    font-size: 1.05rem;
    line-height: 1.7;
}
.about-text p:last-child { margin-bottom: 0; }
.about-text strong {
    color: var(--text);
    font-weight: 600;
}
.about-facts {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.about-facts li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.about-facts li:last-child { border-bottom: none; }
.fact-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-mute);
}
.about-facts li > span:last-child {
    color: var(--text);
    text-align: right;
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    .about-photo-wrap {
        justify-content: flex-start;
    }
    .profile-photo {
        width: 120px;
        height: 120px;
    }
}

/* ---------- Cards / Skills ---------- */
.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-2);
}
.card {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    padding: 18px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: var(--bg-elev-2);
}
.card-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    background: rgba(79, 140, 255, 0.08);
    border: 1px solid rgba(79, 140, 255, 0.22);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    min-width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Projects ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-3);
}
.project-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.project-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.project-card h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}
.project-card p {
    margin: 0;
    color: var(--text-dim);
    flex: 1;
}
.tags {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tags li {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-dim);
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 999px;
}
.card-link {
    align-self: flex-start;
    font-weight: 500;
    font-size: 0.95rem;
}

/* ---------- Coursework ---------- */
.course-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-2);
}
.course-list li {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
}

/* ---------- Contact ---------- */
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--space-2);
    max-width: 560px;
}
.contact-list li {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    padding: 14px 18px;
    border-radius: var(--radius);
    flex-wrap: wrap;
}
.contact-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    min-width: 72px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease;
    border: 1px solid transparent;
    cursor: pointer;
}
.btn-icon {
    flex-shrink: 0;
    transition: transform .2s ease;
}
.btn:hover .btn-icon {
    transform: translateY(2px);
}
.btn-primary {
    background: var(--accent-grad);
    color: #14171a;
}
.btn-primary:hover {
    transform: translateY(-1px);
    color: #14171a;
}
.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- Footer ---------- */
.footer {
    border-top: 1px solid var(--border);
    color: var(--text-mute);
    text-align: center;
    padding: var(--space-3);
    margin-top: var(--space-5);
    font-size: 0.9rem;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100dvh;
        width: min(78%, 320px);
        background: var(--bg-elev);
        border-left: 1px solid var(--border);
        flex-direction: column;
        gap: var(--space-3);
        padding: calc(var(--nav-h) + var(--space-3)) var(--space-3) var(--space-3);
        transform: translateX(100%);
        transition: transform .3s cubic-bezier(.4, 0, .2, 1);
        z-index: 1001;
    }
    .nav-links.active {
        transform: translateX(0);
    }
    .nav-links a {
        font-size: 1.15rem;
        color: var(--text);
        display: block;
        padding: 10px 0;
    }
    .nav-links a::after { display: none; }

    .section {
        padding: var(--space-5) var(--space-3);
    }

    .hero {
        min-height: auto;
        padding: var(--space-5) var(--space-3) var(--space-6);
    }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .hero-cta .btn { text-align: center; }
}

@media (max-width: 420px) {
    .navbar { padding: 0 var(--space-2); }
    .section { padding: var(--space-4) var(--space-2); }
    .contact-list li { flex-direction: column; gap: 4px; align-items: flex-start; }
    .contact-label { min-width: 0; }
}


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