/*
 * Woojeong Jin - Personal Homepage
 * Apple-inspired Academic Design
 */

/* ---------------------------------
 * CSS Variables (Apple-inspired palette)
 * --------------------------------- */
:root {
    --text-primary: #1d1d1f;
    --text-secondary: #76767b;
    --text-tertiary: #6e6e73;
    --link-color: #0066cc;
    --link-hover: #0077ed;
    --bg-primary: #ffffff;
    --bg-secondary: #fbfbfd;
    --bg-tertiary: #f5f5f7;
    --bg-gradient: linear-gradient(180deg, #fbfbfd 0%, #ffffff 100%);
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --navbar-bg: rgba(255, 255, 255, 0.8);
    --card-bg: #ffffff;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 100px;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    --max-width: 920px;
}

/* ---------------------------------
 * Dark Mode
 * --------------------------------- */
[data-theme="dark"] {
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #86868b;
    --link-color: #2997ff;
    --link-hover: #5eb8ff;
    --bg-primary: #000000;
    --bg-secondary: #1d1d1f;
    --bg-tertiary: #2d2d2d;
    --bg-gradient: linear-gradient(180deg, #1d1d1f 0%, #000000 100%);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --navbar-bg: rgba(29, 29, 31, 0.8);
    --card-bg: #1d1d1f;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --text-primary: #f5f5f7;
        --text-secondary: #a1a1a6;
        --text-tertiary: #86868b;
        --link-color: #2997ff;
        --link-hover: #5eb8ff;
        --bg-primary: #000000;
        --bg-secondary: #1d1d1f;
        --bg-tertiary: #2d2d2d;
        --bg-gradient: linear-gradient(180deg, #1d1d1f 0%, #000000 100%);
        --border-color: rgba(255, 255, 255, 0.1);
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
        --navbar-bg: rgba(29, 29, 31, 0.8);
        --card-bg: #1d1d1f;
    }
}

/* ---------------------------------
 * Base & Reset
 * --------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    margin: 0;
    padding: 0;
}

/* ---------------------------------
 * Typography (Apple-inspired)
 * --------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 36px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 24px;
    line-height: 1.25;
}

h3 {
    font-size: 17px;
    line-height: 1.35;
}

h4 {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
}

p {
    margin: 0 0 20px;
    color: var(--text-primary);
}

/* ---------------------------------
 * Links
 * --------------------------------- */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover, a:focus {
    color: var(--link-hover);
    text-decoration: none;
}

/* ---------------------------------
 * Focus States (Accessibility)
 * --------------------------------- */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
    border-radius: 4px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

.navbar-default .navbar-nav > li > a:focus-visible {
    outline-offset: -2px;
    border-radius: var(--radius-sm);
}

.pub-links a:focus-visible,
.venue-badge:focus-visible {
    outline-offset: 1px;
}

.social-links a:focus-visible {
    outline-offset: 0;
}

/* Skip to content link (only visible when focused via Tab key) */
.skip-link {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--link-color);
    color: #fff;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 14px;
    z-index: 1002;
    opacity: 0;
    pointer-events: none;
    transition: top var(--transition-fast), opacity var(--transition-fast);
}

.skip-link:focus {
    top: 60px;
    opacity: 1;
    pointer-events: auto;
    color: #fff;
}

strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* ---------------------------------
 * Navigation (Frosted Glass Effect)
 * --------------------------------- */
.navbar-default {
    background: var(--navbar-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: none;
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
    margin-bottom: 0;
    min-height: 52px;
    transition: background var(--transition-smooth);
}

.navbar-default .container {
    max-width: var(--max-width);
}

.navbar-default .navbar-brand {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.01em;
    padding: 15px 15px;
    transition: opacity var(--transition-fast);
}

.navbar-default .navbar-brand:hover {
    color: var(--text-primary);
    opacity: 0.7;
}

.navbar-default .navbar-nav > li > a {
    color: var(--text-primary);
    font-weight: 400;
    font-size: 14px;
    padding: 16px 18px;
    transition: opacity var(--transition-fast);
    letter-spacing: 0;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
    color: var(--text-primary);
    background: transparent;
    opacity: 0.65;
}

.navbar-toggle {
    border: none;
    margin-top: 10px;
    margin-bottom: 10px;
}

.navbar-toggle .icon-bar {
    background-color: var(--text-secondary);
    width: 22px;
    height: 2px;
    border-radius: 2px;
}

.navbar-toggle:hover .icon-bar,
.navbar-toggle:focus .icon-bar {
    background-color: var(--text-primary);
}

.navbar-fixed-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* ---------------------------------
 * Main Wrapper
 * --------------------------------- */
#main-wrapper {
    overflow: hidden;
    padding-top: 52px;
}

.container {
    max-width: var(--max-width);
    padding-left: 22px;
    padding-right: 22px;
}

/* ---------------------------------
 * Section Wrapper
 * --------------------------------- */
.section-wrapper {
    padding: 50px 0;
}

.section-wrapper .container {
    max-width: var(--max-width);
}

/* Full-width section headings */
.section-heading {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--text-primary);
    margin: 0 0 22px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.section-inner {
    max-width: 100%;
}

.section-education,
.section-patents {
    background: var(--bg-primary);
}

.section-experience,
.section-pub {
    background: var(--bg-secondary);
}

.section-pub.section-patents {
    background: var(--bg-primary);
}

/* ---------------------------------
 * Section Titles (Apple style)
 * --------------------------------- */
/* ---------------------------------
 * Header / Hero Section
 * --------------------------------- */
.header {
    padding: 60px 0 50px;
    background: var(--bg-gradient);
    position: relative;
}

.header .container {
    max-width: var(--max-width);
}

.header .row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.header .col-md-3 {
    flex: 0 0 auto;
}

.header .col-md-8 {
    flex: 1;
}

.header .profile-img {
    margin-right: 40px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header .profile-img img.img-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.header .profile-img img.img-circle:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

/* Social Links */
.social-links {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 2px;
    width: 150px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 16px;
    transition: all var(--transition-fast);
}

.social-links a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Name & Title */
.header .name-wrapper {
    margin-bottom: 20px;
}

.header .name-wrapper h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 6px;
    line-height: 1.15;
    background: linear-gradient(135deg, #1d1d1f 0%, #434343 50%, #1d1d1f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .header .name-wrapper h1 {
    background: linear-gradient(135deg, #f5f5f7 0%, #a1a1a6 50%, #f5f5f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .header .name-wrapper h1 {
        background: linear-gradient(135deg, #f5f5f7 0%, #a1a1a6 50%, #f5f5f7 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

.header .name-wrapper span {
    font-size: 17px;
    color: var(--text-tertiary);
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Bio paragraphs */
.header p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.header p:last-of-type {
    margin-bottom: 0;
}

/* Research Interests (Pill Tags) */
.research-interests {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.research-interests strong {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 2px;
}

.research-interests .tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.research-interests .tag:hover {
    background: #e8e8ed;
}

[data-theme="dark"] .research-interests .tag:hover {
    background: #3d3d3d;
}

.research-interests .tag::after {
    content: none;
}

/* ---------------------------------
 * Publication Icon Links
 * --------------------------------- */
.pub-links {
    display: inline-flex;
    gap: 8px;
    margin-top: 8px;
}

.pub-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pub-links a:hover {
    background: var(--link-color);
    color: #fff;
}

.pub-links a i {
    font-size: 11px;
}

/* ---------------------------------
 * Experience Section
 * --------------------------------- */
.section-experience {
    background: var(--bg-secondary);
    padding: 50px 0;
}

/* Content Items - Timeline View */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, var(--link-color) 0%, var(--text-tertiary) 100%);
    border-radius: 2px;
}

.content-item {
    padding: 12px 16px 12px 0;
    margin-left: -8px;
    padding-left: 8px;
    border-bottom: none;
    position: relative;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.content-item:hover {
    background: var(--bg-tertiary);
}

.content-item::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--link-color);
    z-index: 1;
    transition: all var(--transition-fast);
}

.content-item:hover::before {
    background: var(--link-color);
    transform: scale(1.2);
}

.content-item:last-child {
    border-bottom: none;
}

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

.content-item:first-child::before {
    top: 6px;
}

.content-item small {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
    letter-spacing: 0;
}

.content-item h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px;
    line-height: 1.4;
}

.content-item h3 a {
    color: var(--link-color);
    font-weight: 600;
}

.content-item h3 a:hover {
    color: var(--link-hover);
}

.content-item h4 {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-tertiary);
    margin: 0;
}

.content-item p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ---------------------------------
 * Education Section
 * --------------------------------- */
.section-education {
    background: var(--bg-primary);
    padding: 50px 0;
}

/* ---------------------------------
 * Publications Section
 * --------------------------------- */
.section-pub {
    background: var(--bg-secondary);
    padding: 50px 0;
}

/* Year Dividers */
.year-divider {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 32px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.02em;
}

.year-divider:first-child {
    margin-top: 0;
}

/* Publication Cards - Glassmorphism */
.section-pub article {
    padding: 0;
    margin-bottom: 10px;
}

.section-pub article .inner {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .section-pub article .inner,
:root:not([data-theme="light"]) .section-pub article .inner {
    background: rgba(45, 45, 45, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .section-pub article .inner {
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.5);
    }
}

.section-pub article .inner:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .section-pub article .inner:hover {
    background: rgba(45, 45, 45, 0.8);
}

.section-pub article .inner strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.me {
    color: var(--text-primary);
    font-weight: 600;
}

.section-pub .authors {
    color: var(--text-tertiary);
}

.pub-note {
    color: var(--text-tertiary);
    font-size: 12px;
    margin-left: 4px;
}

/* Long author lists */
.authors .authors-full {
    display: none;
}

.authors.expanded .authors-full {
    display: inline;
}

.authors.expanded .authors-short {
    display: none;
}

.authors-toggle {
    border: none;
    background: transparent;
    padding: 0 2px;
    font: inherit;
    font-size: 12px;
    color: var(--link-color);
    cursor: pointer;
}

.authors-toggle:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.section-pub article a {
    font-weight: 500;
}

/* Venue Badges - Soft colors */
.venue-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.venue-badge:hover {
    transform: translateY(-1px);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Different colors for different venue types - soft pastels */
.venue-badge.venue-acl {
    background: rgba(0, 102, 204, 0.1);
    color: #0066cc;
    border-color: rgba(0, 102, 204, 0.2);
}

.venue-badge.venue-acl:hover {
    background: rgba(0, 102, 204, 0.15);
    color: #0055aa;
}

.venue-badge.venue-emnlp {
    background: rgba(0, 168, 107, 0.1);
    color: #00875a;
    border-color: rgba(0, 168, 107, 0.2);
}

.venue-badge.venue-emnlp:hover {
    background: rgba(0, 168, 107, 0.15);
    color: #006644;
}

.venue-badge.venue-neurips,
.venue-badge.venue-iclr {
    background: rgba(220, 80, 80, 0.1);
    color: #c44;
    border-color: rgba(220, 80, 80, 0.2);
}

.venue-badge.venue-neurips:hover,
.venue-badge.venue-iclr:hover {
    background: rgba(220, 80, 80, 0.15);
    color: #a33;
}

.venue-badge.venue-arxiv {
    background: rgba(134, 134, 139, 0.1);
    color: var(--text-secondary);
    border-color: rgba(134, 134, 139, 0.2);
}

.venue-badge.venue-arxiv:hover {
    background: rgba(134, 134, 139, 0.15);
}

.venue-badge.venue-journal {
    background: rgba(217, 119, 6, 0.1);
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.2);
}

.venue-badge.venue-journal:hover {
    background: rgba(217, 119, 6, 0.15);
    color: #92400e;
}

/* Dark mode adjustments for venue badges */
[data-theme="dark"] .venue-badge.venue-acl {
    background: rgba(41, 151, 255, 0.15);
    color: #5eb8ff;
    border-color: rgba(41, 151, 255, 0.25);
}

[data-theme="dark"] .venue-badge.venue-emnlp {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.25);
}

[data-theme="dark"] .venue-badge.venue-neurips,
[data-theme="dark"] .venue-badge.venue-iclr {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.25);
}

[data-theme="dark"] .venue-badge.venue-journal {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
}

.features article {
    margin-bottom: 0;
    padding-top: 0;
}

.features article:first-child {
    border-top: 0;
    padding-top: 0;
}

.features article .inner {
    display: block;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-primary);
}

/* ---------------------------------
 * Footer
 * --------------------------------- */
.footer {
    padding: 30px 0;
    text-align: center;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.footer .container {
    max-width: var(--max-width);
}

.footer .copyright-section {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer .copytext {
    font-weight: 400;
}

/* ---------------------------------
 * Animations (Fade In on Scroll)
 * --------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header,
.section-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

/* ---------------------------------
 * Responsive Design
 * --------------------------------- */
@media (max-width: 991px) {
    .header .name-wrapper h1 {
        font-size: 28px;
    }

        }

@media (max-width: 768px) {
    #main-wrapper {
        padding-top: 50px;
    }

    .section-heading {
        font-size: 20px;
        margin-bottom: 18px;
    }


    .header {
        padding: 40px 0 35px;
    }

    .header .row {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header .profile-img {
        margin: 0 0 24px 0;
    }

    .header .profile-img img.img-circle {
        width: 120px;
        height: 120px;
    }

    .header .name-wrapper h1 {
        font-size: 26px;
    }

    .header .name-wrapper span {
        font-size: 15px;
    }

    .header p {
        text-align: left;
    }

    .research-interests {
        justify-content: center;
    }

    .section-wrapper {
        padding: 35px 0;
    }

        .year-divider {
        margin: 24px 0 12px;
    }

    .navbar-default .navbar-collapse {
        background: var(--navbar-bg);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }

    .navbar-default .navbar-nav {
        margin: 8px 0;
    }

    .navbar-default .navbar-nav > li > a {
        padding: 10px 20px;
    }

    .navbar-default .navbar-nav > li > a::after {
        display: none;
    }

    /* Bento grid mobile */
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-card.profile-card {
        order: -1;
    }

    /* Timeline mobile adjustments */
    .timeline {
        padding-left: 24px;
    }

    .timeline::before {
        left: 6px;
    }

    .content-item::before {
        left: -14px;
        width: 10px;
        height: 10px;
        top: 16px;
    }

    .content-item:first-child::before {
        top: 4px;
    }

    /* Pub links mobile */
    .pub-links {
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header {
        padding: 30px 0;
    }

    .section-wrapper {
        padding: 30px 0;
    }

    .section-pub article .inner {
        padding: 12px 14px;
    }

    .footer {
        padding: 24px 16px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    /* Timeline small screen adjustments */
    .timeline {
        padding-left: 22px;
    }

    .timeline::before {
        left: 5px;
    }

    .content-item::before {
        left: -13px;
    }
}

/* ---------------------------------
 * Dark Mode Toggle
 * --------------------------------- */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    margin-left: 8px;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    font-size: 16px;
}

.theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun {
        display: none;
    }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon {
        display: block;
    }
}

/* ---------------------------------
 * Active Nav Highlighting & Hover Underline
 * --------------------------------- */
.navbar-default .navbar-nav > li > a {
    position: relative;
}

.navbar-default .navbar-nav > li > a.active {
    color: var(--link-color);
}

.navbar-default .navbar-nav > li > a::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: var(--link-color);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--transition-smooth);
}

.navbar-default .navbar-nav > li > a:hover::after,
.navbar-default .navbar-nav > li > a.active::after {
    transform: scaleX(1);
}

/* ---------------------------------
 * Back to Top Button
 * --------------------------------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-smooth);
    z-index: 999;
    box-shadow: var(--shadow-md);
}

.back-to-top:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
    transform: translateY(0);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ---------------------------------
 * Utility Classes
 * --------------------------------- */
.img-responsive {
    max-width: 100%;
    height: auto;
}

.img-circle {
    border-radius: 50%;
}

/* ---------------------------------
 * Print Styles
 * --------------------------------- */
@media print {
    .navbar-default,
    .social-links,
    .back-to-top,
    .theme-toggle {
        display: none;
    }

    .header {
        padding-top: 0;
    }

    #main-wrapper {
        padding-top: 0;
    }

    .section-pub article .inner {
        box-shadow: none;
        border: 1px solid #ddd;
    }

}

/* ---------------------------------
 * Experience details
 * --------------------------------- */
.content-item .place {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.content-item .place::before {
    content: '·';
    margin: 0 6px 0 2px;
}

/* ---------------------------------
 * Extra venue badges
 * --------------------------------- */
.venue-badge.venue-speech {
    background: rgba(124, 58, 237, 0.1);
    color: #6d28d9;
    border-color: rgba(124, 58, 237, 0.2);
}

.venue-badge.venue-workshop {
    background: rgba(0, 102, 204, 0.06);
    color: #3b6ea8;
    border-color: rgba(0, 102, 204, 0.15);
}

.venue-badge.venue-report {
    background: rgba(134, 134, 139, 0.1);
    color: var(--text-secondary);
    border-color: rgba(134, 134, 139, 0.2);
}

.venue-badge.venue-granted {
    background: rgba(0, 168, 107, 0.1);
    color: #00875a;
    border-color: rgba(0, 168, 107, 0.2);
}

.venue-badge.venue-pending {
    background: rgba(0, 102, 204, 0.1);
    color: #0066cc;
    border-color: rgba(0, 102, 204, 0.2);
}

[data-theme="dark"] .venue-badge.venue-speech {
    background: rgba(167, 139, 250, 0.15);
    color: #c4b5fd;
    border-color: rgba(167, 139, 250, 0.25);
}

[data-theme="dark"] .venue-badge.venue-workshop,
[data-theme="dark"] .venue-badge.venue-pending {
    background: rgba(41, 151, 255, 0.15);
    color: #5eb8ff;
    border-color: rgba(41, 151, 255, 0.25);
}

[data-theme="dark"] .venue-badge.venue-granted {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.25);
}

/* Badges are labels now, not links */
.venue-badge {
    cursor: default;
}

.venue-badge:hover {
    transform: none;
}

/* ---------------------------------
 * Footer links
 * --------------------------------- */
.footer .copytext a {
    color: var(--text-secondary);
}

.footer .copytext a:hover {
    color: var(--link-color);
}

/* ---------------------------------
 * Reduced motion
 * --------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .header,
    .section-wrapper {
        animation: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}

/* Phones: location on its own line under the role (placed after the base .place rules so it wins) */
@media (max-width: 768px) {
    .content-item .place {
        display: block;
        margin-top: 2px;
    }

    .content-item .place::before {
        content: none;
    }
}

/* Cards on a white section need a visible edge */
.section-patents article .inner {
    border-color: var(--border-color);
}

/* Anchor jumps land below the fixed nav */
header[id],
section[id] {
    scroll-margin-top: 64px;
}
