@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --c-text: #e2e8f0;
    --c-text-muted: #94a3b8;
    --c-bg: #0b1220;
    --c-bg-alt: #111827;
    --c-card: #1e293b;
    --c-border: #1f2937;
    --c-accent: #60a5fa;
    --c-accent-strong: #3b82f6;
    --gradient: linear-gradient(135deg,#5b21b6 0%,#2563eb 50%,#06b6d4 100%);
    --radius: 18px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 8px 24px rgba(0,0,0,.5);
}

html { color-scheme: dark; }

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}

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

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

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === Header === */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    padding: 16px 0;
    transition: background-color .2s ease, backdrop-filter .2s ease, box-shadow .2s ease;
}
.site-header.is-scrolled {
    background: rgba(11,18,32,.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--c-border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.2px; color: var(--c-text); }
.brand .dot { color: #06b6d4; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { color: var(--c-text); font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--c-accent); }
.nav .nav-cta {
    background: var(--gradient);
    color: #fff;
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 600;
}
.nav .nav-cta:hover { color: #fff; opacity: .92; }

@media (max-width: 720px) {
    .nav a:not(.nav-cta) { display: none; }
}

/* === Hero === */
.hero {
    background: var(--gradient);
    color: #fff;
    padding: 160px 0 120px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(60% 60% at 20% 10%, rgba(255,255,255,.18), transparent),
                radial-gradient(50% 50% at 80% 90%, rgba(255,255,255,.12), transparent);
    pointer-events: none;
}
.hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 12px;
    color: rgba(255,255,255,.78);
    margin-bottom: 16px;
}
.hero h1 {
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.5px;
    margin: 0 0 16px;
    font-weight: 700;
}
.hero .subhead {
    font-size: clamp(16px, 2vw, 19px);
    color: rgba(255,255,255,.88);
    max-width: 640px;
    margin: 0 0 32px;
}
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 600; font-size: 14px;
    cursor: pointer;
    border: 0;
    transition: transform .12s ease, opacity .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: #fff; color: #5b21b6; }
.btn-ghost { background: rgba(255,255,255,.15); color: #fff; backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255,255,255,.22); color: #fff; }

/* === Sections === */
section { padding: 96px 0; }
section.alt { background: var(--c-bg-alt); }
.section-label {
    font-size: 12px; text-transform: uppercase; letter-spacing: 3px;
    color: var(--c-text-muted); margin-bottom: 10px;
}
.section-title {
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
    letter-spacing: -0.3px;
    margin: 0 0 40px;
    font-weight: 700;
}

/* === About === */
.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 48px; align-items: center; }
@media (max-width: 720px) { .about-grid { grid-template-columns: 1fr; } }
.about-photo { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 3/4; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.stat { padding: 16px; border: 1px solid var(--c-border); border-radius: var(--radius); }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -0.3px; }
.stat .l { font-size: 12px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 2px; }

/* === Project cards === */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.project-card {
    background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
    overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.project-card .image {
    aspect-ratio: 16/9; background: var(--gradient); color: #fff;
    display: flex; align-items: flex-end; padding: 20px;
    font-weight: 700; font-size: 18px;
    position: relative; overflow: hidden;
}
.project-card .image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-card .body { padding: 22px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.project-card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.project-card .meta { font-size: 12px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; }
.project-card p { margin: 0 0 16px; color: var(--c-text-muted); font-size: 14px; }
.project-card .tech { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.project-card .tech span { font-size: 11px; padding: 4px 9px; background: var(--c-bg-alt); border-radius: 999px; color: var(--c-text); }

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.pagination .page-link {
    min-width: 40px; padding: 8px 14px; border: 1px solid var(--c-border); border-radius: var(--radius);
    background: var(--c-card); color: var(--c-text); text-decoration: none; font-size: 14px; font-weight: 500;
    display: inline-flex; align-items: center; justify-content: center; transition: all .15s ease;
}
.pagination .page-link:hover:not(.disabled):not(.active) { border-color: var(--c-accent); color: var(--c-accent); }
.pagination .page-link.active { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.pagination .page-link.disabled { opacity: .4; cursor: not-allowed; }

/* === Experience timeline === */
.timeline { border-left: 2px solid var(--c-border); padding-left: 24px; }
.timeline-item { position: relative; padding-bottom: 36px; }
.timeline-item::before {
    content: ''; position: absolute; left: -31px; top: 4px;
    width: 14px; height: 14px; border-radius: 999px; background: var(--gradient);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .period { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--c-text-muted); }
.timeline-item .role { font-weight: 700; font-size: 18px; margin: 4px 0 2px; letter-spacing: -0.2px; }
.timeline-item .company { font-size: 14px; color: var(--c-text-muted); margin-bottom: 12px; }
.timeline-item ul { margin: 0; padding-left: 18px; color: var(--c-text); }
.timeline-item ul li { margin-bottom: 6px; }

/* === Certifications + skills === */
.certs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.cert {
    padding: 16px 18px; border: 1px solid var(--c-border); border-radius: var(--radius);
    background: var(--c-card); display: flex; flex-direction: column; gap: 4px;
}
.cert .n { font-weight: 600; font-size: 14px; }
.cert .i { font-size: 12px; color: var(--c-text-muted); }

.education-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.education-card {
    padding: 18px 20px; border: 1px solid var(--c-border); border-radius: var(--radius);
    background: var(--c-card); display: flex; flex-direction: column; gap: 6px;
    border-left: 4px solid var(--c-accent);
}
.education-card .year { font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--c-accent); }
.education-card .qualification { font-weight: 600; font-size: 15px; line-height: 1.35; }
.education-card .institution { font-size: 13px; color: var(--c-text-muted); }
.skill-group { margin-bottom: 20px; }
.skill-group h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; color: var(--c-text-muted); margin: 0 0 10px; font-weight: 600; }
.skill-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-pill {
    padding: 6px 12px; background: var(--c-card); border: 1px solid var(--c-border); border-radius: 999px;
    font-size: 13px; color: var(--c-text); font-weight: 500;
}

/* === Speaking === */
.speaking-photo {
    margin: 0 0 32px; max-width: 720px; border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow-md); background: var(--c-card);
}
.speaking-photo img { width: 100%; height: auto; display: block; }
.speaking-photo figcaption { padding: 12px 18px; font-size: 13px; color: var(--c-text-muted); border-top: 1px solid var(--c-border); }
.speaking-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.speaking-card { padding: 20px; border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-card); }
.speaking-card .title { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.speaking-card .venue { font-size: 13px; color: var(--c-text-muted); }

/* === Contact form === */
.contact-form { max-width: 560px; }
.contact-form label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--c-text); }
.contact-form input, .contact-form textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--c-border);
    border-radius: 12px; font-family: inherit; font-size: 15px; margin-bottom: 16px;
    background: var(--c-card); color: var(--c-text);
}
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--c-accent); border-color: transparent; }
.contact-form textarea { min-height: 120px; resize: vertical; }
.form-status { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 14px; }
.form-status.success { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.35); }
.form-status.error { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.35); }

/* === Footer === */
.site-footer {
    border-top: 1px solid var(--c-border);
    padding: 36px 0;
    font-size: 13px;
    color: var(--c-text-muted);
}
.site-footer .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer .links { display: flex; gap: 18px; }
.site-footer .links a { color: var(--c-text); font-weight: 500; }

/* === Chat widget === */
.chat-bubble {
    position: fixed; bottom: 24px; right: 24px;
    width: 64px; height: 64px; border-radius: 999px;
    background: var(--gradient); color: #fff;
    box-shadow: 0 16px 32px rgba(91,33,182,.35);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 60; border: 0;
    transition: transform .15s ease;
}
.chat-bubble:hover { transform: translateY(-2px); }
.chat-bubble svg { width: 28px; height: 28px; }

.chat-panel {
    position: fixed; bottom: 100px; right: 24px;
    width: min(400px, calc(100vw - 32px));
    height: min(600px, calc(100vh - 140px));
    background: var(--c-card); border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px rgba(0,0,0,.6);
    display: none; flex-direction: column; z-index: 60;
    overflow: hidden;
}
.chat-panel.open { display: flex; }

.chat-header {
    background: var(--gradient); color: #fff; padding: 18px 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.chat-header .title { font-weight: 700; font-size: 15px; }
.chat-header .sub { font-size: 12px; opacity: .85; }
.chat-close { background: rgba(255,255,255,.18); border: 0; color: #fff; width: 28px; height: 28px; border-radius: 999px; cursor: pointer; font-size: 14px; }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; background: var(--c-bg-alt); }
.msg { margin-bottom: 12px; display: flex; }
.msg .bubble { padding: 10px 14px; border-radius: 14px; max-width: 80%; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--gradient); color: #fff; }
.msg.assistant .bubble { background: var(--c-bg); color: var(--c-text); border: 1px solid var(--c-border); }
.msg.error .bubble { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.35); }

.chat-input-area { padding: 12px; border-top: 1px solid var(--c-border); background: var(--c-card); }

[hidden] { display: none !important; }
.chat-identity { padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--c-card); }
.chat-identity-intro { font-size: 12px; color: var(--c-text-muted); margin: 0 0 4px; line-height: 1.45; }
.chat-identity label { font-size: 11px; font-weight: 600; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 1px; }
.chat-identity input { padding: 9px 12px; border: 1px solid var(--c-border); border-radius: var(--radius); font: inherit; font-size: 14px; background: var(--c-bg); color: var(--c-text); }
.chat-identity input:focus { outline: 2px solid var(--c-accent); border-color: transparent; }
.chat-identity-submit {
    margin-top: 4px; padding: 10px 14px; border: 0; border-radius: var(--radius);
    background: var(--c-accent); color: #fff; font-weight: 600; cursor: pointer;
    font-size: 14px;
}
.chat-identity-submit:disabled { opacity: .5; cursor: not-allowed; }
.chat-identity-submit:hover:not(:disabled) { background: var(--c-accent-strong); }
.altcha-status {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; padding: 6px 10px; border-radius: 999px;
    margin-bottom: 8px; font-weight: 500; line-height: 1;
    border: 1px solid transparent;
}
.altcha-status[data-state="pending"] { background: rgba(245,158,11,.15); color: #fbbf24; border-color: rgba(245,158,11,.35); cursor: pointer; user-select: none; }
.altcha-status[data-state="pending"]:hover { background: rgba(245,158,11,.25); }
.altcha-status[data-state="error"] { cursor: pointer; }
.altcha-status[data-state="working"] { background: rgba(96,165,250,.15); color: #93c5fd; border-color: rgba(96,165,250,.35); }
.altcha-status[data-state="working"]::before {
    content: ""; width: 10px; height: 10px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: altcha-spin .8s linear infinite;
}
.altcha-status[data-state="ok"] { background: rgba(16,185,129,.15); color: #6ee7b7; border-color: rgba(16,185,129,.35); }
.altcha-status[data-state="error"] { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.35); }
@keyframes altcha-spin { to { transform: rotate(360deg); } }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row textarea {
    flex: 1; resize: none; padding: 10px 12px;
    border: 1px solid var(--c-border); border-radius: 14px;
    font-family: inherit; font-size: 14px; max-height: 100px; min-height: 40px;
    background: var(--c-bg); color: var(--c-text);
}
.chat-input-row button {
    background: var(--gradient); color: #fff; border: 0; border-radius: 14px;
    padding: 0 18px; cursor: pointer; font-weight: 600; font-size: 14px;
}
.chat-input-row button:disabled { opacity: .5; cursor: not-allowed; }
.chat-empty { padding: 24px; text-align: center; color: var(--c-text-muted); font-size: 14px; }

/* === Full-screen chat page === */
.chat-fullscreen { padding: 120px 0 60px; min-height: 100vh; background: var(--c-bg-alt); }
.chat-fullscreen .container { max-width: 720px; }
.chat-fullscreen .chat-panel-inline {
    position: static; width: 100%; height: 70vh; display: flex;
}
