:root {
    --bg: #eef1f6;
    --card: #ffffff;
    --ink: #1f2733;
    --muted: #5b6675;
    --line: #e6e9ef;
    --accent: #2f6df6;
    --accent-2: #5b8cff;
    --accent-soft: #eaf1ff;
    --radius: 16px;
    --shadow: 0 6px 24px rgba(22, 34, 56, .08);
    --shadow-lg: 0 14px 40px rgba(22, 34, 56, .16);
    --maxw: 920px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 18px 64px;
}

/* ---------- Sticky nav ---------- */
.topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    margin-bottom: 26px;
}

.topnav-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 10px 18px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.topnav-inner::-webkit-scrollbar { display: none; }

.topnav a {
    white-space: nowrap;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    transition: background .2s, color .2s;
}

.topnav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background: linear-gradient(135deg, #2f6df6 0%, #5b8cff 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 44px 28px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: 26px;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    right: -80px;
    top: -120px;
    background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%);
    pointer-events: none;
}

.hero-photo {
    width: 152px;
    height: 152px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, .85);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
    position: relative;
}

.hero-name {
    margin: 18px 0 6px;
    font-size: clamp(1.5rem, 4vw, 2.05rem);
    font-weight: 700;
    letter-spacing: .2px;
}

.hero-role {
    margin: 0;
    font-size: 1.06rem;
    opacity: .94;
}

.hero-links {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    position: relative;
}

.hero-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: .92rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, .28);
    transition: background .2s, transform .2s;
}

.hero-links a:hover { background: rgba(255, 255, 255, .3); text-decoration: none; transform: translateY(-2px); }
.hero-links svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Cards / sections ---------- */
.section {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 28px 30px;
    margin-bottom: 22px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .5s ease, transform .5s ease;
}

.section.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .section { opacity: 1; transform: none; transition: none; }
}

.section-title {
    margin: 0 0 18px;
    font-size: 1.32rem;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: "";
    width: 6px;
    height: 22px;
    border-radius: 3px;
    background: linear-gradient(var(--accent), var(--accent-2));
    flex: none;
}

/* ---------- About ---------- */
.about p { margin: 0 0 12px; font-size: 1.04rem; }
.about p:last-child { margin-bottom: 0; }
.about strong { color: var(--accent); }

/* ---------- Directions ---------- */
.dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.dir-card {
    background: #fafbfd;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    transition: transform .25s, box-shadow .25s;
}

.dir-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.dir-card h3 { margin: 0 0 6px; font-size: 1.04rem; color: var(--accent); }
.dir-card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Hero location ---------- */
.hero-loc {
    margin: 10px 0 0;
    font-size: .96rem;
    opacity: .92;
    position: relative;
}

/* ---------- Tech stack ---------- */
.stack-list { display: grid; gap: 12px; }

.stack-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 14px;
    align-items: baseline;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.stack-row:last-child { border-bottom: 0; padding-bottom: 0; }
.stack-cat { font-weight: 700; color: var(--accent); }
.stack-val { color: var(--ink); }

@media (max-width: 560px) {
    .stack-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Projects ---------- */
.proj-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }

.proj-list li {
    background: #fafbfd;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    padding: 12px 16px;
}

.proj-list b { color: var(--ink); }
.proj-note { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }

/* ---------- Languages ---------- */
.lang-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.lang-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.lang-name { font-weight: 700; min-width: 110px; }
.lang-level { color: var(--muted); }

/* ---------- Desired position / facts ---------- */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.fact {
    background: var(--accent-soft);
    border-radius: 12px;
    padding: 14px 16px;
}

.fact .k { font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.fact .v { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-top: 3px; }
.fact .v.salary { color: var(--accent); }

/* ---------- Manifesto ---------- */
.manifesto {
    border-left: 4px solid var(--accent);
    padding-left: 18px;
}

.manifesto p { margin: 0 0 12px; font-size: 1.06rem; }
.manifesto p:last-child { margin-bottom: 0; }
.manifesto .lead { font-weight: 700; }
.manifesto em { color: var(--accent); font-style: normal; font-weight: 600; }

/* ---------- Quals / extra ---------- */
.quals-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.quals-list li { padding-left: 18px; position: relative; }
.quals-list li::before { content: ""; position: absolute; left: 0; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.quals-list .y { color: var(--muted); font-size: .9rem; }

.extra p { margin: 6px 0; }
.extra .label { color: var(--muted); display: inline-block; min-width: 150px; }

/* ---------- Education ---------- */
.edu-item {
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.edu-item:first-of-type { border-top: 0; padding-top: 0; }

.edu-head { font-size: 1.07rem; font-weight: 600; margin: 0 0 4px; }
.edu-meta { margin: 0 0 4px; color: var(--muted); }
.edu-link { margin: 0 0 12px; font-size: .92rem; }

.edu-thumb {
    border-radius: 12px;
    border: 1px solid var(--line);
    display: block;
    width: 100%;
    max-width: 560px;
    cursor: zoom-in;
    transition: transform .25s, box-shadow .25s;
}

.edu-thumb:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* ---------- Experience ---------- */
.job { padding: 20px 0; border-top: 1px solid var(--line); }
.job:first-of-type { border-top: 0; padding-top: 0; }

.job-title { margin: 0 0 2px; font-size: 1.14rem; font-weight: 700; }
.job-role { margin: 0 0 12px; color: var(--accent); font-weight: 600; }
.job h4 { margin: 16px 0 6px; font-size: 1rem; }
.job p, .job li { color: var(--ink); }
.job ul { margin: 8px 0; padding-left: 20px; }
.job li { margin-bottom: 6px; }

/* ---------- Skills ---------- */
.skills-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skills-list li {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: .95rem;
    transition: transform .2s, background .2s;
}

.skills-list li:hover { transform: translateY(-2px); background: #dde9ff; }

/* ---------- Awards ---------- */
.awards-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.awards-list li {
    background: #fafbfd;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .25s, box-shadow .25s;
}

.awards-list li:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.awards-list .thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.award-caption {
    padding: 10px 14px;
    font-size: .9rem;
    color: var(--muted);
}

/* ---------- Video ---------- */
.video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- QR + contacts ---------- */
.qr-img {
    width: 200px;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
    background: #fff;
}

.contacts p { margin: 8px 0; }
.contacts .label { color: var(--muted); display: inline-block; min-width: 168px; }

.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: .85rem;
    margin-top: 30px;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(12, 18, 30, .9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
    cursor: zoom-out;
}

.lightbox.open { display: flex; }
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

@media (max-width: 600px) {
    .section { padding: 22px 18px; }
    .contacts .label { min-width: 0; display: block; }
}
