/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg:          #06060f;
    --bg-alt:      #09091a;
    --bg-card:     rgba(255, 255, 255, 0.04);
    --border:      rgba(255, 255, 255, 0.08);
    --border-glow: rgba(139, 92, 246, 0.35);
    --text:        #f1f5f9;
    --text-muted:  #94a3b8;
    --text-dim:    #475569;
    --purple:      #8b5cf6;
    --cyan:        #22d3ee;
    --gradient:        linear-gradient(135deg, #8b5cf6, #22d3ee);
    --gradient-text:   linear-gradient(135deg, #a78bfa, #67e8f9);
    --shadow-glow:     0 0 40px rgba(139, 92, 246, 0.15);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius:    12px;
    --radius-lg: 18px;
    --ease:      0.3s ease;
}

html { scroll-behavior: smooth; }

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

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 3px; }

/* ===== NAVBAR ===== */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 0 2rem;
    transition: background var(--ease), border-color var(--ease);
}

#navbar.scrolled {
    background: rgba(6, 6, 15, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    font-family: var(--mono);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.08em;
}
.nav-logo .dot { color: var(--purple); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.25rem;
    list-style: none;
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-links a.nav-cta {
    color: var(--purple);
    border: 1px solid rgba(139, 92, 246, 0.4);
    padding: 0.4rem 1.1rem;
    border-radius: 8px;
    transition: all var(--ease);
}
.nav-links a.nav-cta:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: var(--purple);
    color: var(--purple);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--ease);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 2rem 5rem;
    overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; overflow: hidden; }

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.18;
    pointer-events: none;
}
.orb-1 {
    width: 700px; height: 700px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    top: -200px; right: -150px;
    animation: floatOrb 9s ease-in-out infinite;
}
.orb-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #22d3ee, transparent 70%);
    bottom: -100px; left: 5%;
    animation: floatOrb 12s ease-in-out infinite reverse;
}
@keyframes floatOrb {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-35px) scale(1.06); }
}

.grid-overlay {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 90% at 50% 0%, black, transparent);
}

.hero-content {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
}

.hero-greeting {
    font-family: var(--mono);
    color: var(--cyan);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.6rem;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.2s forwards;
}
.hero-name {
    font-size: clamp(3.5rem, 9vw, 6.5rem);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1rem;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.4s forwards;
}
.hero-title {
    font-size: clamp(1.1rem, 2.8vw, 1.7rem);
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    min-height: 2.2em;
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.6s forwards;
}
.cursor {
    color: var(--purple);
    font-weight: 300;
    animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.6s ease 0.8s forwards;
}
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeUp 0.6s ease 1s forwards;
}
.tag {
    padding: 0.28rem 0.8rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--mono);
}
.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp 0.6s ease 1.2s forwards;
}

.btn {
    padding: 0.72rem 2rem;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--ease);
    display: inline-block;
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: var(--gradient);
    color: #fff;
}
.btn-primary:hover {
    opacity: 0.88;
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(139, 92, 246, 0.45);
}
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--purple);
    color: var(--purple);
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeUp 0.6s ease 1.6s forwards;
}
.scroll-mouse {
    width: 22px; height: 36px;
    border: 2px solid rgba(255,255,255,0.18);
    border-radius: 11px;
    display: flex;
    justify-content: center;
    padding-top: 5px;
}
.scroll-dot {
    width: 4px; height: 6px;
    background: var(--purple);
    border-radius: 2px;
    animation: scrollDown 1.6s ease-in-out infinite;
}
@keyframes scrollDown {
    0%   { transform: translateY(0);   opacity: 1; }
    100% { transform: translateY(14px); opacity: 0; }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== SECTIONS ===== */
.section     { padding: 6rem 2rem; }
.section-alt { background: var(--bg-alt); }

.container { max-width: 1100px; margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 4rem; }
.section-label {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--cyan);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.65rem;
}
.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== ABOUT ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5rem;
    align-items: start;
}
.about-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.85;
}
.about-text strong { color: var(--text); }

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}
.stat {
    text-align: center;
    padding: 1.25rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--ease);
}
.stat:hover { border-color: var(--border-glow); }
.stat-num {
    display: block;
    font-family: var(--mono);
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.3rem;
}

.education-cards { display: flex; flex-direction: column; gap: 1.25rem; }
.edu-card {
    display: flex;
    gap: 1.1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--ease);
}
.edu-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}
.edu-icon { font-size: 1.8rem; flex-shrink: 0; }
.edu-info h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.2rem; }
.edu-degree { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 0.2rem; }
.edu-period {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--cyan);
    margin-bottom: 0.7rem;
}
.edu-badges { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.badge {
    padding: 0.2rem 0.6rem;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 100px;
    font-size: 0.73rem;
    color: var(--cyan);
}

/* ===== TIMELINE ===== */
.timeline { position: relative; max-width: 820px; margin: 0 auto; }
.timeline::before {
    content: '';
    position: absolute;
    left: 15px; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--purple), var(--cyan));
    opacity: 0.25;
}
.timeline-item { position: relative; padding-left: 3rem; margin-bottom: 2rem; }
.timeline-marker {
    position: absolute;
    left: 6px; top: 1.75rem;
    width: 20px; height: 20px;
    background: var(--gradient);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.55);
}
.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all var(--ease);
}
.timeline-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}
.timeline-company { font-size: 1.3rem; font-weight: 700; }
.timeline-role { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.2rem; }
.timeline-period {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--purple);
    padding: 0.3rem 0.85rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 100px;
    white-space: nowrap;
}
.timeline-items { list-style: none; margin-bottom: 1.25rem; }
.timeline-items li {
    position: relative;
    padding: 0.38rem 0 0.38rem 1.3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.75;
}
.timeline-items li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--purple);
    font-size: 1.15rem;
    line-height: 1.6;
}
.timeline-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ===== PROJECTS ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Wide cards (01 & 04) span both columns */
.project-card.wide {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 2.5rem;
    align-items: start;
}
.project-card.wide .project-main  { display: flex; flex-direction: column; gap: 0; }
.project-card.wide .project-main  .project-tags { margin-top: auto; padding-top: 1.25rem; }
.project-card.wide .project-detail { display: flex; flex-direction: column; gap: 0; }

/* Agent card — cyan accent */
.project-card.agent-card {
    border-color: rgba(34, 211, 238, 0.25);
    background: rgba(34, 211, 238, 0.025);
}
.project-card.agent-card::before {
    background: linear-gradient(90deg, var(--cyan), #818cf8);
    opacity: 1;
}
.project-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all var(--ease);
    overflow: hidden;
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity var(--ease);
}
.project-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-5px);
}
.project-card:hover::before { opacity: 1; }

.project-card.featured {
    border-color: rgba(139, 92, 246, 0.28);
    background: rgba(139, 92, 246, 0.04);
}
.project-card.featured::before { opacity: 1; }

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.project-icon { font-size: 1.8rem; }
.project-num {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--text-dim);
}
.project-title {
    font-size: 1.03rem;
    font-weight: 600;
    margin-bottom: 0.7rem;
    line-height: 1.45;
}
.project-desc {
    color: var(--text-muted);
    font-size: 0.855rem;
    margin-bottom: 1rem;
    line-height: 1.75;
}
.project-highlights { list-style: none; margin-bottom: 1.25rem; }
.project-highlights li {
    position: relative;
    padding: 0.33rem 0 0.33rem 1.3rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.65;
}
.project-highlights li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--cyan);
    font-size: 0.82rem;
    top: 0.38rem;
}
.project-highlights strong { color: var(--text); }

.project-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: rgba(0,0,0,0.22);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.metric { text-align: center; }
.metric-val {
    display: block;
    font-family: var(--mono);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--cyan);
}
.metric-label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
    line-height: 1.4;
}
.project-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ===== TECH TAGS ===== */
.tech-tag {
    padding: 0.22rem 0.65rem;
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.74rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* ===== SKILLS ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}
.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: border-color var(--ease);
}
.skill-category:hover { border-color: var(--border-glow); }
.skill-cat-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.skill-icon { font-size: 1.1rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tag {
    padding: 0.32rem 0.78rem;
    border-radius: 7px;
    font-size: 0.79rem;
    font-family: var(--mono);
    border: 1px solid;
    transition: all var(--ease);
    cursor: default;
}
.skill-tag.level-expert {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.28);
    color: #b4a0ff;
}
.skill-tag.level-mid {
    background: rgba(34, 211, 238, 0.07);
    border-color: rgba(34, 211, 238, 0.2);
    color: #7dd3fc;
}
.skill-tag:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(139, 92, 246, 0.22); }

/* ===== CONTACT ===== */
.contact-content { max-width: 580px; margin: 0 auto; text-align: center; }
.contact-desc { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 2.5rem; }
.contact-links {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}
.contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text);
    transition: all var(--ease);
    min-width: 230px;
}
.contact-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}
.contact-icon { font-size: 1.6rem; flex-shrink: 0; }
.contact-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--mono);
    margin-bottom: 0.2rem;
}
.contact-value {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--cyan);
}

/* ===== AGENT SECTION ===== */
.agent-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    max-width: 900px;
    margin: 0 auto;
}
.agent-intro-card {
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all var(--ease);
}
.agent-intro-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gradient);
}
.agent-intro-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}
.agent-card-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}
.agent-badge {
    font-family: var(--mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.65rem;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 100px;
    color: var(--cyan);
    letter-spacing: 0.08em;
}
.agent-avatar {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}
.agent-intro-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.agent-intro-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}
.agent-intro-card strong { color: var(--text); }
.agent-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.agent-tech {
    padding: 0.25rem 0.7rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 100px;
    font-size: 0.74rem;
    color: #b4a0ff;
    font-family: var(--mono);
}
.agent-open-btn { width: 100%; }

.agent-examples {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
}
.examples-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--mono);
    margin-bottom: 0.25rem;
}
.example-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.example-q {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: all var(--ease);
    font-family: var(--font);
    line-height: 1.4;
}
.example-q:hover {
    border-color: var(--border-glow);
    color: var(--text);
    transform: translateX(4px);
    background: rgba(139, 92, 246, 0.05);
}

/* ===== DIGEST WIDGET ===== */
.digest-section {
    margin-top: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
}
.digest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.digest-title { font-size: 1rem; font-weight: 600; }
.digest-hint {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-dim);
}
.digest-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.digest-col-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.digest-col-icon { font-size: 1rem; }
.digest-items { display: flex; flex-direction: column; gap: 0.6rem; }

.digest-loading {
    display: flex;
    gap: 5px;
    padding: 1rem 0;
}
.digest-loading span {
    width: 6px; height: 6px;
    background: var(--purple);
    border-radius: 50%;
    animation: dot 1.2s ease-in-out infinite;
}
.digest-loading span:nth-child(2) { animation-delay: 0.2s; }
.digest-loading span:nth-child(3) { animation-delay: 0.4s; }

.digest-item {
    display: block;
    padding: 0.7rem 0.85rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all var(--ease);
}
.digest-item:hover {
    border-color: var(--border-glow);
    background: rgba(139, 92, 246, 0.05);
    transform: translateY(-1px);
}
.digest-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
    gap: 0.5rem;
}
.digest-repo {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--cyan);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.digest-stars {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: #fbbf24;
    flex-shrink: 0;
}
.digest-date {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-dim);
}
.digest-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0.2rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.digest-paper-title {
    font-size: 0.8rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.digest-lang {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 4px;
    color: var(--cyan);
    margin-top: 0.25rem;
    font-family: var(--mono);
}
.digest-empty { font-size: 0.82rem; color: var(--text-dim); padding: 0.5rem 0; }

@media (max-width: 640px) {
    .digest-grid { grid-template-columns: 1fr; }
}

/* streaming cursor */
.stream-cursor {
    display: inline-block;
    color: var(--purple);
    animation: blink 0.8s step-end infinite;
    font-size: 0.9em;
    margin-left: 1px;
}

/* tool indicator */
.tool-indicator {
    align-self: flex-start;
    font-size: 0.78rem;
    color: var(--cyan);
    font-family: var(--mono);
    padding: 0.35rem 0.75rem;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 100px;
    animation: fadeUp 0.2s ease;
}

/* ===== CHAT WIDGET ===== */
.chat-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 200;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
    transition: all var(--ease);
    color: #fff;
}
.chat-fab:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(139, 92, 246, 0.65); }
.chat-fab .fab-icon-close { display: none; }
.chat-fab.open .fab-icon-open  { display: none; }
.chat-fab.open .fab-icon-close { display: block; }

.chat-panel {
    position: fixed;
    bottom: 5.5rem;
    right: 2rem;
    z-index: 199;
    width: 360px;
    max-height: 520px;
    display: flex;
    flex-direction: column;
    background: #0e0e20;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(139, 92, 246, 0.1);
    overflow: hidden;
    transform: translateY(12px) scale(0.97);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.chat-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(139, 92, 246, 0.08);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 0.75rem; }
.chat-avatar-sm { font-size: 1.5rem; }
.chat-name { font-size: 0.9rem; font-weight: 600; }
.chat-status {
    font-size: 0.72rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.1rem;
}
.status-dot {
    display: inline-block;
    width: 6px; height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.chat-close-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color var(--ease);
}
.chat-close-btn:hover { color: var(--text); }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: 2px; }

.chat-msg {
    max-width: 88%;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    font-size: 0.855rem;
    line-height: 1.6;
    animation: msgIn 0.2s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.chat-msg.assistant {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.18);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.chat-msg.assistant p { margin-bottom: 0.3rem; }
.chat-msg.assistant p:last-child { margin-bottom: 0; }
.chat-msg.assistant p.reply-h {
    font-weight: 600;
    color: var(--text);
    margin-top: 0.55rem;
    margin-bottom: 0.15rem;
}
.chat-msg.assistant ul,
.chat-msg.assistant ol {
    padding-left: 1.15rem;
    margin: 0.25rem 0 0.35rem;
}
.chat-msg.assistant li {
    margin-bottom: 0.22rem;
    line-height: 1.6;
    color: var(--text-muted);
}
.chat-msg.assistant li:last-child { margin-bottom: 0; }
.chat-msg.assistant strong { color: var(--text); font-weight: 600; }
.chat-msg.assistant em { color: #c4b5fd; font-style: normal; }
.chat-msg.assistant code {
    font-family: var(--mono);
    font-size: 0.8em;
    background: rgba(255,255,255,0.08);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    color: var(--cyan);
}
.chat-msg.user {
    background: var(--gradient);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.chat-msg.loading {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.18);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.typing-dots { display: flex; gap: 4px; align-items: center; padding: 2px 0; }
.typing-dots span {
    width: 6px; height: 6px;
    background: var(--purple);
    border-radius: 50%;
    animation: dot 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot { 0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

.chat-footer {
    padding: 0.75rem 1.25rem 0.9rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.chat-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    color: var(--text);
    font-size: 0.855rem;
    font-family: var(--font);
    outline: none;
    transition: border-color var(--ease);
}
.chat-input:focus { border-color: rgba(139, 92, 246, 0.5); }
.chat-input::placeholder { color: var(--text-dim); }
.chat-send-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    transition: opacity var(--ease);
}
.chat-send-btn:hover { opacity: 0.85; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-hint {
    font-size: 0.68rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: 0.5rem;
    font-family: var(--mono);
}

/* ===== FOOTER ===== */
.footer {
    padding: 2rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.82rem;
}

/* ===== REVEAL ANIMATION ===== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    /* Wide cards collapse to single-column internal layout */
    .project-card.wide {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .project-card.wide .project-main .project-tags { padding-top: 1rem; }
}

@media (max-width: 800px) {
    .about-grid    { grid-template-columns: 1fr; }
    .skills-grid   { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-card.wide { grid-template-columns: 1fr; }
    .agent-layout  { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .chat-panel { width: calc(100vw - 2rem); right: 1rem; bottom: 5rem; }
    .chat-fab   { right: 1rem; bottom: 1rem; }
}

@media (max-width: 640px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px; left: 0; right: 0;
        background: rgba(6, 6, 15, 0.96);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 1.25rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.open { display: flex; }
    .nav-toggle     { display: flex; }

    .hero     { padding: 7rem 1.5rem 4rem; }
    .section  { padding: 4.5rem 1.5rem; }
    #navbar   { padding: 0 1.5rem; }

    .about-stats     { grid-template-columns: 1fr 1fr 1fr; }
    .timeline-header { flex-direction: column; }
    .contact-card    { min-width: unset; width: 100%; }
    .project-metrics { grid-template-columns: repeat(3, 1fr); }
}
