/* --- CSS Variables & Reset --- */
:root {
    --bg-color: #f9f9f7;
    --text-main: #2c2c2c;
    --text-light: #666666;
    --accent: #8c7b6c;
    --accent-dark: #5e5044;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
    --transition: all 0.4s ease;
    --font-heading: 'Georgia', 'Times New Roman', serif;
    --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: normal;
    line-height: 1.2;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--accent-dark);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--accent);
    margin: 10px auto 0;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* --- Layout Containers --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

/* --- Navigation --- */
nav {
    padding: 20px 0;
    position: fixed; /* Keep navbar visible while scrolling */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(249, 249, 247, 0.95);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hamburger button (hidden on desktop) and small-nav state */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    display: block;
    background: var(--text-main);
    height: 2px;
    width: 22px;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after { content: ''; position: absolute; left: 0; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

.nav-inner { position: relative; }

/* --- 1. The Container (Holds Image + Text side-by-side) --- */
.logo-container {
    display: flex;           /* Makes image and text sit in a row */
    align-items: center;     /* Vertically centers them */
    gap: 15px;               /* Adds a little space between the logo and the name */
    text-decoration: none;   /* Removes the underline from the link */
    cursor: pointer;
}

/* --- 2. The Image Styling --- */
.logo-img {
    height: 40px;            /* <-- Change this number to resize the logo (e.g., 50px) */
    width: auto;             /* Keeps the proportions correct */
    display: block;
}

/* --- 3. The Text Styling --- */
.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: normal;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-main); /* Ensures the text is dark, not a link color */
    line-height: 1;
}

.nav-links a {
    margin-left: 30px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    color: var(--text-light);
}

.nav-links a:hover {
    color: var(--accent);
}

/* --- About Section --- */
#about {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image img {
    width: 100%;
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.about-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.contact-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.contact-icon {
    margin-right: 15px;
    width: 24px;
    height: 24px;
    fill: var(--accent);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--text-main);
    color: var(--white);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-top: 10px;
    transition: var(--transition);
    border: 1px solid var(--text-main);
    cursor: pointer;
}

.btn:hover {
    background-color: transparent;
    color: var(--text-main);
}

.btn-whatsapp {
    background-color: #25D366;
    border-color: #25D366;
    color: white;
}

/* --- Section 2: CV & Career (Fixed) --- */
#cv {
    background-color: var(--white);
    position: relative;
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

/* The central line */
.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--accent);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.cv-entry {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    box-sizing: border-box;
}

.cv-entry:hover {
    transform: translateY(-5px);
}

/* Circles on the timeline */
.cv-entry::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: -8px;
    background-color: var(--bg-color);
    border: 3px solid var(--accent);
    top: 22px;
    border-radius: 50%;
    z-index: 1;
}

/* Left/Right Positioning */
.left { left: 0; }
.right { left: 50%; }

/* Circle fix for right side */
.right::after { left: -8px; }

.cv-content {
    padding: 25px;
    background-color: var(--bg-color);
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
}

/* This makes the column a flexible container and adds space between boxes */
.skills-column {
    display: flex;
    flex-direction: column;
    gap: 30px; /* <--- This fixes the "attached" problem. Increase number for more space. */
}

.cv-year {
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 5px;
    display: block;
}

/* --- Software Logo Grid --- */
.software-grid {
    display: grid;
    /* This creates columns that automatically fit based on screen width.
       'minmax(70px, 1fr)' means every logo is at least 70px wide,
       but they will stretch to fill the row evenly. */
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 20px; /* Space between logos */
    align-items: center; /* Vertically center logos */
    padding-top: 10px;
}

.software-grid img {
    width: 100%;
    height: auto;
    max-height: 60px; /* Keeps logos from being too tall */
    object-fit: contain; /* Ensures the logo doesn't get squished */
    display: block;
    margin: 0 auto;
    opacity: 0.8; /* Slight fade for style */
    transition: var(--transition);
}

.software-grid img:hover {
    opacity: 1;
    transform: scale(1.1); /* Logo grows slightly when hovered */
}

/* --- List Style for New Skills --- */
.skills-list {
    list-style: none; /* Removes default ugly bullets */
    padding: 0;
}

.skills-list li {
    position: relative;
    padding-left: 25px; /* Makes room for a custom bullet */
    margin-bottom: 12px;
    color: var(--text-main);
}

/* Adds a nice little arrow bullet point */
.skills-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* --- Section 3: Journal --- */
#blog {
    display: none;
    background-color: var(--bg-color);
}

.blog-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 40px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.blog-card {
    background: var(--white);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-10px);
}

.blog-img {
    height: 200px;
    overflow: hidden;
}

.blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.blog-card:hover .blog-img img {
    transform: scale(1.1);
}

.blog-content {
    padding: 25px;
    flex-grow: 1;
}

.blog-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* --- Section 4: Showroom --- */
#showroom {
    background-color: var(--bg-color);
}

/* Gentle Floating Animation for Images */
@keyframes gentleFloat {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.project-item {
    position: relative;
    cursor: pointer;
}

.project-visuals {
    position: relative;
    height: 450px; /* Taller for bigger images */
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
}

.project-visuals img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Apply floating animation here */
    animation: gentleFloat 8s ease-in-out infinite;
}

.project-info h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.project-link {
    color: var(--accent);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

/* --- GENERAL MODAL STYLES --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevents scrolling the body behind */
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

/* The main box */
.modal-content {
    background-color: var(--white);
    margin: 0 auto;
    /* Height is locked to 85% of the screen height */
    height: 85vh; 
    max-height: 85vh;
    
    /* Centering tricks */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { transform: translate(-50%, -40%); opacity: 0; }
    to { transform: translate(-50%, -50%); opacity: 1; }
}

.close {
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close:hover {
    background: var(--accent);
    color: #fff;
}


/* =========================================
   LAYOUT 1: SHOWROOM (Side by Side)
   ========================================= */

/* We apply this layout specifically to Showroom Modals */
.modal-layout-showroom {
    display: flex;
    flex-direction: row;
    width: 90vw; /* Width is 90% of the screen width */
    max-width: 1400px; /* But never wider than 1400px */
}

/* Left Side: The Image */
.showroom-gallery {
    flex: 1; /* Takes up all remaining space */
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.showroom-gallery img {
    /* This is the magic line: Ensures image fits without stretching/cropping */
    width: 100%; 
    height: 100%;
    object-fit: contain; 
    object-position: center;
}

/* Right Side: The Text */
.showroom-details {
    /* FIX: Fixed width ensures text is never squished */
    flex: 0 0 400px; 
    overflow-y: auto; /* Scroll text if it is too long */
    padding: 50px;
    background: var(--white);
    display: flex;
    flex-direction: column;
}

/* Gallery Controls */
.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    padding: 20px;
    cursor: pointer;
    z-index: 5;
    font-size: 24px;
    transition: 0.2s;
}
.gallery-prev { left: 20px; }
.gallery-next { right: 20px; }
.gallery-btn:hover { background: rgba(0,0,0,0.8); }


/* =========================================
   LAYOUT 2: JOURNAL (Top to Bottom)
   ========================================= */

/* We apply this layout specifically to Journal Modals */
.modal-layout-journal {
    display: flex;
    flex-direction: column;
    width: 90vw;
    max-width: 700px; /* Journal text reads better in narrower columns */
}

.journal-img-wrapper {
    width: 100%;
    /* FIX: Image is max 40% of screen height, not fixed pixels */
    height: 40vh; 
    overflow: hidden;
    flex: 0 0 auto; /* Don't grow */
}

.journal-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop image to fill area like a banner */
    object-position: center;
}

.journal-text-wrapper {
    flex: 1;
    overflow-y: auto; /* Scroll text */
    padding: 40px;
    background: var(--white);
}

/* =========================================
   GENERIC MODAL STYLES (Used in index.html)
   ========================================= */

/* Default Layout: Side by Side on Desktop */
.modal-content {
    /* Ensure flex is active so text stays to the right */
    display: flex;
    flex-direction: row; 
    width: 90vw;
    max-width: 1400px;
    height: 85vh;
}

/* Left Side: The Image */
.modal-img {
    flex: 1; /* Takes up remaining space */
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Desktop: Show whole image without cropping */
    object-position: center;
}

/* Right Side: The Text */
.modal-details {
    /* 
       FIX 1: The text was "shifted left" because it had no padding.
       We give it fixed width + padding.
    */
    flex: 0 0 400px; 
    overflow-y: auto;
    padding: 50px; /* <--- THIS FIXES THE LEFT SHIFT */
    background: var(--white);
    display: flex;
    flex-direction: column;
}


/* =========================================
   MOBILE FIXES (for index.html)
   ========================================= */

@media (max-width: 900px) {
    
    /* Force vertical stack on mobile */
    .modal-content {
        flex-direction: column;
        height: 90vh;
        width: 95vw;
    }

    .modal-img {
        /* 
           FIX 2 (Option 2): Make image BIG on mobile.
           We force it to be 60% of the screen height.
        */
        height: 60vh; 
        flex: none;
    }

    .modal-img img {
        /* 
           FIX 3: Crop the image so it fills that big space.
           It will look dynamic and cinematic.
        */
        object-fit: cover; 
    }

    .modal-details {
        height: 40vh; /* Text takes the remaining space */
        flex: none;
        width: 100%;
        padding: 30px;
    }
}
/* =========================================
   RESPONSIVE DESIGN (Mobile View)
   ========================================= */

@media (max-width: 900px) {
    
    /* Force Showroom to stack on mobile */
    .modal-layout-showroom {
        flex-direction: column;
        height: 90vh;
        width: 95vw;
    }

    .showroom-gallery {
        height: 50%; /* Image takes top half */
        flex: none;
    }

    .showroom-details {
        flex: none;
        width: 100%;
        height: 50%; /* Text takes bottom half */
        padding: 30px;
    }
    
    /* Journal adjustments */
    .journal-img-wrapper {
        height: 30vh; /* Smaller image on mobile */
    }

}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 10;
    background: rgba(255,255,255,0.8);
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
}

.close:hover {
    color: var(--text-main);
}

/* Gallery Controls inside Modal */
.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    z-index: 5;
    font-size: 20px;
}
.gallery-prev { left: 20px; }
.gallery-next { right: 20px; }
.gallery-btn:hover { background: rgba(0,0,0,0.8); }

/* Footer */
footer {
    background-color: var(--text-main);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
    border-top: 5px solid var(--accent);
}

.copyright {
    font-size: 0.8rem;
    opacity: 0.5;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .about-grid, .project-gallery, .modal-content {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .modal-gallery {
        height: 300px;
        flex: none;
    }

    .timeline::after {
        left: 31px;
    }

    .cv-entry {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .cv-entry::after {
        left: 21px;
    }

    .right {
        left: 0%;
    }

    /* On mobile: show hamburger, hide links until opened */
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 64px;
        flex-direction: column;
        background: var(--white);
        padding: 12px 16px;
        box-shadow: 0 8px 30px rgba(0,0,0,0.12);
        border-top: 1px solid rgba(0,0,0,0.04);
        gap: 6px;
        z-index: 200;
    }

    nav.nav-open .nav-links { display: flex; }

    .nav-links a {
        margin-left: 0;
        padding: 10px 12px;
        color: var(--text-main);
        width: 100%;
    }
}