/* ── Design System: Academic Distinction ─────────── */
:root {
    --primary: #b01851;
    --primary-container: #d23669;
    --primary-fixed: #ffd9df;
    --primary-fixed-dim: #ffb1c1;
    --on-primary: #ffffff;
    --on-primary-fixed: #3f0017;

    --secondary: #586062;
    --secondary-container: #dae1e3;
    --on-surface: #191c1d;
    --on-surface-variant: #584045;

    --background: #f8f9fa;
    --surface: #f8f9fa;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f3f4f5;
    --surface-container: #edeeef;
    --surface-container-high: #e7e8e9;
    --surface-container-highest: #e1e3e4;

    --outline: #8c7075;
    --outline-variant: #e0bec3;
    --inverse-surface: #2e3132;
    --inverse-on-surface: #f0f1f2;

    --shadow-low: 0px 2px 4px rgba(45, 52, 70, 0.04);
    --shadow-high: 0px 12px 24px rgba(45, 52, 70, 0.08);
    --shadow-hover: 0px 20px 40px rgba(176, 24, 81, 0.06);

    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    --container-max: 1120px;
    --gutter: 24px;
    --margin-desktop: 64px;
    --margin-mobile: 20px;
    --stack-sm: 12px;
    --stack-md: 24px;
    --stack-lg: 48px;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --font-heading: 'Source Serif 4', Georgia, serif;
    --font-body: 'Hanken Grotesk', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 24px;
    background: var(--background);
    color: var(--on-surface);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

::selection {
    background: rgba(210, 54, 105, 0.2);
    color: var(--primary);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* ── Header / Top Nav ────────────────────────────── */
#site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(225, 227, 228, 0.5);
    transition: var(--transition);
}

#top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--margin-mobile);
    height: 72px;
}

@media (min-width: 769px) {
    #top-nav { padding: 0 var(--margin-desktop); }
}

.nav-brand {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--on-surface);
    letter-spacing: -0.01em;
    cursor: pointer;
}

.nav-brand .brand-accent {
    color: var(--primary);
}

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

.nav-links a {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    padding: 4px 0;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
}

#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--on-surface);
    cursor: pointer;
    padding: 8px;
    font-size: 0;
}

/* ── Mobile Overlay ──────────────────────────────── */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 49;
}

.mobile-overlay.active { display: block; }

/* ── Main Content ────────────────────────────────── */
main {
    flex: 1;
    width: 100%;
}

.page-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--stack-lg) var(--margin-mobile);
    animation: fadeIn 0.4s ease;
}

@media (min-width: 769px) {
    .page-content { padding: var(--stack-lg) var(--margin-desktop); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Typography ──────────────────────────────────── */
.page-content h1 {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 700;
    line-height: 44px;
    letter-spacing: -0.02em;
    color: var(--on-surface);
    margin-bottom: var(--stack-md);
}

.page-content h1 .accent {
    color: var(--primary);
}

.page-content h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 600;
    line-height: 36px;
    color: var(--on-surface);
    margin: var(--stack-lg) 0 var(--stack-md);
}

.page-content h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    line-height: 30px;
    color: var(--on-surface);
    margin: var(--stack-md) 0 var(--stack-sm);
}

.page-content p {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 28px;
    color: var(--secondary);
    margin-bottom: var(--stack-sm);
}

.page-content ul, .page-content ol {
    padding-left: 24px;
    margin-bottom: var(--stack-md);
}

.page-content li {
    font-size: 16px;
    color: var(--secondary);
    line-height: 26px;
    padding: 4px 0;
}

.page-content li::marker {
    color: var(--primary);
}

.page-content strong {
    color: var(--on-surface);
    font-weight: 600;
}

.page-content hr {
    border: none;
    border-top: 1px solid var(--surface-container-highest);
    margin: var(--stack-lg) 0;
}

.page-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.page-content a:hover {
    color: var(--primary-container);
    text-decoration: underline;
}

/* ── Profile Hero (card + image) ──────────────────── */
.profile-hero {
    display: flex;
    gap: var(--gutter);
    align-items: stretch;
    margin-bottom: var(--stack-lg);
}

.profile-hero .profile-card {
    flex: 1;
    margin-bottom: 0;
}

.profile-hero-image {
    flex: 0 0 320px;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-low);
    border: 1px solid var(--surface-container-highest);
}

.profile-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-hero-image:hover img {
    transform: scale(1.04);
}

@media (max-width: 900px) {
    .profile-hero {
        flex-direction: column;
    }
    .profile-hero-image {
        flex: none;
        max-height: 280px;
    }
}

/* ── Tables ────────────────────────────────── */
.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--stack-md) 0;
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-low);
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.page-content thead {
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--primary-container)
    );
    color: var(--on-primary);
}

.page-content thead th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.page-content tbody td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--outline-variant);
    color: var(--on-surface);
    vertical-align: top;
}

.page-content tbody tr:last-child td {
    border-bottom: none;
}

.page-content tbody tr:nth-child(even) {
    background: var(--surface-container-low);
}

.page-content tbody tr:hover {
    background: var(--primary-fixed);
    transition: background var(--transition);
}

.page-content caption {
    caption-side: top;
    text-align: left;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.95rem;
}

/* Destaque para células importantes */
.page-content td strong,
.page-content th strong {
    color: var(--primary);
}

/* Links dentro da tabela */
.page-content table a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.page-content table a:hover {
    text-decoration: underline;
}

/* Código dentro da tabela */
.page-content table code {
    background: var(--surface-container);
    color: var(--on-primary-fixed);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
}

/* Responsividade */
@media (max-width: 768px) {
    .page-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        border-radius: var(--radius-md);
    }

    .page-content th,
    .page-content td {
        padding: 0.75rem 1rem;
    }
}

/* ── Profile Card ────────────────────────────────── */
.profile-card {
    background: var(--surface-container-lowest);
    border: 1px solid var(--surface-container-highest);
    border-radius: var(--radius-2xl);
    padding: 48px;
    display: flex;
    align-items: center;
    gap: 36px;
    margin-bottom: var(--stack-lg);
    box-shadow: var(--shadow-low);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.profile-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-container), var(--primary-fixed-dim));
}

.profile-avatar { flex-shrink: 0; }

.profile-avatar img {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-fixed-dim);
    box-shadow: 0 8px 24px rgba(176, 24, 81, 0.12);
}

.avatar-placeholder {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-container));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(176, 24, 81, 0.15);
}

.avatar-placeholder .material-symbols-outlined {
    font-size: 52px;
    color: #fff;
}

.profile-info h1 {
    font-size: 28px !important;
    line-height: 36px !important;
    margin-bottom: 8px !important;
}

.profile-role {
    font-family: var(--font-body);
    font-size: 15px !important;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--primary) !important;
    margin-bottom: 4px !important;
    line-height: 20px !important;
}

.profile-institution {
    font-size: 15px !important;
    color: var(--secondary) !important;
    line-height: 22px !important;
}

/* ── Social Links ────────────────────────────────── */
.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
    gap: var(--stack-sm);
    margin-top: var(--stack-md);
}

.social-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--surface-container-lowest);
    border: 1px solid var(--surface-container-highest);
    border-radius: var(--radius-md);
    color: var(--secondary) !important;
    text-decoration: none !important;
    transition: var(--transition);
    font-size: 15px;
    font-weight: 500;
}

.social-link:hover {
    border-color: var(--outline-variant);
    background: var(--primary-fixed);
    color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.social-link .material-symbols-outlined {
    font-size: 22px;
    color: var(--primary);
}

/* ── Publications ────────────────────────────────── */
.pub-header {
    margin-bottom: var(--stack-lg);
    max-width: 600px;
}

.pub-header h1 {
    margin-bottom: 8px;
}

.pub-stats {
    font-size: 14px;
    color: var(--secondary);
    font-weight: 400;
}

.pub-stats strong {
    color: var(--primary);
    font-weight: 700;
}

.pub-year-group { margin-bottom: var(--stack-lg); }

.pub-year-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 600;
    color: var(--on-surface);
    margin-bottom: var(--stack-md);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--surface-container-highest);
    display: flex;
    align-items: center;
    gap: 12px;
}

.pub-count {
    font-family: var(--font-body);
    font-size: 11px;
    background: rgba(176, 24, 81, 0.08);
    color: var(--primary);
    padding: 3px 12px;
    border-radius: var(--radius-full);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.pub-entry {
    background: var(--surface-container-lowest);
    border: 1px solid var(--surface-container-highest);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: var(--stack-sm);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.pub-entry:hover {
    border-left-color: var(--primary);
    box-shadow: var(--shadow-low);
    transform: translateY(-1px);
}

.pub-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 600;
    color: var(--on-surface);
    margin-bottom: 8px;
    line-height: 1.5;
}

.pub-authors {
    font-size: 14px;
    color: var(--outline);
    margin-bottom: 6px;
    line-height: 1.5;
}

.pub-venue {
    font-size: 14px;
    color: var(--secondary);
    font-style: italic;
    margin-bottom: 12px;
    line-height: 1.5;
}

.pub-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pub-type {
    font-family: var(--font-body);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 12px;
    border-radius: var(--radius-lg);
    font-weight: 700;
}

.pub-type.article {
    background: rgba(99, 102, 241, 0.08);
    color: #4f46e5;
}

.pub-type.inproceedings {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

.pub-type.incollection {
    background: rgba(245, 158, 11, 0.08);
    color: #b45309;
}

.pub-type.mastersthesis,
.pub-type.phdthesis {
    background: rgba(176, 24, 81, 0.08);
    color: var(--primary);
}

.pub-type.preprint {
    background: rgba(250, 136, 136, 0.363);
    color: #ff0000;
}

.pub-note {
    font-size: 13px;
    color: #b45309;
    font-weight: 600;
}

/* ── Publication Action Links ────────────────────── */
.pub-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--surface-container-highest);
}

.pub-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: var(--radius-full);
    text-decoration: none !important;
    transition: var(--transition);
    border: 1px solid var(--surface-container-highest);
    background: var(--surface-container-lowest);
    color: var(--secondary) !important;
}

.pub-action .material-symbols-outlined {
    font-size: 16px;
}

.pub-action:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-low);
}

.pub-action-pdf:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626 !important;
}

.pub-action-slides:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #2563eb !important;
}

.pub-action-doi:hover,
.pub-action-url:hover {
    background: var(--primary-fixed);
    border-color: var(--outline-variant);
    color: var(--primary) !important;
}

.pub-action-github:hover {
    background: #f0fdf4;
    border-color: #86efac;
    color: #16a34a !important;
}

/* ── Loading ─────────────────────────────────────── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--surface-container-highest);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ──────────────────────────────────────── */
#site-footer {
    background: var(--surface-container-lowest);
    border-top: 1px solid var(--surface-container-highest);
    margin-top: var(--stack-lg);
}

.footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 48px var(--margin-mobile);
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

@media (min-width: 769px) {
    .footer-inner {
        padding: 48px var(--margin-desktop);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.footer-name {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--on-surface);
    margin-bottom: 6px;
}

.footer-name .brand-accent { color: var(--primary); }

.footer-copy {
    font-size: 14px;
    color: var(--secondary);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.footer-links a {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: var(--transition);
}

.footer-links a:hover { color: var(--primary); }

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface-container-low); }
::-webkit-scrollbar-thumb {
    background: var(--primary-container);
    border-radius: 10px;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    #menu-toggle { display: block; }

    .nav-links {
        position: fixed;
        top: 0; right: 0; bottom: 0;
        width: 260px;
        background: var(--surface-container-lowest);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 32px 32px;
        gap: 8px;
        z-index: 51;
        transform: translateX(100%);
        transition: transform var(--transition);
        box-shadow: -4px 0 24px rgba(0,0,0,0.1);
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 16px;
        padding: 12px 0;
        width: 100%;
        border-bottom: 1px solid var(--surface-container-highest);
    }

    .page-content h1 {
        font-size: 28px;
        line-height: 36px;
    }

    

    .profile-card {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px;
        gap: 20px;
    }

    .social-links {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    #menu-toggle { display: none !important; }
}

@media (min-width: 1024px) {
    .page-content h1 {
        font-size: 48px;
        line-height: 56px;
    }
}
