
* {
    box-sizing: border-box; /* More intuitive sizing */
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth; /* Optional: smooth scrolling for anchors */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; /* Modern Font Stack */
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    font-size: 16px; /* Base font size */
}

/* --- Header --- */
header {
    background: #333;
    color: white;
    padding: 1rem 1.25rem; /* Use rem for scalable padding */
    text-align: center;
    margin-bottom: 1.5rem; /* Space below header */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

header h1 {
    font-size: 1.75rem; /* Relative sizing */
    font-weight: 600; /* Slightly bolder */
}

/* --- Content Sections (Desktop First Approach) --- */
.content {
    background: white;
    max-width: 900px; /* Max container width */
    margin: 1.5rem auto; /* Vertical and horizontal centering */
    padding: 2rem 2.5rem; /* Internal padding (e.g., 32px 40px) */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); /* Softer shadow */
    display: flex;
    flex-wrap: wrap; /* Allow wrapping if needed, though gap usually prevents it */
    align-items: center; /* Vertically align items */
    gap: 2.5rem; /* Space between flex items (40px) */

    /* Animation setup */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Animation trigger */
.content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Text container */
.text-content {
    flex: 1 1 300px; /* Grow, shrink, base width ~300px. Allows text to wrap nicely */
    min-width: 0; /* Prevents flex overflow issues */
}

.text-content h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem; /* Space below heading */
    color: #222; /* Darker heading */
    line-height: 1.3;
}

.text-content p {
    margin-bottom: 1rem; /* Space between paragraphs */
    font-size: 1rem;
}

.text-content p:last-child {
    margin-bottom: 0; /* Remove margin from last paragraph */
}

/* Image container */
.image-container {
    flex: 0 1 300px; /* Don't grow, allow shrinking, base width 300px */
    /* The HTML structure (order of divs) determines if image is on left or right */
}

.side-image {
    display: block; /* Removes potential extra space below image */
    width: 100%; /* Fill the container */
    height: auto; /* Maintain aspect ratio */
    border-radius: 8px;
    object-fit: cover; /* Optional: ensure image covers area if aspect ratio mismatches */
}

/* --- Section 5 Specific Layout (Download Section) --- */
/* Override the default flex row behavior JUST for section 5 */
#section5 {
    display: flex; /* Ensure it's flex */
    flex-direction: column; /* Stack text and button vertically */
    align-items: center; /* Center items horizontally within the section */
    text-align: center; /* Center text content within its block */
    gap: 1.5rem; /* Space between text block and button container (24px) */
    /* Padding and margin are inherited from .content */
}

/* Adjust text content within section 5 */
#section5 .text-content {
    flex-basis: auto; /* Reset flex-basis, it's a column item */
    flex-grow: 0;     /* Don't allow it to grow */
    width: 100%;      /* Allow text to take full width of the centered column */
    max-width: 650px; /* Optional: constrain text width for readability */
    text-align: center; /* Ensure text inside is centered */
}

/* Container for the button itself */
#section5 .download-container {
    width: 100%; /* Container takes full width */
    text-align: center; /* Centers the inline-block button inside */
}

/* --- Download Button Styling --- */
.download-button {
    display: inline-block; /* Allows padding/margin, sits inline */
    padding: 0.75rem 1.75rem; /* 12px 28px */
    font-size: 1rem; /* Base size */
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #ff7b00, #ff3d00);
    border: none;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    text-align: center;
}

.download-button:hover,
.download-button:focus { /* Add focus style for accessibility */
    background: linear-gradient(135deg, #ff3d00, #c70000);
    transform: translateY(-2px); /* Subtle lift effect */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    outline: 2px solid transparent; /* Remove default, prepare for custom */
    outline-offset: 2px;
}

/* Optional: Add a visible focus style */
.download-button:focus-visible {
     box-shadow: 0 0 0 3px rgba(255, 100, 0, 0.5); /* Example focus ring */
}

/* --- Mobile Optimization (Tablet and below) --- */
@media (max-width: 768px) {
    body {
        font-size: 15px; /* Slightly smaller base font for smaller screens */
    }

    header h1 {
        font-size: 1.5rem;
    }

    .content {
        flex-direction: column; /* Stack ALL sections vertically */
        padding: 1.5rem 1rem; /* Reduced padding (24px 16px) */
        gap: 1.5rem; /* Reduced gap (24px) */
        margin: 1rem auto; /* Reduced vertical margin */
    }

    /* Ensure text and image containers stack correctly */
    .text-content,
    .image-container {
        flex-basis: auto; /* Reset flex basis */
        width: 100%; /* Take full width */
        max-width: 100%; /* Override any desktop max-width if needed */
        flex-grow: 0; /* Reset grow */
        flex-shrink: 1; /* Allow shrinking */
    }

    .image-container {
        /* Control image size and centering on mobile */
        max-width: 350px; /* Limit image size for aesthetics */
        margin-left: auto; /* Center the container */
        margin-right: auto;
        /* Order based on HTML source. For sections 2 & 4, image is first in HTML -> appears first on mobile */
    }

    .text-content h2 {
        font-size: 1.4rem;
    }

    .text-content p {
        font-size: 0.95rem;
    }

    /* Section 5 on mobile - already column, just verify styles */
    #section5 {
        gap: 1rem; /* Slightly reduce gap */
    }

     #section5 .text-content {
         max-width: 100%; /* Ensure no max-width constraint */
     }

    .download-button {
        padding: 0.6rem 1.25rem; /* Slightly smaller padding */
        font-size: 0.95rem;
    }
}

/* --- Mobile Optimization (Small Phones) --- */
@media (max-width: 480px) {
    body {
        font-size: 14px;
        line-height: 1.55; /* Adjust line height */
    }

    header {
        padding: 0.8rem 1rem;
        margin-bottom: 1rem;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .content {
        padding: 1rem 0.8rem; /* Further reduce padding */
        margin: 0.8rem auto;
        gap: 1rem;
    }

     .image-container {
        max-width: 95%; /* Allow image to be almost full width */
    }

    .text-content h2 {
        font-size: 1.25rem;
    }

     .text-content p {
        font-size: 0.9rem;
    }

    .download-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        width: auto; /* Allow button to size naturally or set a max-width */
        max-width: 90%; /* Prevent button from touching screen edges */
    }
}