@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Open+Sans:ital,wght@0,300;0,400;0,600;1,400&display=swap');

/* --- CSS VARIABLES & BASE RESET --- */
:root {
    --bg-color-dark: #000000;
    --text-color-light: #ffffff;
    --accent-teal: #40E0D0;
    /* Cyan/Teal link accent */
    --accent-glow: rgba(64, 224, 208, 0.4);
    /* Used for edge glows and image shadows */
    --hero-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 25%, #ffdde1 50%, #fbd3e9 75%, #a8edea 100%);
    /* Infused with soft, non-straining red/pink tones for a gentle transition */

    --font-headers: 'Montserrat', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --font-body: 'Open Sans', sans-serif;

    --nav-height: 80px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color-dark);
    color: var(--text-color-light);
    font-family: var(--font-body);
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* --- NAVIGATION MENU --- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: transparent;
    /* Assuming hero gradient starts here, we can make it solid black later if needed via JS or specific classes */
    transition: background-color 0.3s ease;
}

/* Add this class via JS when scrolling down, or apply it to non-index pages */
#navbar.scrolled,
#navbar.dark-bg {
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

#navbar ul {
    display: flex;
    gap: 40px;
}

#navbar a {
    font-family: var(--font-headers);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 400;
}

#navbar a:hover,
#navbar a.active {
    color: var(--accent-teal);
}

/* --- TYPOGRAPHY UTILITIES --- */
.text-center {
    text-align: center;
}

.uppercase {
    text-transform: uppercase;
}

.italic {
    font-style: italic;
}

/* We'll add layout-specific CSS for Home, Portfolio, Resume, Featured below as we build them */

/* --- HERO SECTION --- */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: var(--hero-gradient);
    background-size: 400% 400%;
    /* Make gradient large enough to animate smoothly */
    animation: gradientShift 15s ease infinite;
    /* 15 seconds for a very slow, relaxing shift */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: clip;
    /* clip solves the Chromium 'stuck scroll on load' bug while preventing overflow */
    color: #333;
    /* Dark text on light ambient gradient */
}

/* Keyframes for the Hero Background Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-content {
    z-index: 10;
}

.hero h1 {
    font-family: var(--font-headers);
    font-size: 5.5rem;
    font-weight: 300;
    letter-spacing: 0.25em;
    /* Medium kerning */
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero .subtitle {
    font-family: var(--font-headers);
    font-size: 1rem;
    letter-spacing: 0.8em;
    font-weight: 400;
}

/* Floating Circular Image Placeholders in Hero */
.floating-img {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    /* Placeholder frosty glass look */
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}

.floating-img:hover {
    transform: scale(1.05);
    /* Slight zoom on hover */
}

/* Random-ish positioning based on Alexandria's site */
.img-1 {
    width: 250px;
    height: 250px;
    top: 10%;
    left: -5%;
}

.img-2 {
    width: 180px;
    height: 180px;
    top: 15%;
    left: 25%;
}

.img-3 {
    width: 300px;
    height: 300px;
    top: 5%;
    right: 15%;
}

.img-4 {
    width: 150px;
    height: 150px;
    top: -5%;
    right: -2%;
}

.img-5 {
    width: 120px;
    height: 120px;
    top: 45%;
    left: 8%;
}

.img-6 {
    width: 220px;
    height: 220px;
    bottom: 5%;
    left: 20%;
}

.img-7 {
    width: 180px;
    height: 180px;
    bottom: 15%;
    right: 10%;
}

/* Ensure mobile layout doesn't break horizontal scroll */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
        letter-spacing: 0.3em;
    }

    .hero .subtitle {
        font-size: 0.8rem;
        letter-spacing: 0.4em;
    }

    .floating-img {
        display: none;
        /* Hide on mobile to keep it clean, or scale down */
    }
}

/* --- MAIN CONTENT & SECTIONS (Dark Mode) --- */
.content-sections {
    position: relative;
    z-index: 5;
    background-color: var(--bg-color-dark);
}

.info-section {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px;
    gap: 80px;
}

.info-section.alternate {
    flex-direction: row-reverse;
    /* Z-Pattern alternating direction */
}

/* Reduce top padding for the first section on the home page to fix double-scroll */
#background {
    padding-top: 40px;
}

@media (max-width: 900px) {

    .info-section,
    .info-section.alternate {
        flex-direction: column;
        text-align: center;
        gap: 40px;
        padding: 60px 20px;
    }
}

/* Section Text Styling */
.section-text {
    flex: 1;
    max-width: 500px;
}

.section-text h2 {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 30px;
    color: var(--text-color-light);
}

.section-text p {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #cccccc;
    /* Slightly dimmed white for readability */
}

/* Section Image (Circular placeholders with glow) */
.section-image {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background-color: #222;
    /* Placeholder dark gray */
    box-shadow: 0 0 50px rgba(64, 224, 208, 0.2);
    /* Edge glow mimicking the accent */
    background-size: cover;
    background-position: center;
}

@media (max-width: 900px) {
    .section-image {
        width: 300px;
        height: 300px;
    }
}

/* --- CONTACT SECTION --- */
.contact-section {
    padding: 150px 20px 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-content h2 {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 30px;
}

.contact-content p {
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.8;
    color: #cccccc;
}

.email-link,
.github-link {
    display: inline-block;
    color: var(--accent-teal);
    font-size: 1.2rem;
    margin-bottom: 20px;
    transition: color 0.3s;
}

.email-link:hover,
.github-link:hover {
    color: #ffffff;
    text-shadow: 0 0 10px var(--accent-teal);
}

/* Footer Line */
footer,
.footer-divider {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 50px;
    color: #666;
    font-size: 0.9rem;
    width: 100%;
}

/* Force footers to stick to the bottom on short pages */
footer {
    margin-top: auto;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #1a1a1a;
    color: #999;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.social-links a:hover {
    color: #ffffff;
    background-color: var(--accent-teal);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--accent-glow);
    border-color: transparent;
}

/* --- PORTFOLIO PAGE --- */
.page-portfolio {
    background-color: var(--bg-color-dark);
}

.portfolio-container {
    padding-top: var(--nav-height);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.page-title {
    font-family: var(--font-headers);
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    margin-bottom: 60px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Strict 3-column layout */
    gap: 40px;
    margin-bottom: 80px;
}

.project-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    /* Square cards */
    display: block;
    background-color: #111;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

/* Grayscale image that brightens on hover */
.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: grayscale(80%) brightness(0.6);
    transition: filter 0.4s ease;
}

.project-card:hover .card-image {
    filter: grayscale(0%) brightness(1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.card-overlay h3 {
    font-family: var(--font-headers);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    color: #ffffff;
}

.card-overlay p {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: #cccccc;
}

/* --- RESUME PAGE --- */
.page-resume {
    background-color: var(--bg-color-dark);
}

.resume-container {
    padding-top: var(--nav-height);
    max-width: 800px;
    width: 100%;
    /* Narrower container for text readability */
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* PDF Download Section */
.pdf-download {
    margin-bottom: 60px;
}

.pdf-download p {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.btn-download {
    display: inline-block;
    background-color: var(--accent-teal);
    color: #000;
    font-family: var(--font-headers);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 30px;
    /* Pill shape */
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(64, 224, 208, 0.3);
}

.btn-download:hover {
    background-color: #fff;
    box-shadow: 0 5px 25px rgba(255, 255, 255, 0.4);
}

/* Resume Content Items */
.resume-section {
    margin-top: 40px;
}

.resume-header {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 50px;
    letter-spacing: 0.1em;
}

.resume-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 60px;
    gap: 40px;
}

.resume-content {
    flex: 1;
}

.resume-item .role {
    font-family: var(--font-headers);
    font-weight: 400;
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.resume-item .company {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 5px;
}

.resume-item .dates {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 20px;
}

.resume-item .description {
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.8;
    color: #bfbfbf;
}

.resume-logo {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background-color: #333;
    /* Placeholder dark gray */
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    margin-top: 5px;
    filter: grayscale(100%);
}

@media (max-width: 600px) {
    .resume-item {
        flex-direction: column-reverse;
        /* Stack logo on top of text on tiny screens, or keep next to title */
        gap: 20px;
    }
}

/* --- FEATURED PAGE --- */
.page-featured {
    background-color: var(--bg-color-dark);
}

.featured-container {
    padding-top: var(--nav-height);
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.featured-subtitle {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    margin-bottom: 80px;
    color: #cccccc;
    letter-spacing: 0.1em;
}

.featured-list {
    display: flex;
    flex-direction: column;
    gap: 100px;
    /* Large space between year groups */
}

.featured-year-group {
    position: relative;
    padding-left: 20%;
    /* Offset text to the right a bit, room for floating images */
}

.year-title {
    font-family: var(--font-headers);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    position: absolute;
    left: 0;
    top: 5px;
}

@media (max-width: 768px) {
    .featured-year-group {
        padding-left: 0;
    }

    .year-title {
        position: static;
        margin-bottom: 20px;
    }
}

.featured-entry {
    margin-bottom: 40px;
    max-width: 500px;
    /* Keep text lines readable */
}

.entry-title {
    font-family: var(--font-body);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.entry-title a {
    color: var(--accent-teal);
    transition: all 0.3s ease;
}

.entry-title a:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--accent-teal);
}

.entry-location {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: #cccccc;
    margin-bottom: 5px;
}

.entry-desc {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: #999999;
    line-height: 1.6;
}

/* Floating Images on Featured Page */
.featured-image {
    position: absolute;
    border-radius: 50%;
    background-color: #222;
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 40px rgba(64, 224, 208, 0.4);
    /* Teal outer glow */
    z-index: 2;
    filter: brightness(0.8) sepia(10%) hue-rotate(180deg);
    /* Subtle tint matching Alexandria's photos */
    transition: filter 0.3s ease;
}

.featured-image:hover {
    filter: brightness(1) sepia(0%);
}

.float-1 {
    width: 250px;
    height: 250px;
    top: 0;
    right: -100px;
}

.float-2 {
    width: 280px;
    height: 280px;
    bottom: -50px;
    right: -50px;
}

@media (max-width: 1000px) {
    .featured-image {
        display: none;
        /* Hide floating images on smaller screens to avoid overlapping text */
    }
}

/* Footer specific to Featured Page */
.featured-container footer {
    border-top: none;
    margin-top: 20px;
    padding-top: 0;
}

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

.social-icon {
    font-family: var(--font-headers);
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.1em;
}

.social-icon:hover {
    color: var(--accent-teal);
}

/* --- PROJECT DETAIL PAGE --- */
.page-project-detail {
    background-color: var(--bg-color-dark);
}

/* Full Width Hero */
.project-hero {
    position: relative;
    width: 100vw;
    height: 50vh;
    /* Adjust based on preference */
    margin-top: var(--nav-height);
    background-color: #111;
}

.hero-image-placeholder {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 -50px 100px rgba(0, 0, 0, 0.8);
    /* Fade into background */
}

/* Centralized Container for Content */
.project-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 20px;
}

/* Return Navigation */
.return-nav {
    margin-bottom: 50px;
}

.return-link {
    font-family: var(--font-headers);
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
}

.return-link .arrow {
    margin-right: 15px;
    font-size: 1.2rem;
    font-weight: 300;
}

.return-link:hover {
    color: var(--accent-teal);
}

/* Project Titles & Metadata */
.project-header {
    margin-bottom: 60px;
}

.project-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 400;
    margin-bottom: 10px;
    color: #fff;
}

.project-metadata {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: #ccc;
    letter-spacing: 0.05em;
}

/* Main Content Text and Images */
.project-content {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.8;
    color: #bfbfbf;
}

.intro-text {
    margin-bottom: 60px;
    font-size: 1.15rem;
    /* Intro text is slightly larger */
}

.content-block {
    margin-bottom: 80px;
}

.content-block h2 {
    font-family: var(--font-headers);
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    color: #fff;
    margin-bottom: 20px;
    font-weight: 600;
}

.content-block p {
    margin-bottom: 30px;
}

.content-visual-placeholder {
    width: 100%;
    height: 400px;
    /* Placeholder height, real images use height: auto */
    background-color: #222;
    border-radius: 8px;
    margin: 40px 0;
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.visual-row {
    display: flex;
    gap: 20px;
    margin: 40px 0;
}

.content-visual-placeholder.half {
    flex: 1;
    margin: 0;
}

.caption {
    font-size: 0.9rem;
    color: #888;
    margin-top: -20px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .visual-row {
        flex-direction: column;
    }
}

/* --- SCROLL ANIMATIONS --- */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* --- DOT NAVIGATION SIDEBAR --- */
.dot-nav {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.dot-nav ul {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dot-nav a {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 30px;
    height: 30px;
    position: relative;
}

.dot-nav .dot {
    display: block;
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.dot-nav a:hover .dot {
    background-color: var(--accent-teal);
    transform: scale(1.5);
    box-shadow: 0 0 10px var(--accent-teal);
}

.dot-nav a.active .dot {
    background-color: var(--accent-teal);
    transform: scale(1.5);
}

@media (max-width: 1000px) {
    .dot-nav {
        display: none;
        /* Hide dots on smaller screens */
    }
}

/* --- MOBILE OPTIMIZATIONS (< 768px) --- */
@media (max-width: 768px) {

    /* Navbar improvements */
    #navbar {
        height: auto;
        padding: 15px 10px;
    }

    #navbar ul {
        gap: 15px;
        flex-wrap: wrap;
        /* Allow links to wrap to second line if very narrow */
        justify-content: center;
    }

    #navbar a {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }

    /* Fix body content padding since nav height is now variable */
    .portfolio-container,
    .resume-container,
    .featured-container {
        padding-top: 100px;
    }

    /* Spacing Reductions */
    .info-section {
        padding: 40px 20px;
        gap: 30px;
    }

    #background {
        padding-top: 20px;
        /* Even tighter for the first section */
    }

    .contact-section {
        padding: 60px 20px 30px;
    }

    .project-container {
        padding: 40px 20px;
    }

    /* Typography Scaling */
    .page-title,
    .project-title {
        font-size: 1.8rem;
        letter-spacing: 0.1em;
        margin-bottom: 30px;
    }

    .section-text h2,
    .contact-content h2,
    .resume-header {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .project-metadata,
    .entry-title,
    .resume-item .role {
        font-size: 1rem;
    }

    .intro-text,
    .content-block p,
    .section-text p,
    .contact-content p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* Portfolio Grid - Force Single Column */
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Resume Improvements */
    .resume-item {
        margin-bottom: 40px;
        gap: 15px;
    }

    .resume-logo {
        width: 50px;
        height: 50px;
    }

    /* Featured Content */
    .featured-list {
        gap: 60px;
    }

    /* Hero adjustments */
    .project-hero {
        height: 35vh;
        /* Shorter header image on mobile */
    }
}

/* --- EXTRA SMALL MOBILE (< 480px) --- */
@media (max-width: 480px) {
    #navbar ul {
        gap: 10px;
        padding: 0 5px;
    }

    #navbar a {
        font-size: 0.65rem;
        letter-spacing: 0.5px;
    }

    .hero h1 {
        font-size: 1.8rem;
        letter-spacing: 0.1em;
    }

    .page-title,
    .project-title {
        font-size: 1.5rem;
    }
}