/* General Reset & Base Styles */
* {
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Merriweather', serif; /* Serif font for general text */
    background-color: #000000; /* Black background */
    color: #F0F0F0; /* Off-white for general text readability */
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Headings will be sans-serif */
h1, h2, h3, h4, h5, h6, .logo {
    font-family: 'Roboto', sans-serif;
}

/* NEW: Overall Page Wrapper to control max-width and centering */
.page-wrapper {
    max-width: 800px; /* Limits the entire page content width for portrait view */
    margin: 0 auto; /* Centers the entire page content */
    padding: 0 15px; /* Padding for the entire content block, including header and sections */
    position: relative; /* Crucial for making the navbar fixed relative to this wrapper */
}

/* Navigation Bar - now fixed relative to .page-wrapper */
.navbar {
    font-family: 'Arial', sans-serif;
    position: sticky; /* Use sticky positioning */
    top: 0; /* Sticks to the top of the viewport when scrolled */
    width: 100%; /* Takes full width of its parent (.page-wrapper) */
    background-color: #800080; /* Restored to original Purple background */
    padding: 12px 15px; /* Padding for the content inside the nav bar */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); /* Subtle shadow */
    z-index: 1000; /* Ensure navbar stays on top */
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Removed left/right/transform/margin:auto as sticky handles positioning */
}

/* main-content and content-wrapper are simplified/removed */
.main-content {
    /* No max-width or specific padding needed here anymore */
    /* It now serves as a container for sections directly under the nav */
    padding-top: 25px; /* Add some space between the sticky nav and the first content block */
}

.logo {
    font-size: 1.8em;
    font-weight: 700;
    color: #FFFF00; /* Yellow for logo accent */
    /* Add flex-shrink to prevent it from shrinking too much if nav needs space */
    flex-shrink: 0;
}

.navbar nav {
    /* Allow the nav section to take available space but shrink if needed */
    flex-grow: 1;
    flex-shrink: 1;
    text-align: right; /* Align links to the right within their space */
    min-width: 0; /* Allow the nav to shrink below its content if necessary */
}

.navbar nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-end; /* Align links to the right within the nav block */
    flex-wrap: wrap; /* Allow links to wrap to the next line if space is too small */
    gap: 15px; /* Use gap for consistent spacing between links instead of margin-left */
}

.navbar nav ul li {
    /* margin-left is replaced by gap on the ul */
    margin-left: 0;
}

.navbar nav ul li a {
    color: #FFFFFF; /* White for nav links */
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
    white-space: nowrap; /* Keep link text on a single line */
}

.navbar nav ul li a:hover,
.navbar nav ul li a:focus {
    color: #00FFFF; /* Aqua on hover/focus */
}

/* Content Blocks Styling */
.content-block {
    background-color: #008000; /* Default block color: Green (from 256 palette) */
    color: #FFFFFF; /* White text for good contrast */
    padding: 30px;
    margin-bottom: 0; /* Remove margin-bottom to pack blocks together */
    border-radius: 0; /* Sharp corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); /* Clear shadow to emphasize block separation */
    overflow: hidden; /* Clear floats if any are used inside */
    animation: fadeIn 0.8s ease-out forwards; /* Simple fade-in animation */
    opacity: 0; /* Start hidden for animation */
}

/* Add a margin to all content blocks EXCEPT the last one to prevent space at the bottom of the page */
.content-block:not(:last-child) {
    margin-bottom: 25px; /* Add margin back for all blocks except the last one */
}

/* Animation for blocks */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remove section title text */
.content-block h2 {
    display: none; /* Hide the section titles */
}


/* Specific Main Section Block Colors */
/* Note: nth-child targets the <section> elements as they appear in the main-content */
.content-block:nth-child(1) { /* "About Us" section */
    background-color: #4B0082; /* Green */
}

.content-block:nth-child(2) { /* "Business Area" section - this will be the transparent container for sub-blocks */
    background-color: #000080; /* This particular color is essentially overridden by transparent for multi-blocks */
}

.content-block:nth-child(3) { /* "Ongoing Projects" section - this will be the transparent container for sub-blocks */
    background-color: #FF00FF; /* Fuchsia - this specific color will be ignored by .multi-block-section */
}

.content-block:nth-child(4) { /* "Contact Us" section */
    background-color: #008000; /* Indigo */
}


/* Multi-block sections (e.g., Business Area, Ongoing Projects) */
.multi-block-section {
    display: grid;
    grid-template-columns: 1fr; /* Default to single column for mobile */
    gap: 20px; /* Space between sub-blocks */
    background-color: transparent; /* Main container for these sections should be transparent */
    padding: 0; /* No padding on the main multi-block container */
    box-shadow: none; /* No shadow on the main multi-block container */
    animation: none; /* No animation on the main multi-block container */
    opacity: 1; /* Always visible as it's a container */
}

.multi-block-section .sub-block {
    background-color: #800000; /* Default Maroon for all sub-blocks on mobile */
    color: #FFFFFF;
    padding: 25px;
    border-radius: 0; /* Sharp corners */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.8s ease-out forwards; /* Apply fade-in to individual sub-blocks */
    opacity: 0; /* Start hidden for animation */
}

/* Specific Sub-Block Colors for "Business Area" */
.multi-block-section:nth-child(2) .sub-block:nth-of-type(1) { /* Cloud Infrastructure */
    background-color: #8B4513; /* SaddleBrown - A distinct, dark earthy tone */
}
.multi-block-section:nth-child(2) .sub-block:nth-of-type(2) { /* Computing Infrastructure */
    background-color: #800000; /* Maroon */
}
.multi-block-section:nth-child(2) .sub-block:nth-of-type(3) { /* Algorithm Research */
    background-color: #008080; /* Teal */
}
.multi-block-section:nth-child(2) .sub-block:nth-of-type(4) { /* Parts Retail */
    background-color: #FF8000; /* Orange */
}

/* Specific Sub-Block Colors for "Ongoing Projects" */
.multi-block-section:nth-child(3) .sub-block:nth-of-type(1) { /* Super Computing Cloud */
    background-color: #800080; /* Purple */
}
.multi-block-section:nth-child(3) .sub-block:nth-of-type(2) { /* New Blockchain Algorithm Research */
    background-color: #008080; /* Teal */
}


/* Responsive Design for larger screens (e.g., tablets and laptops) */
@media (min-width: 600px) {
    .multi-block-section {
        grid-template-columns: 1fr 1fr; /* Two columns for larger screens */
    }

    /* Reset default sub-block colors to ensure specific colors apply */
    .multi-block-section .sub-block {
        background-color: #800000; /* Default if specific rule doesn't match */
    }

    /* Re-applying specific sub-block colors for Business Area in a 2-column layout */
    .multi-block-section:nth-child(2) .sub-block:nth-of-type(1) { /* Cloud Infrastructure */
        background-color: #8B4513; /* SaddleBrown */
    }
    .multi-block-section:nth-child(2) .sub-block:nth-of-type(2) { /* Computing Infrastructure */
        background-color: #800000; /* Maroon */
    }
    .multi-block-section:nth-child(2) .sub-block:nth-of-type(3) { /* Algorithm Research */
        background-color: #008080; /* Teal */
    }
    .multi-block-section:nth-child(2) .sub-block:nth-of-type(4) { /* Parts Retail */
        background-color: #FF8000; /* Orange */
    }

    /* Re-applying specific sub-block colors for Ongoing Projects in a 2-column layout */
    .multi-block-section:nth-child(3) .sub-block:nth-of-type(1) { /* Super Computing Cloud */
        background-color: #800080; /* Purple */
    }
    .multi-block-section:nth-child(3) .sub-block:nth-of-type(2) { /* New Blockchain Algorithm Research */
        background-color: #008080; /* Teal */
    }
}
