/* 
   style.css
   Modern, Premium Styling System for Dr. Robert Garrett's Portfolio
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
    --bg-main: #0b0f19;
    --bg-surface: rgba(17, 24, 39, 0.7);
    --bg-surface-hover: rgba(31, 41, 55, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(13, 148, 136, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #0d9488;      /* Teal */
    --primary-light: #06b6d4;/* Cyan */
    --secondary: #3b82f6;    /* Blue */
    --secondary-light: #6366f1; /* Indigo */
    --accent: #10b981;       /* Emerald / Success */
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    
    --container-width: 1200px;
}

/* Light Mode Variables override (if we add toggle or want a soft theme, but let's default to dark theme for premium tech/climate-science look) */
[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.8);
    --bg-surface-hover: rgba(241, 245, 249, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(13, 148, 136, 0.15);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --primary: #0d9488;
    --primary-light: #0891b2;
    --secondary: #2563eb;
    --secondary-light: #4f46e5;
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Background Canvas styling */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.section-padding {
    padding: 6rem 0;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

/* Glassmorphism utility */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(13, 148, 136, 0.15);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

header.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    font-weight: 400;
    font-size: 1rem;
    color: var(--text-secondary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width var(--transition-fast);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    border-color: var(--primary);
    background: rgba(13, 148, 136, 0.1);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.3;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
    opacity: 0.95;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-glow {
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.3) 0%, rgba(59, 130, 246, 0.2) 50%, transparent 70%);
    z-index: -1;
    filter: blur(20px);
}

.hero-profile-img {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-surface);
    transition: transform var(--transition-normal);
}

.hero-profile-img:hover {
    transform: scale(1.03) rotate(2deg);
    border-color: var(--primary);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 4rem;
    align-items: start;
}

.about-intro-card {
    padding: 2.5rem;
    text-align: center;
}

.about-intro-card img {
    width: 100%;
    max-width: 240px;
    height: 160px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 2px solid var(--primary);
}

.about-intro-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.about-intro-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-light);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.about-bio {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.about-bio p {
    margin-bottom: 1.5rem;
}

.about-bio strong {
    color: var(--text-primary);
}

/* Skills grid */
.skills-container {
    margin-top: 3rem;
}

.skills-container h4 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.skill-tag:hover {
    background: rgba(13, 148, 136, 0.1);
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 40px;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.timeline-item {
    position: relative;
    padding-left: 80px;
    margin-bottom: 4rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 31px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 4px solid var(--primary);
    z-index: 2;
    transition: all var(--transition-fast);
}

.timeline-item:hover .timeline-dot {
    border-color: var(--secondary);
    box-shadow: 0 0 10px var(--secondary);
    transform: scale(1.2);
}

.timeline-card {
    padding: 2.5rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.timeline-role {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-company {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-light);
    margin-top: 0.2rem;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
}

.timeline-body ul {
    list-style-type: none;
}

.timeline-body li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

.timeline-body li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.timeline-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.2rem;
}

.timeline-skills span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(13, 148, 136, 0.05);
    color: var(--primary-light);
    border: 1px solid rgba(13, 148, 136, 0.2);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

/* Publications Section */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.pub-card {
    padding: 2rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.pub-icon-wrapper {
    background: rgba(13, 148, 136, 0.1);
    color: var(--primary);
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.3rem;
}

.pub-content {
    flex-grow: 1;
}

.pub-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.pub-authors {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.pub-authors strong {
    color: var(--text-primary);
}

.pub-venue {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-muted);
}

.pub-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    align-items: center;
}

.pub-badge {
    background: rgba(59, 130, 246, 0.1);
    color: var(--secondary-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pub-citations {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.project-media {
    position: relative;
    height: 180px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color);
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.project-card:hover .project-media img {
    transform: scale(1.05);
}

.project-badge-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
}

.project-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-info h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.project-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.project-tech span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--text-muted);
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.project-link:hover {
    color: var(--primary-light);
}

/* Personal/Family Photos Section */
.photo-gallery {
    margin-top: 6rem;
    padding-top: 6rem;
    border-top: 1px solid var(--border-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 250px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.gallery-item:first-child {
    grid-column: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(180deg, transparent, rgba(11, 15, 25, 0.9) 70%);
    color: var(--text-primary);
    font-size: 0.85rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-normal);
}

.gallery-item:hover {
    transform: translateY(-4px);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

/* Contact Section */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    padding: 4rem;
    text-align: center;
}

.contact-card h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-card p {
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.contact-item:hover {
    color: var(--primary-light);
    transform: translateY(-2px);
}

.contact-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--transition-fast);
}

.contact-item:hover .contact-icon {
    background: rgba(13, 148, 136, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.contact-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Footer */
footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

footer a:hover {
    color: var(--primary-light);
}

/* Scroll Animation classes */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    html {
        font-size: 15px;
    }
    
    .hero-grid {
        gap: 2rem;
    }
    
    .hero-text h1 {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 4rem 0;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .hero-image-wrapper {
        order: -1;
    }
    
    .hero-text h1 {
        font-size: 3rem;
    }
    
    .hero-desc {
        margin: 0 auto 2.5rem auto;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-dot {
        left: 11px;
    }
    
    .pub-card {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item:first-child {
        grid-column: span 1;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--bg-main);
        flex-direction: column;
        padding: 2rem;
        border-bottom: 1px solid var(--border-color);
        gap: 1.5rem;
        box-shadow: var(--shadow-md);
    }
    
    .nav-links.mobile-active {
        display: flex;
    }
    
    .nav-links a::after {
        display: none;
    }
    
    .contact-card {
        padding: 2rem;
    }
    
    .contact-links {
        gap: 2rem;
    }
}
