@import url('https://fonts.googleapis.com/css?family=Poppins:100,200,400,500,600,700,800,900');

/* ---------------------------------------------------------------
   Layout is normal document flow, NOT absolute positioning.
   The old CSS pinned every panel with position:absolute + a fixed
   900px width + hardcoded top offsets, so it could not reflow and
   overflowed ~2.3x on a phone. Panels now sit in flow, centered,
   with a max-width -- they shrink to fit any viewport.
   --------------------------------------------------------------- */

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

html {
    scrollbar-width: thin;
    scrollbar-color: slategray black;
}

body {
    margin: 0;
    min-height: 100vh;          /* was: height: 1450px -- clipped content */
    padding: 30px 16px 60px;
    background:
        url(../images/default_bkg.png) no-repeat center top,
        radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    background-size: 2000px, cover;
    background-attachment: scroll, fixed;
    font-family: 'Lato', sans-serif;
    color: white;
    -webkit-text-size-adjust: 100%;
}

a:link    { color: silver; }
a:visited { color: rgb(64, 179, 255); }

/* shared panel look */
.profile-container,
.navbar,
.content-container {
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
}

/* Scrollbar (WebKit) */
html::-webkit-scrollbar { width: 20px; }
html::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}
html::-webkit-scrollbar-thumb {
    background-color: slategray;
    border-radius: 10px;
    border: 3px solid rgba(0, 0, 0, 0.5);
}

/* ---------------- profile ---------------- */

.profile-container {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 20px 30px;
    border: 3px solid silver;
}

.circular--portrait {
    flex: 0 0 auto;
    width: 150px;
    height: 150px;
    overflow: hidden;
    border: 3px solid silver;
    border-radius: 50%;
}

.circular--portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info { min-width: 0; }   /* lets long text wrap instead of overflowing */

#name {
    display: block;
    font-weight: bold;
    font-size: 22px;
    color: white;
    margin-bottom: 12px;
    overflow-wrap: break-word;
}

.profile-info p {
    line-height: 1.5;            /* was 0.3 -- lines overlapped each other */
    font-size: 17px;
    margin: 2px 0;
    color: white;
    overflow-wrap: break-word;
}

.profile-info a { color: slategray; }

/* old hacks that offset around an absolutely-positioned #name */
.position-container,
.name-container { margin-top: 0; }

/* ---------------- navbar ---------------- */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    height: 45px;
    padding: 10px;
    margin-top: 20px;
    border: 3px solid silver;
}

/* Wraps the icons ONLY, and is the containing block for .indicator.
   The indicator is absolutely positioned at top:50% of this element, so it
   must not also enclose the clock -- otherwise on mobile (where the navbar
   stacks) the circle centres between the icon row and the clock row rather
   than on the icons themselves. */
.nav-row {
    position: relative;
    display: flex;
    align-items: center;
    height: 45px;
}

.navbar ul {
    display: flex;
    padding: 0;
    margin: 0;
    position: relative;
}

.navbar ul li {
    list-style: none;
    width: 70px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar ul li a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: silver;
}

.navbar ul li a .icon {
    font-size: 25px;
    color: silver;
    transition: color 0.3s;
}

.navbar ul li a:hover .icon { color: slategray; }

.indicator {
    position: absolute;
    width: 45px;
    height: 45px;
    border: 3px solid silver;
    border-radius: 50%;
    transition: 0.15s;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
}

#time-box {
    /* was position:absolute; left:700px -- ran off the edge of a phone */
    color: slategray;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    white-space: nowrap;
    margin-left: auto;
    padding-right: 6px;
}

/* ---------------- content ---------------- */

.content-container {
    font-size: 18px;
    line-height: 1.6;
    padding: 30px 40px;
    margin-top: 20px;
    border: 0.5px solid silver;
    color: white;
}

.content-container h2 { margin-top: 0; }

.section { display: none; }
.section.active { display: block; }

.institution-info,
.project-info {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-top: 30px;
}

.institution-logo,
.project-logo {
    flex: 0 0 auto;
    width: 100px;
    height: auto;
}

/* NOTE: the old rule said `.project-detais` (typo), so project blocks
   never got their column layout at all. Fixed. */
.institution-details,
.project-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.institution-header,
.project-header,
.jobtitle-header {
    font-size: 16pt;
    display: flex;
    flex-wrap: wrap;             /* name + years stack instead of colliding */
    justify-content: space-between;
    align-items: baseline;
    gap: 4px 10px;
}

.institution-name,
.jobtitle,
.project-name {
    font-weight: bold;
    margin-right: 10px;
    overflow-wrap: break-word;
}

.work-institution { margin-right: 10px; }
.years-attended   { color: slategray; white-space: nowrap; }

.degree-info,
.project-description { margin-top: 5px; }

/* ---------------- publications ---------------- */

.publication-info {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(192, 192, 192, 0.25);
}

.publication-info:first-of-type {
    margin-top: 20px;
    padding-top: 0;
    border-top: none;
}

.publication-header {
    font-size: 14pt;
    font-weight: bold;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.publication-venue {
    margin-top: 4px;
    color: slategray;
    font-size: 15px;
}

/* native <details> disclosure -- no JS, works on every browser */
.publication-abstract { margin-top: 8px; }

.publication-abstract summary {
    cursor: pointer;
    color: silver;
    font-size: 15px;
    list-style: none;               /* hide the default triangle; we draw our own */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    user-select: none;
}

.publication-abstract summary::-webkit-details-marker { display: none; }

.publication-abstract summary::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s;
}

.publication-abstract[open] summary::before { transform: rotate(90deg); }

.publication-abstract summary:hover { color: white; }

.publication-abstract[open] summary { margin-bottom: 4px; }

.publication-abstract p {
    margin: 10px 0 0;
    font-size: 16px;
    line-height: 1.6;
    color: #e0e0e0;
    text-align: justify;
}

/* ---------------- social ---------------- */

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.social-link {
    font-size: 2em;
    text-decoration: none;
    color: white;
    transition: color 0.3s ease;
}

.github-link:hover   { color: rgb(250, 108, 13); }
.linkedin-link:hover { color: rgb(70, 127, 240); }

/* =====================================================================
   TABLET
   ===================================================================== */
@media (max-width: 780px) {
    .content-container { padding: 24px 22px; }

    .profile-container { padding: 20px; gap: 20px; }

    .circular--portrait { width: 120px; height: 120px; }

    .institution-logo,
    .project-logo { width: 70px; }

    .institution-header,
    .project-header { font-size: 14pt; }
}

/* =====================================================================
   PHONE
   ===================================================================== */
@media (max-width: 560px) {
    body {
        padding: 16px 12px 40px;
        background-size: cover, cover;   /* the 2000px bg cropped to a sliver */
    }

    /* profile stacks: portrait on top, details beneath, centered */
    .profile-container {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 20px 16px;
        border-width: 2px;
    }

    #name { font-size: 19px; }

    .profile-info p { font-size: 16px; }

    /* the email is the longest unbroken string on the page -- let it break */
    .profile-info a { overflow-wrap: anywhere; }

    /* nav: icons spread evenly, clock drops onto its own line.
       .nav-row keeps its own 45px height, so .indicator stays centred on the
       icons rather than drifting to the middle of the taller stacked navbar. */
    .navbar {
        flex-direction: column;
        height: auto;
        gap: 6px;
        padding: 8px;
        border-width: 2px;
    }

    .nav-row { width: 100%; }

    .navbar ul {
        width: 100%;
        justify-content: space-around;
    }

    /* 5 icons must fit a 320px screen: 5*52 + padding + border < 320 */
    .navbar ul li { width: 52px; }

    #time-box {
        margin-left: 0;
        padding-right: 0;
        font-size: 12px;
    }

    .publication-header { font-size: 12pt; }

    .publication-venue { font-size: 14px; }

    .publication-abstract p {
        font-size: 15px;
        text-align: left;      /* justified text looks ragged in a narrow column */
    }

    .content-container {
        font-size: 16px;
        padding: 20px 16px;
    }

    .content-container h2 { font-size: 20px; }

    /* logo above the text rather than a squeezed side-by-side */
    .institution-info,
    .project-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
        margin-top: 26px;
    }

    .institution-logo,
    .project-logo { width: 64px; }

    .institution-details,
    .project-details {
        align-items: center;
        width: 100%;
    }

    .institution-header,
    .project-header {
        font-size: 13pt;
        justify-content: center;
        text-align: center;
    }

    .institution-name,
    .jobtitle,
    .project-name { margin-right: 0; }
}
