/* ============================================================
   CV PORTFOLIO — Main Stylesheet
   ============================================================ */

/* ── FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&family=DM+Mono:wght@300;400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@300;400&display=swap');

/* ── TOKENS ── */
:root {
    --bg: #f0ede8;
    --bg-page: #e8e4de;
    --card: #faf8f5;
    --border: #ddd9d2;
    --border-2: #ccc8c0;
    --accent: #7a5c2e;
    --accent-light: #f0e8d8;
    --text: #1c1a17;
    --text-2: #4a4640;
    --text-3: #8a8278;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --font-sans: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}
:root {
    --bg: #ecede8;
    --bg-page: #e3e5de;
    --card: #f7f8f4;
    --border: #d4d8ce;
    --border-2: #bcc1b5;
    --accent: #4a6741;
    --accent-light: #deeadb;
    --text: #171a15;
    --text-2: #3f4a3c;
    --text-3: #7a8876;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --font-sans: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}
:root {
    --bg: #eaebec;
    --bg-page: #e1e3e5;
    --card: #f5f6f7;
    --border: #d0d4d8;
    --border-2: #b8bdc4;
    --accent: #3a5068;
    --accent-light: #d8e4ee;
    --text: #141618;
    --text-2: #3a4048;
    --text-3: #7a8290;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --font-sans: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}
:root {
    --bg: #f2ede4;
    --bg-page: #ece6db;
    --card: #fdfaf4;
    --border: #ddd6c8;
    --border-2: #c8bfae;
    --accent: #3d4a7a;
    --accent-light: #dce0f0;
    --text: #1a1810;
    --text-2: #48433a;
    --text-3: #8a8270;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --font-sans: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}
/* ── RESET ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── BASE ── */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg-page);
    color: var(--text);
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 3px;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* ── SCROLL OFFSET (fixed topbar) ── */
section[id],
div[id] {
    scroll-margin-top: 68px;
}

/* ── TOPBAR ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(240, 237, 232, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-name {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--text);
}

.topbar-nav {
    display: flex;
    gap: 0;
    list-style: none;
}

.topbar-nav a {
    display: block;
    padding: 0.3rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.01em;
}

.topbar-nav a:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* ── PAGE LAYOUT ── */
.page-layout {
    padding: 2rem 0 4rem;
}

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* ── SIDEBAR ── */
.sidebar {
    position: static;
}

/* ── CARD ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* ── PROFILE ── */
.profile-photo-wrap {
    display: flex;
    justify-content: center;
    margin: 0 auto 1rem;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--card);
    box-shadow: 0 0 0 2px var(--border), var(--shadow-md);
}

.profile-photo {
    width: 130%;
    height: 130%;
    border-radius: 0;
    object-fit: cover;
    object-position: center top;
    border: none;
    box-shadow: none;
}

.profile-photo-placeholder {
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.profile-photo-placeholder svg {
    width: 44px;
    height: 44px;
}

.profile-name {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 0.3rem;
}

.profile-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 0.4rem;
    text-align: left;
}

.profile-tagline {
    font-size: 0.75rem;
    color: var(--text-3);
    line-height: 1.5;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.profile-divider {
    height: 1px;
    background: var(--border);
    margin: 1.25rem 0;
}

/* ── CONTACT LIST (sidebar) ── */
.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-align: left;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-2);
    font-size: 0.8rem;
    transition: background 0.15s, color 0.15s;
}

.contact-row:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.contact-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.contact-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── SKILLS ── */
.skill-group {
    margin-bottom: 1.25rem;
}

.skill-group:last-child {
    margin-bottom: 0;
}

.skill-group-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.skill-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}

.skill-badge {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-2);
    background: var(--card);
    border: 1px solid var(--border);
    padding: 0.2rem 0.65rem;
    border-radius: 4px;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.skill-badge::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.skill-badge:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.skill-badge:hover::before {
    opacity: 1;
}

/* ── BIO ── */
.bio-text {
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.85;
}

/* ── TIMELINE ── */
.timeline {
    display: flex;
    flex-direction: column;
}

.timeline-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 0 1rem;
    position: relative;
}

.timeline-item:last-child .timeline-line {
    display: none;
}

.timeline-logo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.org-logo-wrap {
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
}

.timeline-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    display: block;
}

.timeline-line {
    flex: 1;
    width: 1px;
    background: var(--border);
    margin: 6px 0 0;
    min-height: 1.5rem;
}

.timeline-body {
    padding-bottom: 2rem;
}

.timeline-item:last-child .timeline-body {
    padding-bottom: 0;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.timeline-role {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.timeline-org {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 500;
    margin-top: 0.1rem;
}

.timeline-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    flex-shrink: 0;
}

.timeline-period {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-3);
    white-space: nowrap;
    margin-top: 0.2rem;
}

.timeline-location {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-3);
    white-space: nowrap;
}

.timeline-desc-wrap {
    position: relative;
    margin-bottom: 0.75rem;
}

.timeline-desc {
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s ease;
}

.timeline-desc.expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.read-more-btn {
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent);
    cursor: pointer;
    padding: 0.25rem 0;
    letter-spacing: 0.05em;
    transition: opacity 0.15s;
}

.read-more-btn:hover {
    opacity: 0.7;
}

/* ── TECH TAGS ── */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-3);
    background: var(--bg-page);
    border: 1px solid var(--border);
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

/* ── PROJECTS ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

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

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(122, 92, 46, 0.1);
}

.project-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.project-desc {
    font-size: 0.82rem;
    color: var(--text-2);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
}

.project-link {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-3);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    letter-spacing: 0.05em;
    transition: color 0.15s;
}

.project-link:hover {
    color: var(--accent);
}

.project-link svg {
    width: 11px;
    height: 11px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

/* ── PUBLICATIONS ── */
.pub-list {
    display: flex;
    flex-direction: column;
}

.pub-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 0 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.pub-item:first-child {
    padding-top: 0;
}

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

.pub-year {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-3);
    padding-top: 0.15rem;
}

.pub-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pub-title {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.15s;
}

a.pub-title:hover {
    color: var(--accent);
    text-decoration: underline;
}

.pub-journal {
    font-size: 0.75rem;
    color: var(--accent);
    font-style: italic;
}

/* ── PAGINATION ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.page-btn {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-2);
    background: none;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.page-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.page-info {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-3);
}

/* ── CONTACT FORM ── */
.contact-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.contact-info-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-info-icon svg {
    width: 14px;
    height: 14px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.8;
}

.contact-info-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-3);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
}

.contact-info-value {
    display: block;
    font-size: 0.8rem;
    color: var(--text-2);
    text-decoration: none;
    transition: color 0.15s;
    word-break: break-all;
}

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

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.contact-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text);
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: none;
}

.contact-input::placeholder {
    color: var(--text-3);
}

.contact-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.contact-textarea {
    min-height: 130px;
}

.contact-field-error {
    font-size: 0.72rem;
    color: #c0392b;
    font-family: var(--font-mono);
}

.contact-submit {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.contact-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.contact-btn:active {
    transform: translateY(0);
}

.contact-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.contact-alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}

.contact-alert--success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.contact-alert--error {
    background: #fdecea;
    color: #c62828;
    border: 1px solid #f5c6cb;
}

.contact-alert--warning {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffe082;
}

/* ── FOOTER ── */
.footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-name {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    color: var(--text-2);
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--text-3);
}

/* ── REVEAL ── */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
    .page-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .topbar-nav {
        display: none;
    }

    .timeline-header {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 700px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .contact-form-row {
        grid-template-columns: 1fr;
    }

    .contact-submit {
        justify-content: stretch;
    }

    .contact-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 500px) {
    .page-container {
        padding: 0 1rem;
    }

    .card {
        padding: 1.25rem;
    }
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.lang-btn {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-3);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.08em;
    transition: all 0.15s;
    flex-shrink: 0;
}

.lang-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}
@media (max-width: 860px) {
    .timeline-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .timeline-meta {
        align-items: flex-start;
    }
}
