/* ============================================================
   Agniv Chatterjee – Portfolio Styles
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
    --bg:        #ffffff;
    --bg-alt:    #f9f9f9;
    --text:      #444444;
    --heading:   #1a1a1a;
    --link:      #1772d0;
    --link-hover:#f09228;
    --muted:     #888888;
    --border:    #e0e0e0;
    --award-bg:  #ffffd0;
    --award-text:#555500;
    --nav-bg:    #ffffff;
}

html.dark {
    --bg:        #1a1a1a;
    --bg-alt:    #222222;
    --text:      #cccccc;
    --heading:   #f0f0f0;
    --link:      #5ba4f5;
    --link-hover:#f09228;
    --muted:     #777777;
    --border:    #333333;
    --award-bg:  #3a3a00;
    --award-text:#dddd88;
    --nav-bg:    #1a1a1a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    color: var(--text);
    background-color: var(--bg);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background-color 0.2s, color 0.2s;
}

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

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

p {
    margin: 0 0 0.8em 0;
}

/* Override Bootstrap container */
.container {
    max-width: 860px !important;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
#site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s, border-color 0.2s;
}

#site-nav.scrolled {
    box-shadow: 0 1px 8px rgba(0,0,0,0.10);
}

.nav-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}

.nav-inner ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
}

.nav-inner ul li {
    display: inline-block;
}

.nav-inner ul a {
    display: block;
    padding: 14px 12px;
    font-size: 0.93em;
    font-weight: 400;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-inner ul a:hover {
    color: var(--link);
    text-decoration: none;
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 1.1em;
    padding: 10px 10px 10px 6px;
    margin-left: 4px;
    line-height: 1;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

#theme-toggle:hover {
    color: var(--link);
}

#mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    color: var(--text);
    padding: 10px;
    margin-left: 4px;
}

/* ============================================================
   SECTIONS — shared
   ============================================================ */
section {
    padding: 52px 0;
    border-bottom: 1px solid var(--border);
}

#about {
    padding-top: 82px;
    border-bottom: 1px solid var(--border);
}

.section-heading {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--heading);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 24px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

/* ============================================================
   ABOUT / HERO
   ============================================================ */
.about-inner {
    display: flex;
    align-items: flex-start;
    gap: 36px;
}

.about-photo-col {
    flex: 0 0 150px;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 3px solid var(--border);
}

.about-bio-col {
    flex: 1;
}

.name-heading {
    font-size: 2.1em;
    font-weight: 900;
    color: var(--heading);
    margin: 0 0 4px 0;
    line-height: 1.1;
}

.title-line {
    font-size: 1.02em;
    color: var(--muted);
    margin: 0 0 14px 0;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    margin-bottom: 16px;
}

.social-links a {
    font-size: 0.9em;
    color: var(--link);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--link-hover);
    text-decoration: none;
}

.social-links a i {
    margin-right: 3px;
}

.bio-text {
    font-size: 0.96em;
    color: var(--text);
    line-height: 1.7;
}

/* ============================================================
   NEWS
   ============================================================ */
#news {
    background-color: var(--bg-alt);
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0 0 14px 0;
}

.news-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95em;
}

.news-list li:last-child {
    border-bottom: none;
}

.news-year {
    flex: 0 0 54px;
    font-weight: 700;
    color: var(--muted);
    font-size: 0.88em;
    white-space: nowrap;
}

.news-text {
    color: var(--text);
    line-height: 1.5;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--link);
    cursor: pointer;
    font-size: 0.88em;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
}

.toggle-btn:hover {
    color: var(--link-hover);
}

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.pub-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

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

.pub-thumbnail {
    flex: 0 0 160px;
}

.pub-thumbnail img {
    width: 160px;
    height: auto;
    max-height: 110px;
    object-fit: contain;
    border-radius: 3px;
    display: block;
    border: 1px solid var(--border);
    opacity: 1;
    transition: opacity 0.25s;
}

.pub-thumbnail a:hover img {
    opacity: 0.72;
}

.pub-info {
    flex: 1;
}

.pub-title {
    font-size: 0.97em;
    font-weight: 700;
    margin: 0 0 5px 0;
    line-height: 1.4;
}

.pub-title a {
    color: var(--heading);
    text-decoration: none;
}

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

.pub-authors {
    font-size: 0.88em;
    color: var(--muted);
    margin: 0 0 4px 0;
}

.pub-venue {
    font-size: 0.88em;
    font-style: italic;
    color: var(--text);
    margin: 0 0 8px 0;
}

.award-badge {
    font-style: normal;
    font-weight: 700;
    color: var(--award-text);
    background: var(--award-bg);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.82em;
    margin-left: 4px;
}

.pub-links {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.pub-links a {
    font-size: 0.82em;
    color: var(--link);
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid var(--link);
    border-radius: 3px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

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


/* ============================================================
   EXPERIENCE & EDUCATION (shared .exp-item structure)
   ============================================================ */
.exp-item {
    margin-bottom: 26px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--border);
}

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

.exp-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 3px;
}

.exp-org {
    font-weight: 700;
    font-size: 0.97em;
    color: var(--heading);
    flex: 1;
}

.exp-date {
    font-size: 0.83em;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.exp-role {
    font-size: 0.88em;
    color: var(--muted);
    font-style: italic;
    margin: 0 0 5px 0;
}

.exp-desc {
    font-size: 0.88em;
    color: var(--text);
    margin: 0;
    line-height: 1.55;
}

/* ============================================================
   XKCD ASIDE
   ============================================================ */
#xkcd-aside {
    border-bottom: none;
    padding: 40px 0 32px;
    text-align: center;
}

.xkcd-wrap {
    display: inline-block;
}

.xkcd-wrap img {
    max-width: 300px;
    width: 100%;
    display: block;
    margin: 0 auto 8px;
    opacity: 0.85;
}

html.dark .pub-thumbnail img {
    filter: brightness(0.85);
}

html.dark .xkcd-wrap img {
    filter: invert(0.88) hue-rotate(180deg);
}

.xkcd-caption {
    font-size: 0.78em;
    color: var(--muted);
}

.xkcd-caption a {
    color: var(--muted);
    text-decoration: underline;
}

.xkcd-caption a:hover {
    color: var(--link-hover);
}

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
    padding: 26px 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-copy {
    font-size: 0.83em;
    color: var(--muted);
    margin: 0;
}

.footer-social {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
}

.footer-social li {
    display: inline-block;
}

.footer-social a {
    color: var(--muted);
    font-size: 1.05em;
    padding: 5px 7px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-social a:hover {
    color: var(--link);
    text-decoration: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .container {
        padding: 0 20px !important;
    }

    .about-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .about-photo-col {
        flex: 0 0 auto;
    }

    .social-links {
        justify-content: center;
    }

    .pub-thumbnail {
        flex: 0 0 130px;
    }

    .pub-thumbnail img {
        width: 130px;
        height: auto;
        max-height: 90px;
    }

    .exp-header {
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav-inner ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 6px 0;
    }

    .nav-inner ul.is-open {
        display: flex;
    }

    .nav-inner ul a {
        padding: 10px 20px;
    }

    #mobile-nav-toggle {
        display: block;
    }
}

@media (max-width: 520px) {
    .pub-item {
        flex-direction: column;
    }

    .pub-thumbnail {
        flex: 0 0 auto;
        width: 100%;
    }

    .pub-thumbnail img {
        width: 100%;
        height: auto;
        max-height: 200px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .name-heading {
        font-size: 1.8em;
    }
}
