:root {
    --bg: #0e1212;
    --bg-raised: #151a1a;
    --border: #232a2a;
    --text: #dbdbdb;
    --text-strong: #ffffff;
    --muted: #8d9595;
    --accent: #682ae9;          /* brand purple: borders, fills */
    --accent-text: #9d74ff;     /* lighter tint for readable text on dark */
    --radius: 6px;
    --max: 960px;
    --ease: cubic-bezier(.645, .045, .355, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: .2px;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--text-strong); }
h1, h2, h3 { color: var(--text-strong); line-height: 1.3; margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 2px; }

.accent { color: var(--accent-text); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.skip-link {
    position: absolute; left: 16px; top: -40px; z-index: 100;
    background: var(--accent); color: #fff; padding: 6px 12px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- header ---------- */
.site-header {
    position: fixed; inset: 0 0 auto 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    height: 70px; padding: 0 48px;
    background: rgba(14, 18, 18, .85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: box-shadow .3s var(--ease);
}
.site-header.scrolled { box-shadow: 0 1px 0 var(--border); }

.logo {
    width: 40px; height: 40px; border: 2px solid var(--text-strong); border-radius: 50%;
    display: grid; place-items: center;
    color: var(--text-strong); font-weight: 700; font-size: 18px;
}
.logo:hover { border-color: var(--accent); color: var(--text-strong); }

.nav ul { display: flex; gap: 6px; }
.nav a { color: var(--text-strong); font-size: 14px; padding: 6px 8px; }
.nav a:hover, .nav a.active { color: var(--accent-text); }

.nav-toggle { display: none; }

/* ---------- hero ---------- */
.hero {
    min-height: 100vh; min-height: 100svh;
    display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 100px 20px 60px;
}
.hero-inner { max-width: 820px; }
.hero-hello { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.hero-title { font-size: clamp(20px, 3vw, 28px); font-weight: 700; }
.hero-text { max-width: 600px; margin: 16px auto 0; font-size: 14px; color: var(--text); }

.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }

.btn {
    display: inline-block; padding: 8px 22px;
    border: 1px solid var(--accent); border-radius: var(--radius);
    color: var(--accent-text); font-size: 15px;
    transition: all .3s var(--ease);
}
.btn:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.btn-solid { background: var(--accent); color: #fff; }
.btn-solid:hover { background: transparent; color: var(--accent-text); }

/* ---------- sections ---------- */
.section { padding: 70px 0 30px; }
.section-title { text-align: center; color: var(--accent-text); font-size: 24px; margin-bottom: 40px; }
.container { width: 90%; max-width: var(--max); margin: 0 auto; }
.sub-title { color: var(--muted); font-size: 14px; font-weight: 400; margin: 28px 0 12px; }

/* about */
.about-grid { display: grid; grid-template-columns: 1fr 280px; gap: 56px; align-items: start; }
.about-text p { margin: 0 0 16px; }
.edu-list li + li { margin-top: 12px; }
.edu-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.edu-head strong { color: var(--text-strong); }
.edu-list .muted { font-size: 13px; }

.photo { padding: 8px 16px 16px 0; }
.photo-box { position: relative; border-radius: var(--radius); }
.photo-box img { position: relative; z-index: 2; border-radius: var(--radius); width: 100%; height: auto; filter: grayscale(30%) brightness(.85); transition: filter .3s var(--ease); }
.photo-box::after {
    content: ""; position: absolute; inset: 0; z-index: 1;
    border: 2px solid var(--accent); border-radius: var(--radius);
    transform: translate(14px, 14px); transition: transform .3s var(--ease);
}
.photo-box:hover img { filter: none; }
.photo-box:hover::after { transform: translate(22px, 22px); }

.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; margin-top: 12px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
    font-size: 12px; padding: 2px 10px;
    border: 1px solid var(--border); border-radius: 999px; background: var(--bg-raised);
}
.tags-sm li { font-size: 11px; padding: 1px 8px; color: var(--accent-text); border-color: transparent; background: rgba(104, 42, 233, .12); }

/* experience */
.timeline { border-left: 2px solid var(--border); margin-left: 6px; }
.job { position: relative; padding: 0 0 34px 28px; }
.job:last-child { padding-bottom: 0; }
.job::before {
    content: ""; position: absolute; left: -7px; top: 8px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--accent);
}
.job-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.job-head h3 { font-size: 17px; }
.job-head .muted { font-size: 13px; }

.points li { position: relative; padding-left: 22px; margin-bottom: 8px; font-size: 14px; }
.points li::before { content: "▹"; position: absolute; left: 0; color: var(--accent-text); }

/* work */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.project {
    position: relative;
    display: flex; flex-direction: column; gap: 12px;
    padding: 24px;
    background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
    transition: transform .3s var(--ease), border-color .3s var(--ease);
}
.project::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0; transition: opacity .3s var(--ease);
}
.project:hover { transform: translateY(-4px); border-color: var(--accent); }
.project:hover::before { opacity: 1; }
.project-top { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.project-kind { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-text); }
.project-links { display: flex; gap: 12px; }
.project-link { color: var(--muted); display: block; }
.project-link:hover { color: var(--text-strong); }
.project-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.project h3 { font-size: 17px; }
.project p { margin: 0; font-size: 13px; line-height: 1.7; }
.project .tags { margin-top: auto; padding-top: 4px; }

/* achievements */
.highlights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.highlights li {
    display: flex; flex-direction: column; gap: 6px;
    padding: 20px 18px;
    background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
}
.highlights strong { font-size: 28px; line-height: 1.1; color: var(--accent-text); }
.highlights small { font-size: 14px; }
.highlights span { font-size: 12px; line-height: 1.5; color: var(--muted); }

/* contact */
.contact { text-align: center; padding-bottom: 70px; }
.contact-head { font-size: 30px; }
.contact-text { max-width: 640px; margin: 18px auto 0; }

/* footer */
.footer { text-align: center; padding: 20px 16px 28px; }
.social { display: flex; justify-content: center; gap: 26px; margin-bottom: 10px; }
.social a { color: var(--text-strong); display: block; }
.social a:hover { color: var(--accent-text); }
.social svg { width: 20px; height: 20px; fill: currentColor; }
.footer-email { color: var(--text); font-size: 14px; }
.footer p { margin: 6px 0 0; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
    body { font-size: 14px; }
    .site-header { padding: 0 16px; height: 62px; }

    .nav-toggle {
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        width: 40px; height: 40px; padding: 8px; background: none; border: 0; cursor: pointer;
    }
    .nav-toggle span { display: block; height: 2px; background: var(--text-strong); transition: transform .3s var(--ease), opacity .3s; }
    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .nav {
        position: fixed; top: 62px; left: 0; right: 0;
        background: var(--bg); border-bottom: 1px solid var(--border);
        visibility: hidden; opacity: 0; transform: translateY(-8px);
        transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
    }
    .nav.open { visibility: visible; opacity: 1; transform: none; }
    .nav ul { flex-direction: column; align-items: center; padding: 16px 0 22px; gap: 4px; }
    .nav a { display: block; padding: 8px 16px; font-size: 15px; }

    .hero { padding: 90px 16px 50px; }
    .hero-text { font-size: 13px; }

    .section { padding: 50px 0 20px; }
    .section-title { font-size: 19px; margin-bottom: 28px; }
    .container { width: auto; margin: 0 16px; }

    .about-grid { grid-template-columns: 1fr; gap: 28px; }
    .photo { order: -1; max-width: 220px; margin: 0 auto; }
    .skills { grid-template-columns: 1fr; }

    .projects { grid-template-columns: 1fr; }
    .project { padding: 20px; }
    .highlights { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .highlights strong { font-size: 22px; }
    .contact-head { font-size: 22px; }
}

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