/*
Primary CSS Stylesheet for website
Author: Joshua Sendgikoski
Responsive pass: box-sizing reset, fluid type via clamp(),
flexible two-column sections, wrapping mobile navbar, responsive iframe.
*/

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* GLOBAL RESET & RESPONSIVE SAFETY NET      */
/* These three rules prevent 90% of "why is  */
/* my phone scrolling sideways?" problems.   */

*, *::before, *::after {
    box-sizing: border-box;      /* padding + border count INSIDE width, so nothing overflows */
}

html {
    overflow-x: hidden;          /* belt-and-suspenders: kill any accidental sideways scroll */
}

img {
    max-width: 100%;             /* images can never grow wider than their container */
}

/* Respect users who ask their OS to reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
body#home{
    margin:0;
    padding: 0;
    font-family: Georgia, 'Times New Roman', serif;
    color: #ffffff;

    /* Background Image*/
    background-image: url('../Media/HL_Tau_protoplanetary_disk.jpg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    background-color: #000000;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 10px;
}

body#CV,
body{
    margin:0;
    padding: 0;
    font-family: Georgia, 'Times New Roman', serif;
    color: #ffffff;
    background-color: #000000;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 10px;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* Navigation Bar */
.navbar{
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar ul{
    list-style: none;
    margin: 0;
    padding: 0 60px;
    display: flex;
    flex-wrap: wrap;               /* links drop to a new line instead of overflowing */
    justify-content: flex-end;
    gap: 30px;
}

.navbar a{
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 20px 0px;
    font-size: 1rem;
    letter-spacing: 2px;
    transition: color 0.2s ease;
}

.navbar a:hover{
    color: #3399ff;
}

.navbar a:focus-visible{         /* keyboard users can see where they are */
    outline: 2px solid #3399ff;
    outline-offset: 4px;
}

.navbar a.active{
    border-bottom: 2px solid #3399ff;
    color: #3399ff;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* Hyperlink*/
a {
    color:#3399ff;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

/* Interior page banner */
.page-banner{
    position: relative;
    width: 100%;
    height: clamp(240px, 45vh, 480px);   /* never taller than needed on tall phones */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.page-banner img{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;        /* fills the banner, crops overflow */
}

.page-banner::after{          /* dark overlay so the title stays readable */
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.65));
}

.page-banner h1{
    position: relative;       /* lifts the title above the overlay */
    z-index: 1;
    font-size: clamp(2.5rem, 8vw, 5rem);   /* fluid: shrinks on phones, caps at 5rem */
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8);
    margin: 0;
}

.page-banner .subtitle{
    position: relative;
    z-index: 10;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    max-width: 700px;
    margin: 10px auto 0 auto;
    font-weight: normal;
}

/* Interior content card */
.page-content{
    position: relative;
    z-index: 2;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    width: 88%;
    max-width: 1200px;
    margin: -80px auto 60px auto;   /* negative top = card overlaps banner */
    padding: clamp(24px, 5vw, 50px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    font-size: clamp(1.05rem, 2.5vw, 1.5rem);
    line-height: 1.6;
    overflow-wrap: break-word;      /* long links/URLs wrap instead of overflowing */
}

.image-credit {
    position: absolute;
    bottom: 10px;
    right: 40px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 8px;
    border-radius: 3px;
    backdrop-filter: blur(2px);
    z-index: 2;
}

.image-credit a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* PDF Viewer Toolbar */
.pdf-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
    margin: -150px auto 60px auto;
    padding: 0 15px;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Seamless PDF Embed */
.pdf-viewer {
    width: 100%;
    height: 85vh;
    min-height: 600px;
    border: none;
    border-radius: 8px;
    display: block;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#HL-Tau-Caption {
    position: absolute;
    bottom: 30px;
    right: 30px;
    max-width: min(85%, 520px);
    font-size: clamp(0.8rem, 2vw, 1rem);
    text-align: right;
}

/* Chevron Scroll Hint */
.scroll-hint{
    font-size: 3rem;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.8;
    animation: bob 2s ease-in-out infinite;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.scroll-hint.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes bob{
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(12px); }
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* Header Title */
.hero-section{
    margin-top: 100dvh;
    margin-bottom: 30px;
    text-align: center;
    padding: 0 20px;
}

.hero-section h1{
    font-size: clamp(2.2rem, 7vw, 4rem);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* About Me */
.content-section{
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    padding: clamp(24px, 4vw, 50px);
    width: 88%;
    max-width: 1400px;
    margin: 0 auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);

    display: flex;
    flex-wrap: wrap;                       /* columns stack when they run out of room */
    align-items: center;
    justify-content: space-between;
    gap: clamp(40px, 6vw, 100px);
}

.text-content{
    flex: 1 1 340px;                        /* small basis; grows to fill — never forces a wrap */
    min-width: 0;                           /* lets the column shrink instead of overflowing */
    container-type: inline-size;            /* headings below can size to THIS column's width */
}

.text-content .text-caption{
    font-size:1.3em;
    font-style: italic;
    padding: 0;
    margin: 0 0 25px 0;
    color:#9ca3af;
    list-style-type: none;
}

.text-content .text-caption li{
    margin-bottom: 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.text-content .text-caption li a{
    position: relative;
    color: rgba(255, 255, 255, 0.8);
    font-style: normal;
    text-decoration: underline;
}

.content-section h2{
    /* 8cqi = 8% of the text column's width, so the heading always fits the column */
    font-size: clamp(1.75rem, 9cqi, 3.5rem);
    overflow-wrap: break-word;              /* last-resort safety: can never escape the box */
    margin-top: 0;
    margin-bottom: 15px;
}

.content-section p{
    font-size: clamp(1.05rem, 2.5vw, 1.5rem);
    line-height: 1.6;
    margin-bottom: 15px;
    overflow-wrap: break-word;              /* safe: only body text may break a long word */
}

.content-section ul{
    list-style-type: none;
}

.picture-box{
    flex: 0 0 clamp(300px, 38vw, 560px);   /* circle scales with the viewport */
    aspect-ratio: 1 / 1;                    /* stays a perfect circle at any size */
    overflow: hidden;
    border-radius: 50%;
}

.picture-box img{
    width: 100%;
    height: 100%;
    object-fit: cover;                      /* fixed typo (was object-fix) */
    display: block;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* PUBLICATIONS & PRESENTATIONS PAGE */

.pub-group {
    margin-bottom: 50px;
}

.pub-group h2 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffffff;
    border-bottom: 2px solid rgba(51, 153, 255, 0.4);
    padding-bottom: 10px;
    margin-bottom: 25px;
}

/* Base Publication Card */
.pub-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid #3399ff;
    border-radius: 0 10px 10px 0;
    padding: 24px 28px;
    margin-bottom: 20px;
    overflow-wrap: break-word;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.pub-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    border-left-color: #66b2ff;
    transform: translateX(4px);
}

/* Layout Header (Title + Bibcode/Date) */
.pub-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px 20px;
    margin-bottom: 8px;
}

.pub-title {
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.4;
    flex: 1 1 240px;
    min-width: 0;
}

.bibcode-link {
    font-family: monospace;
    font-size: 0.95rem;
    color: #3399ff;
    text-decoration: none;
    white-space: nowrap;
    background: rgba(51, 153, 255, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(51, 153, 255, 0.2);
    transition: background 0.2s ease;
}

.bibcode-link:hover {
    background: rgba(51, 153, 255, 0.25);
    text-decoration: none;
}

.pub-authors,
.pub-venue {
    font-size: 1.05rem;
    color: #d1d5db;
    margin: 4px 0 10px 0;
}

.pub-date {
    font-size: 0.95rem;
    color: #9ca3af;
    white-space: nowrap;
}

/* Specific highlight section for specific contribution */
.pub-contribution {
    font-size: 1rem;
    color: #e5e7eb;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 2px solid #3399ff;
    margin-top: 12px;
}

.pub-details {
    font-size: 1rem;
    color: #9ca3af;
    margin-top: 8px;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* Research / Advocacy Section */
.research-section,
.advocacy-section{
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    padding: clamp(24px, 4vw, 40px);
    width: 88%;
    max-width: 1400px;
    margin: 30px auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: clamp(40px, 6vw, 100px);
}

.research-section h2,
.advocacy-section h2{
    font-size: clamp(1.75rem, 9cqi, 3.5rem);
    overflow-wrap: break-word;
    text-transform:uppercase;
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

.research-section p,
.advocacy-section p{
    font-size: clamp(1.05rem, 2.5vw, 1.5rem);
    line-height: 1.6;
    margin-bottom: 15px;
    overflow-wrap: break-word;              /* safe: only body text may break a long word */
}

.research-picture,
.advocacy-picture{
    flex: 1.15 1 340px;                    /* grows a touch larger than the text column */
    min-width: 0;                          /* allow shrink so it stays beside the text */
    overflow: hidden;

    display: flex;
    flex-direction: column;
    gap: 35px;
}

.research-picture img,
.advocacy-picture img{
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Responsive video embed (outreach page).
   CSS width/height override the iframe's width="600" height="400" attributes. */
.advocacy-video{
    flex: 1.15 1 340px;
    min-width: 0;
    max-width: 100%;
}

.advocacy-video iframe{
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;                    /* matches the original 600x400 shape */
    border: none;
    border-radius: 12px;
    display: block;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* Photo Gallery Section (carousel) */
.gallery-section{
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    padding: clamp(24px, 4vw, 40px);
    width: 88%;
    max-width: 1400px;
    margin: 30px auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.gallery-section h2{
    font-size: clamp(2rem, 6vw, 4rem);
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 30px;
}

/* Gallery / carousel */
.gallery{
    position: relative;
    width: 100%;
    max-width: 1400px;
    height: clamp(320px, 55vh, 650px);     /* fluid height instead of fixed 650px */
    margin: 0 auto;
    overflow: hidden;
    border-radius: 16px;
}

.gallery .slide{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.gallery .slide.active{
    display: block;
}

.gallery .slide.vertical{
    object-fit: contain;
}

.gallery-arrow{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}
.gallery-arrow:hover{ background-color: rgba(0, 0, 0, 0.8); }
.gallery-arrow.prev{ left: 20px; }
.gallery-arrow.next{ right: 20px; }

.gallery-caption{
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.4;
    margin-top: 15px;
    min-height: 1.4em;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* Contact Section */
.contact-section{
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    padding: clamp(24px, 4vw, 40px);
    width: 88%;
    max-width: 1400px;
    margin: 30px auto 60px auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.contact-section h2{
    font-size: clamp(2rem, 6vw, 4rem);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-top: 0;
}

.email a{
    color: #ffffff;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    overflow-wrap: break-word;
}

.social-links{
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
}

.social-links img{
    width: 60px;
    height: 60px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-links a:hover img{
    transform: scale(1.15);
    opacity: 0.8;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* HERO STAT BADGES */

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.stat-card {
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 14px 18px;
    border-radius: 10px;
    flex: 1 1 140px;
    min-width: 120px;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #3399ff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.1;
    margin-bottom: 6px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    line-height: 1.3;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/* RESPONSIVE / MEDIA QUERIES                */
/* Headings/paddings already scale via clamp,*/
/* so these only handle LAYOUT changes.      */

/* Tablets & small laptops (<= 1200px):
   force the two-column sections to a single stacked column. Stacking here
   (rather than 1024px) guarantees the text column is wide enough for long
   uppercase headings like "PROTOPLANETARY" before they'd have to wrap. */
@media (max-width: 1200px) {
    .content-section,
    .research-section,
    .advocacy-section {
        flex-direction: column;
        align-items: stretch;               /* children fill the width instead of shrinking to content */
        gap: 40px;
    }

    /* Stacked: the text column fills the row (needed so headings size correctly) */
    .text-content {
        width: 100%;
        flex-basis: auto;
    }

    /* When stacked, the circular headshot shouldn't stretch full width */
    .picture-box {
        flex: 0 0 auto;
        width: min(400px, 85vw);
        align-self: center;
    }

    /* Let media blocks fill the stacked column but stay centered */
    .research-picture,
    .advocacy-picture,
    .advocacy-video {
        flex: 1 1 auto;
        width: 100%;
        max-width: 780px;
        align-self: center;
    }
}

/* Phones (<= 768px) */
@media (max-width: 768px) {
    /* Navbar: center the links and let them wrap onto multiple rows */
    .navbar ul {
        justify-content: center;
        padding: 6px 12px;
        gap: 4px 18px;
    }

    .navbar a {
        padding: 12px 0;
        letter-spacing: 1px;
    }

    /* Publication card header stacks title above the date/bibcode */
    .pub-header {
        flex-direction: column;
        gap: 6px;
    }

    .pub-card {
        padding: 18px 20px;
    }

    /* Carousel arrows: touch-friendly and tucked in */
    .gallery-arrow {
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }
    .gallery-arrow.prev { left: 8px; }
    .gallery-arrow.next { right: 8px; }
}

/* Small phones (<= 600px) */
@media (max-width: 600px) {
    .hero-stats {
        flex-direction: column;
        gap: 10px;
    }

    /* Pull the banner overlap card up a little less on tiny screens */
    .page-content {
        margin-top: -50px;
    }

    #HL-Tau-Caption {
        left: 20px;
        right: 20px;
        bottom: 20px;
        max-width: none;
        text-align: center;
    }
}