/* ============================================
   Custom Properties
   ============================================ */
:root {
    --bg:           #ffffff;
    --bg-alt:       #f8fafc;
    --border:       #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted:   #94a3b8;
    --accent:       #0891b2;
    --accent-dark:  #0e7490;
    --accent-light: #e0f7fa;
    --accent-border:#a5f3fc;
    --accent-text:  #164e63;
    --shadow-sm:    0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-md:    0 4px 16px rgba(15,23,42,0.09);
    --radius:       10px;
    --radius-lg:    16px;
    --nav-height:   68px;
    --container:    1080px;
    --section-pad:  5rem;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.section { padding: var(--section-pad) 0; }
.section-alt { background: var(--bg-alt); }

.section-header { margin-bottom: 3rem; }
.section-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.section-line {
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin-top: 0.75rem;
}
.section-subtitle {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 540px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-secondary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-secondary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

/* ============================================
   Navigation
   ============================================ */
#header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
}
#header.scrolled {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
}
.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    transition: color 0.2s;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.nav-links a {
    padding: 0.45rem 0.875rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s, background 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
    background: var(--accent-light);
}
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.25s;
}

/* ============================================
   Hero
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
    background: radial-gradient(ellipse at 70% 25%, #cffafe 0%, #ffffff 58%);
}
.hero-content { max-width: 680px; }
.hero-eyebrow {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
.hero-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(3.25rem, 9vw, 5.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 1.25rem;
}
.hero-tagline {
    font-size: clamp(1rem, 2.5vw, 1.175rem);
    color: var(--text-secondary);
    line-height: 1.75;
    max-width: 520px;
    margin-bottom: 2.5rem;
}
.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================
   About
   ============================================ */
.about-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 4rem;
    align-items: start;
}
.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 1.025rem;
    line-height: 1.8;
}
.about-text p:last-child { margin-bottom: 0; }
.about-lead {
    font-size: 1.125rem !important;
    color: var(--text-primary) !important;
    font-weight: 500;
}
.about-text strong {
    color: var(--accent-dark);
    font-weight: 600;
}
.about-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}
.highlight-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.125rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    box-shadow: var(--shadow-sm);
}
.highlight-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
}
.highlight-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

/* ============================================
   Skills
   ============================================ */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
}
.skills-category {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}
.skills-category-accent {
    border-color: var(--accent-border);
    background: linear-gradient(140deg, #f0fdff 0%, #ffffff 100%);
}
.skills-category-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.skills-icon { font-size: 1rem; }
.skills-category-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.4rem;
}
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.skill-tag {
    padding: 0.3rem 0.8rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.skill-tag-accent {
    background: var(--accent-light);
    border-color: var(--accent-border);
    color: var(--accent-text);
}

/* ============================================
   Projects
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.project-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}
.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.project-card-dim { opacity: 0.55; }
.project-card-dim:hover { opacity: 0.8; }

.project-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.project-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    width: fit-content;
}
.project-badge-live {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.project-badge-soon {
    background: var(--bg-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.project-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
}
.project-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
}
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.project-tag {
    padding: 0.2rem 0.55rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.73rem;
    font-weight: 500;
    color: var(--text-muted);
}
.project-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    transition: color 0.2s;
    margin-top: auto;
}
.project-link:hover { color: var(--accent-dark); }

/* ============================================
   Chat
   ============================================ */
.chat-interface {
    max-width: 680px;
    margin: 0 auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.message {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    max-width: 88%;
}
.message.bot { align-self: flex-start; }
.message.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.message-bubble {
    padding: 0.7rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.65;
}
.message.bot .message-bubble {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}
.message.user .message-bubble {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0 1.5rem 1rem;
}
.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    padding: 0.7rem 1rem;
}
.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: bounce 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40%           { transform: translateY(-6px); }
}

/* Input area */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.chat-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-alt);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.chat-input:focus {
    border-color: var(--accent);
    background: var(--bg);
}
.chat-input::placeholder { color: var(--text-muted); }
.chat-input:disabled { opacity: 0.6; cursor: not-allowed; }

.chat-send {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
}
.chat-send:hover { background: var(--accent-dark); transform: scale(1.06); }
.chat-send:disabled { background: var(--border); cursor: not-allowed; transform: none; }

/* ============================================
   Contact
   ============================================ */
.contact-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.contact-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.75rem 2.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    min-width: 130px;
}
.contact-link i { font-size: 1.5rem; color: var(--accent); }
.contact-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--text-primary);
    color: var(--text-muted);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.85rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .about-highlights { grid-template-columns: repeat(2, 1fr); }
    .projects-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
    :root { --section-pad: 3.5rem; }

    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0; right: 0;
        background: var(--bg);
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 1.5rem 1.5rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .nav-links.open { display: flex; }
    .nav-links a { width: 100%; padding: 0.6rem 0.5rem; }

    .hero-cta { flex-direction: column; align-items: flex-start; }

    .skills-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }

    .chat-messages { height: 320px; }

    .contact-links { gap: 1rem; }
    .contact-link { padding: 1.25rem 1.75rem; min-width: 110px; }
}
