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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

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

/* Sticky Nav */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color);
    background: #eff6ff;
}

.nav-ask-ai {
    background: var(--primary-color);
    color: white;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.nav-ask-ai:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Header */
header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 60px 0 80px;
    text-align: center;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Main Content */
main {
    margin-top: -40px;
    padding-bottom: 60px;
}

section {
    background: var(--bg-white);
    padding: 40px;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

section h2 {
    font-size: 1.875rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

.profile-photo {
    float: right;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 2rem;
    margin-bottom: 1rem;
    border: 3px solid var(--border);
    box-shadow: 0 0 0 8px white;
}

.intro::after {
    content: '';
    display: table;
    clear: both;
}


.intro p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.8;
}

/* Experience Accordion */
.experience-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exp-item {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.exp-item:hover {
    border-color: var(--primary-color);
}

.exp-item.open {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.exp-header {
    width: 100%;
    background: none;
    border: none;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    gap: 16px;
    transition: background 0.2s ease;
}

.exp-header:hover {
    background: var(--bg-light);
}

.exp-item.open .exp-header {
    background: var(--bg-light);
}

.exp-summary {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
}

.exp-summary h3 {
    font-size: 1.375rem;
    color: var(--primary-color);
    margin: 0;
    white-space: nowrap;
}

.exp-summary .role {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.exp-summary .duration {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
    margin-left: auto;
}

.exp-toggle-icon {
    color: var(--primary-color);
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
    display: inline-block;
}

.exp-item.open .exp-toggle-icon {
    transform: rotate(90deg);
}

.exp-detail {
    padding: 0 24px 24px;
    border-top: 1px solid var(--border-color);
}

.exp-detail > p {
    color: var(--text-secondary);
    margin: 16px 0 20px;
    line-height: 1.7;
}

.exp-highlights h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 18px 0 8px;
}

.exp-highlights h4:first-child {
    margin-top: 0;
}

.exp-highlights ul {
    padding-left: 20px;
    margin: 0;
}

.exp-highlights li {
    color: var(--text-primary);
    margin-bottom: 5px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.exp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
}

.tag {
    background: #eff6ff;
    color: var(--primary-color);
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Proficiency boxes */
.proficiency-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.proficiency-box {
    border-radius: 10px;
    padding: 22px;
    border: 2px solid transparent;
}

.proficiency-box h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 14px;
}

.proficiency-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.proficiency-box li {
    font-size: 0.925rem;
    line-height: 1.5;
    margin-bottom: 8px;
    padding-left: 18px;
    position: relative;
}

.proficiency-box li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.proficiency-strong {
    background: #f0fdf4;
    border-color: #86efac;
}

.proficiency-strong h3 {
    color: #16a34a;
}

.proficiency-strong li {
    color: #166534;
}

.proficiency-strong li::before {
    background: #22c55e;
}

.proficiency-moderate {
    background: #fffbeb;
    border-color: #fcd34d;
}

.proficiency-moderate h3 {
    color: #d97706;
}

.proficiency-moderate li {
    color: #92400e;
}

.proficiency-moderate li::before {
    background: #f59e0b;
}

.proficiency-gaps {
    background: #fef2f2;
    border-color: #fca5a5;
}

.proficiency-gaps h3 {
    color: #dc2626;
}

.proficiency-gaps li {
    color: #7f1d1d;
}

.proficiency-gaps li::before {
    background: #ef4444;
}

/* Fit Check — interactive */
.fit-check .fit-intro {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1rem;
}

.fit-input-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#jd-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease;
    color: var(--text-primary);
    background: var(--bg-light);
}

#jd-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
}

.fit-check-submit {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.fit-check-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.fit-check-submit:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.fit-result {
    margin-top: 28px;
    border-top: 2px solid var(--border-color);
    padding-top: 24px;
}

.fit-result-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Fit result blocks rendered by JS */
.fit-block {
    border-radius: 10px;
    padding: 20px 22px;
    border: 2px solid transparent;
}

.fit-block h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.fit-block ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fit-block li {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.fit-block li::before {
    position: absolute;
    left: 0;
    top: 1px;
}

.fit-block--green {
    background: #f0fdf4;
    border-color: #86efac;
}
.fit-block--green h4 { color: #16a34a; }
.fit-block--green li { color: #166534; }
.fit-block--green li::before { content: '✓'; color: #22c55e; }

.fit-block--amber {
    background: #fffbeb;
    border-color: #fcd34d;
}
.fit-block--amber h4 { color: #d97706; }
.fit-block--amber li { color: #78350f; }
.fit-block--amber li::before { content: '~'; color: #f59e0b; font-weight: 700; }

.fit-block--red {
    background: #fef2f2;
    border-color: #fca5a5;
}
.fit-block--red h4 { color: #dc2626; }
.fit-block--red li { color: #7f1d1d; }
.fit-block--red li::before { content: '✕'; color: #ef4444; }

.fit-block--neutral {
    background: var(--bg-light);
    border-color: var(--border-color);
    grid-column: 1 / -1;
}
.fit-block--neutral h4 { color: var(--text-secondary); }
.fit-block--neutral p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0;
}

.fit-verdict {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
}

.fit-verdict--strong { background: #f0fdf4; color: #16a34a; border: 2px solid #86efac; }
.fit-verdict--moderate { background: #fffbeb; color: #d97706; border: 2px solid #fcd34d; }
.fit-verdict--weak { background: #fef2f2; color: #dc2626; border: 2px solid #fca5a5; }

.fit-verdict-icon { font-size: 1.4rem; }

/* Footer */
footer {
    background: var(--text-primary);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
}

footer p {
    opacity: 0.9;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-content .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 4px 8px;
}

.modal-content .close-btn:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.75rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.privacy-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 6px;
    margin-bottom: 25px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-button {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    background: var(--primary-hover);
}

/* Chat Interface */
#chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 420px;
    height: 580px;
    min-width: 300px;
    min-height: 400px;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 999;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#chat-container.chat-hidden {
    display: none;
}

.chat-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    cursor: se-resize;
    z-index: 1;
    border-bottom-right-radius: 16px;
    background: linear-gradient(135deg, transparent 40%, var(--border-color) 40%, var(--border-color) 55%, transparent 55%, transparent 70%, var(--border-color) 70%);
}

.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: grab;
    user-select: none;
}

.chat-header:active {
    cursor: grabbing;
}

.chat-title h3 {
    font-size: 1.125rem;
    margin-bottom: 4px;
}

.chat-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-light);
}

.message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
    max-width: 85%;
    line-height: 1.6;
}

.user-message {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.assistant-message {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.assistant-message p {
    margin-bottom: 10px;
}

.assistant-message p:last-child {
    margin-bottom: 0;
}

.assistant-message ul,
.assistant-message ol {
    margin: 6px 0 10px 20px;
}

.assistant-message li {
    margin-bottom: 4px;
}

.assistant-message strong {
    font-weight: 600;
}

.assistant-message code {
    background: var(--bg-light);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875em;
}

.assistant-message pre {
    background: var(--bg-light);
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.assistant-message pre code {
    background: none;
    padding: 0;
    font-size: 0.85em;
}

.assistant-message h1,
.assistant-message h2,
.assistant-message h3 {
    margin: 10px 0 6px;
    font-weight: 600;
}

.assistant-message blockquote {
    border-left: 3px solid var(--border-color);
    padding-left: 10px;
    margin: 8px 0;
    color: var(--text-secondary);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 15px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}

.chat-input-container {
    padding: 20px;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    transition: border-color 0.3s ease;
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.send-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.send-button:hover {
    background: var(--primary-hover);
}

.send-button:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

/* Muted experience item (career break) */
.exp-item--muted .exp-summary h3 {
    color: var(--text-secondary);
}

.exp-item--muted .exp-header {
    opacity: 0.75;
}

/* Footer link */
footer a {
    color: #93c5fd;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-brand {
        font-size: 0.85rem;
    }

    .nav-link {
        padding: 6px 8px;
        font-size: 0.82rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    section {
        padding: 25px;
    }

    .proficiency-grid {
        grid-template-columns: 1fr;
    }

    .fit-result-inner {
        grid-template-columns: 1fr;
    }

    #chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chat-header {
        border-radius: 0;
    }

    .exp-summary {
        gap: 8px;
    }

    .exp-summary .duration {
        margin-left: 0;
    }
}
