/* style.css */

/* Basic Reset & Root Variables */
:root {
    --primary-bg-color: #121212;
    --primary-text-color: #e0e0e0;
    --secondary-text-color: #a0a0a0;
    --accent-color: #bb86fc;
    --card-bg-color: #1e1e1e;
    --border-color: #333333;
    --link-hover-color: #ffffff;

    --font-primary: 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--primary-bg-color);
    color: var(--primary-text-color);
    line-height: 1.7;
    font-size: 16px;
}

/* Container for general content sections (not navbar) */
.container {
    width: 90%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 15px;
}

/* === Navigation Bar (Stacked & Centered as per fix.jpg) === */
.navbar {
    background-color: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(10px);
    padding: 1rem 0; /* Padding for the navbar block */
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    min-height: auto;
    display: flex;
    justify-content: center; /* Centers the .navbar .container within the full width navbar */
}

.navbar .container {
    width: 90%;
    max-width: 1100px; /* Max width for the content within the navbar */
    display: flex;
    flex-direction: column; /* Stacks .nav-logo above .nav-menu */
    align-items: center;    /* Horizontally centers .nav-logo and .nav-menu */
    text-align: center;     /* Default text alignment for children */
}

.nav-logo {
    color: var(--primary-text-color);
    text-decoration: none;
    font-style: italic;
    font-size: clamp(0.8rem, 3vw, 1.5rem); /* Font size for the quote */
    font-weight: 500;
    line-height: 1.5;
    width: 100%; /* Allows text within to be centered effectively */
    margin-bottom: 0.75rem; /* Space between the quote and the menu items below */
}

.nav-logo em {
    font-style: italic;
}

.nav-menu {
    list-style: none;
    display: flex;           /* Lays out <li> items in a row */
    flex-wrap: wrap;         /* Allows items to wrap to a new line if space is insufficient */
    justify-content: center; /* Horizontally centers the group of <li> items */
    align-items: center;     /* Vertically aligns items if they wrap to multiple lines */
    padding-left: 0;
    margin: 0;
    width: 100%; /* Ensures the ul takes available width for centering its items */
}

.nav-menu li {
    margin: 0.25rem 0.75rem; /* Provides equal horizontal spacing around each menu item */
                             /* Vertical margin handles spacing if items wrap */
}

/* Styling for links within the .nav-menu */
.nav-menu a,
.nav-menu .nav-contact-link,
.nav-menu .nav-social-link {
    color: var(--secondary-text-color);
    text-decoration: none;
    font-size: 0.95rem; /* Font size for the contact/social links */
    transition: color 0.3s ease;
    white-space: nowrap; /* Prevents individual links like email from breaking mid-text */
}

.nav-menu a:hover,
.nav-menu .nav-contact-link:hover,
.nav-menu .nav-social-link:hover,
.nav-menu a.active {
    color: var(--accent-color);
}

/* Hamburger for mobile view */
.hamburger {
    display: none; /* Hidden on desktop */
    cursor: pointer;
    margin-top: 0.75rem;
    z-index: 1001;
    position: relative;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--primary-text-color);
    transition: all 0.3s ease-in-out;
}


/* Hero Section */
.hero-section {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* padding-top will be set by script.js */
    padding-bottom: 60px;
}

.hero-section .container { /* Container for image and text block */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    max-width: 1100px;
    width: 90%;
    /* This container does not directly contain the CTA buttons */
}

.hero-image-container {
    margin-bottom: 0;
    flex-shrink: 0;
}

.hero-photo {
    width: 100%;
    max-width: clamp(180px, 28vw, 280px);
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    display: block;
}

.hero-text-content {
    flex: 1;
    text-align: left;
    max-width: 650px;
}

.hero-section h1 {
    font-size: clamp(1.6rem, 4vw + 0.8rem, 2.8rem);
    line-height: 1.25;
    margin-bottom: 0.75rem;
    color: var(--primary-text-color);
}

.hero-section .subtitle {
    font-size: clamp(0.85rem, 2vw + 0.4rem, 1.3rem);
    line-height: 1.6;
    color: var(--secondary-text-color);
    margin-bottom: clamp(1.5rem, 4vh, 2rem);
    max-width: 600px;
}

.hero-text-content .subtitle {
    margin-left: 0;
    margin-right: 0;
}

/* NEW: Styling for the hero section's CTA button container */
.hero-cta-container {
    text-align: left;
    margin-top: 2rem; /* Space above the buttons */
    margin-bottom: 1.5rem; /* ADDED: Space below the buttons, before hero section padding-bottom. ~10pt is roughly 0.8rem or 13px. 1.5rem gives more noticeable space. */
    width: 100%; /* Ensures it's part of the hero section's main flow for alignment */
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--primary-bg-color);
    padding: 12px 25px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
    background-color: color-mix(in srgb, var(--accent-color) 90%, #fff);
    transform: translateY(-2px);
}

/* General Section Styling */
main section {
    padding: 80px 0;
}

main h2 {
    font-size: 2.2rem;
    margin-bottom: 3rem;
    text-align: left;
    position: relative;
    padding-bottom: 10px;
}

main h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
}

/* Projects Section (Single column) */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.project-card {
    background-color: transparent;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.project-card:last-child {
    border-bottom: none;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.project-title a {
    font-size: 1.5rem;
    color: var(--primary-text-color);
    text-decoration: none;
    font-weight: 700;
}

.project-title a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.project-date {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    margin-left: 1rem;
    white-space: nowrap;
}

.project-description {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--secondary-text-color);
}

.project-visuals {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    justify-content: center;
}

.visual-item {
    flex-basis: auto;
    width: 100%;
    max-width: 600px;
    background-color: var(--card-bg-color);
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.project-visuals img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    display: block;
}

@media (max-width: 600px) {
    .visual-item {
        max-width: 95%;
    }
}

@media (max-width: 400px) {
    .visual-item {
        max-width: 100%;
    }
}
.project-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tags li {
    background-color: rgba(187, 134, 252, 0.1);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.project-links a {
    color: var(--accent-color);
    text-decoration: none;
    margin-right: 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.project-links a:hover {
    text-decoration: underline;
    color: var(--link-hover-color);
}

/* Writing Section */
.writing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.writing-card {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.writing-card:last-child {
    border-bottom: none;
}
.writing-title a {
    font-size: 1.3rem;
    color: var(--primary-text-color);
    text-decoration: none;
    font-weight: 700;
}
.writing-title a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}
.writing-excerpt {
    font-size: 1rem;
    color: var(--secondary-text-color);
    margin: 0.5rem 0;
}
.writing-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--secondary-text-color);
}
.no-writing {
    text-align: center;
    color: var(--secondary-text-color);
    font-style: italic;
}


/* Contact Section */
.contact-section {
    text-align: center;
}

.contact-section h2 {
    text-align: center;
}
.contact-section h2::after {
    left: 50%;
    transform: translateX(-50%);
}

.contact-section p {
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
    font-size: 1.1rem;
}

.contact-details {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.contact-details p {
    font-size: 1rem;
    color: var(--secondary-text-color);
    margin-bottom: 0.5rem;
}

.contact-details a.email-link.standalone,
.contact-details a.contact-tel-link {
    color: var(--accent-color);
    text-decoration: none;
}

.contact-details a.email-link.standalone:hover,
.contact-details a.contact-tel-link:hover {
    text-decoration: underline;
    color: var(--link-hover-color);
}

.email-link {
    display: inline-block;
    font-size: 1.2rem;
    color: var(--accent-color);
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    margin-bottom: 2rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.email-link:hover {
    background-color: var(--accent-color);
    color: var(--primary-bg-color);
}

.social-links {
    margin-top: 1rem;
}
.social-links a {
    color: var(--secondary-text-color);
    text-decoration: none;
    margin: 0 1rem;
    font-size: 1rem;
    transition: color 0.3s ease;
}
.social-links a:hover {
    color: var(--accent-color);
}

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

/* === Responsive Design === */
@media (max-width: 768px) {
    .nav-logo {
        font-size: clamp(0.75rem, 4vw, 1.3rem);
        margin-bottom: 0.5rem;
    }

    .nav-menu.active {
        position: fixed;
        left: 0;
        top: 0;
        flex-direction: column;
        background-color: var(--primary-bg-color);
        width: 100%;
        height: 100vh;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        padding-top: 80px;
        justify-content: flex-start;
        align-items: center;
        z-index: 1000;
    }

    .nav-menu:not(.active) {
     /* On mobile, before hamburger is clicked, the nav-menu items might still be visible if they fit.
        If you want them explicitly hidden and only shown via hamburger, you'd add display:none here
        and the hamburger would control .active class to show the full screen menu.
        However, current setup has .nav-menu display:flex always for desktop, and hamburger toggles .active.
        The .active styles for nav-menu are for the slide-out version.
     */
    }
     .nav-menu.active li {
        margin: 1rem 0;
    }

    .nav-menu.active a,
    .nav-menu.active .nav-contact-link,
    .nav-menu.active .nav-social-link {
        font-size: 1.1rem;
    }


    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-section {
        /* padding-top will be set by script.js; ensure script runs after DOM content loaded */
    }
    .hero-section .container {
        flex-direction: column;
        max-width: 90%;
        gap: 2rem;
    }

    .hero-image-container {
        margin-bottom: 1.5rem;
    }
    .hero-photo {
        max-width: clamp(130px, 30vw, 200px);
    }

    .hero-text-content {
        text-align: center;
    }
    .hero-text-content .subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-section h1 {
        font-size: clamp(1.4rem, 5vw + 0.6rem, 2.2rem);
        line-height: 1.2;
    }
    .hero-section .subtitle {
        font-size: clamp(0.8rem, 2.5vw + 0.3rem, 1.1rem);
        line-height: 1.5;
    }

    main h2 {
        font-size: 1.8rem;
    }
    .project-title a {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .nav-logo {
        font-size: clamp(0.7rem, 5vw, 1.1rem);
        width: 95%;
    }

    .nav-menu.active a,
    .nav-menu.active .nav-contact-link,
    .nav-menu.active .nav-social-link {
        font-size: 1rem;
    }

    .hero-section {
         /* padding-top will be set by script.js */
    }
    .hero-section .container {
        gap: 1.5rem;
    }
    .hero-image-container {
        margin-bottom: 1.5rem;
    }
    .hero-photo {
        max-width: clamp(110px, 28vw, 160px);
    }

    .hero-section h1 {
        font-size: clamp(1.2rem, 6vw + 0.4rem, 1.8rem);
        line-height: 1.2;
    }
    .hero-section .subtitle {
        font-size: clamp(0.75rem, 3vw + 0.25rem, 1rem);
        line-height: 1.45;
    }

    .cta-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    main section {
        padding: 60px 0;
    }
    main h2 {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }
    .project-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .project-date {
        margin-left: 0;
        margin-top: 0.25rem;
    }
}