/* ==========================================
   Clean, polished portfolio
   Light, readable, professional
========================================= */
:root {
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-hover: 0 10px 40px rgba(0,0,0,0.08);
    --font: "Plus Jakarta Sans", -apple-system, sans-serif;
    --radius: 12px;
    --max: 720px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 1rem;
}

/* ---- Header ---- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--accent);
    text-decoration: none;
}

.header-nav {
    display: flex;
    gap: 1.75rem;
}

.header-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.header-nav a:hover { color: var(--accent); }

.header-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.header-menu span {
    width: 22px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 1px;
    transition: 0.3s;
}

.header-menu.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.header-menu.open span:nth-child(2) { opacity: 0; }
.header-menu.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
    .header-menu { display: flex; }
    .header-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 240px;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        padding: 4rem 1.5rem 2rem;
        gap: 1rem;
        box-shadow: -4px 0 20px rgba(0,0,0,0.06);
        transform: translateX(100%);
        transition: transform 0.3s;
    }
    .header-nav.open { transform: translateX(0); }
    .header-nav a { color: var(--text); font-size: 1rem; }
}

/* ---- Hero ---- */
.hero {
    padding: 7rem 1.5rem 4rem;
    text-align: center;
    max-width: var(--max);
    margin: 0 auto;
}

.hero-photo {
    margin-bottom: 1.5rem;
}

.hero-photo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 3px solid var(--border);
    box-shadow: var(--shadow);
}

.hero-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.hero-role {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.hero-bio {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 1.5rem;
    line-height: 1.65;
}

.hero-links {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-links a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.hero-links a:hover { color: var(--accent-hover); }

/* ---- Sections ---- */
.section {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3.5rem 1.5rem;
}

.section-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.prose p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.prose strong { color: var(--text); }

/* ---- Skills ---- */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.skills-list span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.2s, color 0.2s;
}

.skills-list span:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---- Projects ---- */
.project-grid {
    display: grid;
    gap: 1.25rem;
}

.project-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: box-shadow 0.25s, border-color 0.25s;
}

.project-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(14, 165, 233, 0.2);
}

.project-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.project-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.project-tags {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

/* ---- Education ---- */
.edu-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.edu-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.edu-item:last-child { border-bottom: none; padding-bottom: 0; }

.edu-year {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}

.edu-detail h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.edu-detail p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.edu-note {
    font-size: 0.9rem;
    margin-top: 0.25rem;
    color: var(--text-muted);
    opacity: 0.9;
}

@media (max-width: 600px) {
    .edu-item { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ---- Contact ---- */
.contact-section {
    text-align: center;
    padding: 4rem 1.5rem;
}

.contact-intro {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.btn-main {
    display: inline-block;
    padding: 0.9rem 1.75rem;
    background: var(--accent);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    transition: background 0.2s, transform 0.2s;
}

.btn-main:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
}

.contact-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.contact-links a:hover { color: var(--accent); }

/* ---- Footer ---- */
.footer {
    padding: 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer img { border-radius: 4px; }

/* ---- Chat ---- */
.chat-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 99;
    padding: 0.75rem 1.25rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 999px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
    transition: background 0.2s, transform 0.2s;
}

.chat-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.03);
}

.chat-panel {
    position: fixed;
    bottom: 4.5rem;
    right: 1.5rem;
    width: 340px;
    max-height: 420px;
    z-index: 98;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
}

.chat-panel[hidden] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
}

.chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--text);
}

.chat-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}

.chat-close:hover { color: var(--text); }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 120px;
    max-height: 240px;
}

.chat-msg {
    max-width: 88%;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.chat-msg.bot {
    background: var(--bg);
    color: var(--text-muted);
}

.chat-msg.user {
    margin-left: auto;
    background: var(--accent);
    color: white;
}

.chat-msg p { margin: 0; }
.chat-msg.bot p { white-space: pre-wrap; }

.chat-input-wrap {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
}

.chat-input-wrap input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
}

.chat-input-wrap input:focus { border-color: var(--accent); }

.chat-input-wrap button {
    padding: 0.6rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.chat-input-wrap button:hover { background: var(--accent-hover); }

@media (max-width: 480px) {
    .chat-panel { left: 1rem; right: 1rem; width: auto; }
}
