/* ==========================================================================
   1. GLOBAL RESET & BASELINE UTILITIES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable; /* Kills layout horizontal jitter across tabs */
    min-height: 100vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111;
    
    /* Pinned San Andreas Fault Backdrop */
    background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.15)), 
                      url('images/san_andreas_fault_carrizo_plain.jpg');
    background-attachment: fixed;  
    background-size: cover;        
    background-position: center;   
    
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;

    display: flex;
    justify-content: center; /* Horizontally centers the layout engine */
}

/* ==========================================================================
   2. THE MASTER COLUMN (Locked Full Height & Expanded Width)
   ========================================================================== */
main {
    max-width: 1600px;
    width: 100%;
    min-height: 100vh;
    background-color: #FDFBF9;
    padding: 0 9rem 4rem 9rem; 
    margin: 0;
    
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 0;
    
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.12);
    /* Removed old animation: fadeIn override */
}

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

/* ==========================================================================
   3. HEADER AND FOOTER CONTROLS
   ========================================================================== */
#header-container {
    display: flex;
    justify-content: space-between;
    align-items: baseline;       /* Locks name and menu tabs onto the exact same text line */
    width: 100%;
    padding: 4.5rem 0 2.5rem 0;
    margin-bottom: 4rem;          /* Uniform breathing room before content sections */
}

.logo {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.logo h1 {
    font-size: 2.4rem;
    font-weight: 700;
    display: inline;
}

.logo a {
    color: #000000;
    text-decoration: none; 
}

.logo p {
    font-size: 0.85rem;
    color: #666;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 0.3rem; 
}

/* Seismic Navigation Menu & Active Indicators */
nav {
    display: flex;
    gap: 2.5rem;
}

nav a {
    text-decoration: none;
    color: #888888;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 1.2rem;
    letter-spacing: 1.5px;
    position: relative;
    padding-bottom: 14px;         /* Room for the wave underline */
    transition: color 0.2s ease;
}

nav a:hover {
    color: #111111;
}

nav a.active {
    color: #8C1919;               /* Locks active tab text to matching seismic red */
    font-weight: 700;
}

/* The Tectonic Underline Trace Generator */
nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 14px;
    width: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 14' fill='none' stroke='%238C1919' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M0,7 L13,7 L15,3 L17,11 L19,0 L21,14 L23,4 L25,9 L27,7 L40,7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    animation: seismicTrace 0.35s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes seismicTrace {
    0% { width: 0%; opacity: 0; }
    100% { width: 110%; opacity: 1; }
}

/* Seismogram Footer Alignment */
#footer-container, footer {
    width: 100%;
    margin-top: auto;            /* Spring anchor: aggressively pins footer to absolute page bottom */
    padding: 6rem 0 2rem 0; 
    
    /* ─── THE FIXED ALIGNMENT ENGINE ─── */
    display: flex;
    flex-direction: column;       /* Stacks the links row on top of the copyright row */
    align-items: center;          /* Symmetrically centers everything horizontally */
    justify-content: center;
    /* ────────────────────────────────── */
    
    background-repeat: no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20' fill='none' stroke='%23222222' stroke-width='0.6'%3E%3Cpath d='M0,10 L12,10 L14,7 L17,13 L19,3 L21,17 L23,5 L25,14 L27,8 L29,11 L31,10 L40,10'/%3E%3C/svg%3E");
    background-size: 180px 30px;
    background-position: center top; 
    opacity: 0.5;
    
    text-align: center;
    font-size: 0.85rem;
    color: #999;
}

#footer-container a, footer a {
    color: #555555;               /* Clean, readable charcoal gray */
    text-decoration: none;        /* Kills the ugly raw underline */
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    display: inline-block;
    margin: 0 0.8rem;             /* Perfectly spaces the links away from each other */
    
    /* Smooth transition for the interactive hover color shift */
    transition: color 0.2s ease, border-color 0.2s ease;
    border-bottom: 1px solid transparent; 
    padding-bottom: 2px;
}

/* Hover State: Slices to your signature crustal dark red on mouseover */
#footer-container a:hover, footer a:hover {
    color: #8C1919;               
    border-bottom: 1px solid rgba(140, 25, 25, 0.3); /* Subtle sophisticated accent line */
}

/* The Copyright Line underneath */
#footer-container p, footer .copyright {
    margin-top: 0.8rem;          /* Pushes copyright text cleanly below links */
    font-size: 0.8rem;
    color: #aaaaaa;               /* Soft slate gray so it doesn't shout for attention */
    letter-spacing: 0.5px;
}
/* ==========================================================================
   4. INTERACTIVE CLICK MOUSE SHOCKWAVES
   ========================================================================== */
.seismic-wavefront {
    position: fixed;
    border: 1.5px solid rgba(140, 25, 25, 0.8);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    z-index: 999999; 
    animation: propagate 0.8s cubic-bezier(0.1, 0.4, 0.2, 1) forwards;
}

@keyframes propagate {
    0% { width: 0; height: 0; opacity: 0.9; }
    100% { width: 220px; height: 220px; opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* ==========================================================================
   Smooth View-Transition Animations
   ========================================================================== */
#page-content {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), 
                transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Exit State: Dissolves and floats upward */
#page-content.is-exiting {
    opacity: 0;
    transform: translateY(-12px);
}

/* Entrance Pre-State: Starts lowered and transparent */
#page-content.is-entering {
    opacity: 0;
    transform: translateY(12px);
    transition: none;
}


/* ==========================================================================
   5. UNIFORM CONTENT GRID SYSTEM (About & Fieldwork Pages)
   ========================================================================== */
#page-content h2 {
    margin-bottom: 2.5rem;        /* Symmetrical gap anchor for lists across pages */
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee; 
    padding-bottom: 0.5rem;
}

#page-content a {
    color: #8C1919;               /* Signature crustal dark red */
    text-decoration: none;        /* Removes default heavy underline */
    font-weight: 500;
    border-bottom: 1px solid rgba(140, 25, 25, 0.3); /* Subtle hairline underline */
    transition: color 0.2s ease, border-color 0.2s ease;
}

/* Hover State */
#page-content a:hover {
    color: #5C1010;               /* Slightly deeper red on hover */
    border-bottom-color: #5C1010; /* Darkens hairline on hover */
}

.split-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr; 
    gap: 5rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.split-text h1, .split-text h2 {
    font-size: 2.2rem;
    font-weight: 300;
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

.split-text p {
    font-size: 1.15rem;
    color: #333;
    margin-bottom: 3.5rem;
}

/* Profile picture frame style */
.split-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    padding: 6px;
    border: 1px solid #111;
    outline: 4px solid #fff;
    box-shadow: 0 0 0 5px #111;
    background-color: #fff;
}

.image-link {
    display: block;
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.image-link:hover {
    opacity: 0.85;
}

/* ==========================================================================
   6. TIMELINE COMPONENT LAYOUT
   ========================================================================== */
.education-timeline {
    max-width: 850px;
    margin-top: 2rem;
}

.timeline-item {
    display: flex;
    gap: 2rem;             
    margin-bottom: 1.2rem; 
    align-items: flex-start;
}

.timeline-year {
    font-weight: 700;
    color: #bbb;
    min-width: 95px;       
    font-size: 0.95rem;    
    line-height: 1.3;
}

.timeline-year small {
    font-weight: 400;
    font-size: 0.75rem;
    color: #999;
}

.timeline-content h3 {
    font-size: 1.15rem;    
    font-weight: 600;
    color: #111;
    line-height: 1.3;
    margin-bottom: 0.1rem;
}

.timeline-content .institution {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0.2rem;
}

.timeline-content .details {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

/* ==========================================================================
   7. RESEARCH PROJECT COMPONENT LAYOUT
   ========================================================================== */
.research-intro {
    max-width: 1080px;  
    margin-bottom: 4rem;
}

.lead-text {
    font-size: 1.15rem;
    color: #333;
    line-height: 1.7;
}

.project-item {
    display: block; 
    margin-bottom: 6rem;
}

.project-text {
    margin-bottom: 5rem;
    max-width: 1080px;      
}

.project-text h3 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    letter-spacing: 0.5px;
}

.project-text p {
    font-size: 1.05rem;
    color: #333;
    margin-bottom: 1.2rem;
}

.project-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 1.5rem;
    align-items: flex-start;
}

.project-figure img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #f2f2f2;
    padding: 0.4rem;
    background-color: #fff;
}

.project-figure .caption {
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.8rem;
    line-height: 1.4;
}

.section-divider {
    border: 0;
    height: 1px;
    background-color: #eee;
    margin: 5rem 0;
}

/* ==========================================================================
   8. PUBLICATIONS LAYOUT
   ========================================================================== */
.publications-list {
    margin-top: 0;
    padding-left: 0;
    list-style: none;
}

.pub-item {
    display: flex;
    gap: 3rem;
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
    align-items: flex-start;
    max-width: 950px;
}

.pub-year {
    font-weight: 700;
    color: #bbb;
    min-width: 60px;
}

.pub-link {
    font-size: 0.9rem;
    color: #777;
    text-decoration: none;
    margin-left: 0.4rem;
}

.pub-link:hover {
    color: #000;
    text-decoration: underline;
}

.research-reference {
    font-size: 0.9rem;
    color: #666;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #eee;
    line-height: 1.5;
}

.research-reference h4 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
    margin-bottom: 0.8rem;
}

.research-reference ul { list-style: none; }
.research-reference li { margin-bottom: 0.8rem; padding-left: 1.5rem; text-indent: -1.5rem; }

/* ==========================================================================
   9. MOBILE RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 1024px) {
    main { padding: 0 4rem 4rem 4rem; }
}

@media (max-width: 768px) {
    main { padding: 0 2rem 4rem 2rem; }
    #header-container { flex-direction: column; align-items: flex-start; gap: 1.5rem; padding: 2.5rem 0; }
    nav { gap: 1.5rem; flex-wrap: wrap; }
    .split-container { grid-template-columns: 1fr; gap: 3rem; }
    .project-gallery { grid-template-columns: 1fr; gap: 2.5rem; }
    .pub-item { flex-direction: column; gap: 0.2rem; }
}

@media (max-width: 600px) {
    .timeline-item { flex-direction: column; gap: 0.4rem; margin-bottom: 2.5rem; }
    .timeline-year { min-width: auto; }
}
