/* General Body and HTML styling */
html {
    font-size: 16px;
    height: 100%;
}

body {
    background-color: #121212;
    color: #e0e0e0; /* Brighter, more readable text color */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Common container for centered content */
.container {
    max-width: 1700px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header and Navigation */
header {
    background-color: #000000;
    padding: 0.6rem 0;
    border-bottom: 1px solid #333;
}

    header .container {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

.nav-links {
    padding-right: 1rem;
}

.nav-links a {
    color: #f0f0f0;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 1.1rem;
    transition: color 0.3s;
}

    .nav-links a:hover {
        color: #ffc107;
    }

/* Main Content */
main {
    padding-top: 0; /* Remove top padding to connect hero section */
    padding-bottom: 4rem;
    flex: 1 0 auto; /* For flex sticky footer */
}

/* A new global rule to standardize list item font size */
main ul > li {
    font-size: 0.95rem;
}

/* Footer */
footer {
    width: 100%;
    background-color: #1a1a1a;
    border-top: 1px solid #333;
    padding: 2rem 0;
    text-align: center;
    color: #888;
    flex-shrink: 0; /* For flex sticky footer */
}

    footer .footer-links {
        margin-bottom: 1rem;
    }

        footer .footer-links a {
            color: #f0f0f0;
            text-decoration: none;
            margin: 0 1rem;
            font-size: 0.9rem;
        }

            footer .footer-links a:hover {
                color: #ffc107;
            }

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff;
    font-weight: 600;
}

h1 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* --- UPDATED H2 STYLE --- */
h2 {
    font-size: 2.2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem; /* Add space for the underline */
}

    h2::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 120px; /* Width of the underline */
        height: 6px; /* Thickness of the underline */
        background-color: #ffc107;
        border-radius: 3px; /* Rounded ends for the pill shape */
    }

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


p {
    line-height: 1.7;
    font-size: 0.95rem; /* Standardized font size for all paragraphs */
}

a {
    color: #ffc107;
}

    a:hover {
        color: #ffd54f;
    }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #ffc107;
    color: #121212;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s;
    cursor: pointer;
}

    .btn:hover {
        background-color: #ffca28;
        color: #121212;
    }

.btn-secondary {
    background-color: #444;
    color: #fff;
}

    .btn-secondary:hover {
        background-color: #555;
        color: #fff;
    }


/* Utility classes */
.text-center {
    text-align: center;
}

.margin-top-2 {
    margin-top: 2rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.button-stack {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.justify-start {
    justify-content: flex-start;
}

/* Image styling */
img.responsive {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Main two-column layout for homepage */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: flex-start; /* Aligns items to the top of the grid area */
}

.main-layout.margin-top-2{
    gap: 2rem;
}

.left-column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    gap: 1.5rem;
}

.right-column ul {
    list-style-position: inside;
    padding-left: 0;
}

.left-column .visual-item img {
    width: 100%;
}

.license-section {
    line-height: 1.5;
}

    .license-section h4 {
        font-size: 1.1rem;
        color: #ffc107;
        margin-top: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .license-section p, .license-section ul {
        margin-bottom: 1rem;
    }

    .license-section ul {
        padding-left: 0;
        list-style-position: inside;
    }

/* --- Homepage Specific Styles --- */
/* Homepage Hero Section */
.hero {
    padding: 0.9rem 1rem;
    background-color: #000000; /* Darker, distinct background */
    border-bottom: 1px solid #333;
    margin-bottom: 0; 
}

    .hero h1 {
        font-family: 'Poppins', sans-serif;
        font-size: 5.6rem; /* Equivalent to 90px on a 16px base */
        font-weight: 700; /* Bold */
        margin-bottom: 0.5rem;
        position: relative;
        display: inline-block;
        opacity: 0;
        animation: fadeIn 1s ease-in-out 0.0s forwards;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.hero .version-badge {
    font-size: 1.5rem;
    color: #ffc107;
    position: absolute;
    bottom: 0.95rem;
    left: 100%; /* Position to the right of the main text */
    margin-bottom: 0rem; /* Add a small gap */
    margin-left: 1rem;
    white-space: nowrap; /* Prevent the version from wrapping */
}

    .hero .subtitle {
        font-size: 1.8rem;
        color: #ffc107;
        margin-bottom: 0.4rem; 
        font-weight: bold;
    }

    .hero .features-summary {
        font-size: 1.1rem;
        color: #fff;
        margin-bottom: 0.75rem;
    }

    .hero .powered-by {
        font-size: 1.1rem;
        color: #888;
    }

/* Homepage Version History */
.version-history h3 {
    margin-top: 1.5rem; /* Reduced margin to shrink vertical space */
    font-size: 1.6rem;
    color: #ffc107;
    border-bottom: 1px solid #444;
    padding-bottom: 0.3rem;
}

.version-history ul {
    list-style-type: disc;
    padding-left: 0;
    list-style-position: inside;
}

.version-history li {
    margin-bottom: 0.25rem;
    line-height: 1.6; /* Adjusted for better readability */
}

.version-history:first-child h3:first-child {
    margin-top: 0;
}

.core-features-section ul li {
    margin-bottom: 0.6rem;
}


/* Margin utility */
.margin-top-4 {
    margin-top: 3rem;
}

/* Lessons Page Specific Styles */
.lessons-list {
    margin-top: 4rem;
}

.lesson-group {
    display: grid;
    grid-template-columns: 5fr 4fr;
    gap: 3rem;
    align-items: flex-start;
    margin-bottom: 4rem;
}

.lesson-details h3 {
    font-size: 2rem;
    color: #ffc107;
    margin-top: 20px;
    margin-bottom: 1.5rem;
}

.lesson-details ul {
    list-style-type: disc;
    padding-left: 0;
    margin-left: 0;
    list-style-position: inside;
}

.lesson-details li {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: #f0f0f0;
}


/* Support Page Styles */
.support-section {
    margin: 4rem auto;
    margin-top: 2rem;
}

.support-intro p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 1.5rem; /* Add spacing between paragraphs */
}

.crypto-container {
    margin-top: 3rem;
}

.crypto-address {
    margin-bottom: 2rem;
}

    .crypto-address .address-label {
        color: #ccc;
        display: block; /* Ensures the label is on its own line */
        margin-bottom: 0.5rem;
        font-size: 1rem;
    }

    .crypto-address .address-value {
        font-family: monospace;
        font-size: 1.1rem;
        color: #f0f0f0;
        background-color: transparent;
        border: 1px solid #555;
        padding: 0.75rem 1rem;
        border-radius: 4px;
        cursor: pointer;
        word-break: break-all;
        display: inline-block;
        width: 100%;
        max-width: 500px; /* Adjust as needed */
        text-align: center;
        transition: background-color 0.3s, border-color 0.3s;
    }

        .crypto-address .address-value:hover {
            background-color: #2a2a2a;
            border-color: #ffc107;
        }

.downloads-section {
    max-width: 600px;
}

.author-photo-column {
    padding-top: 10.5rem;
}

.support-grid {
    gap: 5.4rem;
    grid-template-columns: 5fr 4fr;
}

.support-text-content {
    padding-top: 3rem;
}

.mobile-version-badge {
    display: none;
}

.hero-image-mobile {
    display: none;
}

.video-embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
}

.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.mobile-only-showcase {
    display: none;
}

/* YouTube Facade for Lazy Loading */
.js-youtube-facade {
    position: relative;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.js-youtube-facade::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.js-youtube-facade .youtube-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"></path><path d="M45 24L27 14v20" fill="white"></path></svg>');
    background-repeat: no-repeat;
    z-index: 2;
    transition: transform 0.1s ease-in-out;
}

.js-youtube-facade:hover .youtube-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.js-youtube-facade.active::before,
.js-youtube-facade.active .youtube-play-button {
    display: none; /* Hide the facade once the video is loaded */
}

/* Responsive Design */
@media (max-width: 992px) { /* A slightly larger breakpoint for a better tablet experience */
    .main-layout,
    #author-and-license-grid {
        grid-template-columns: 1fr;
    }

    #version-history-layout {
        display: flex; 
        flex-direction: column;
        align-items: stretch;
    }

    #version-history-layout > .left-column,
    #version-history-layout > .right-column {
        display: contents;
    }

    .mobile-only-showcase {
        display: block;
        margin-top: 2rem;
    }

    #version-history-layout .visual-item {
        width: 100%;
    }

    .version-text-1 { order: 1; }
    .version-image-1 { order: 2; }
    .version-text-2 { order: 3; }
    .version-image-2 { order: 4; }
    .version-text-3 { order: 5; }
    .version-image-3 { order: 6; }
    .version-text-4 { order: 7; }
    .version-image-4 { order: 8; }
    .version-text-5 { order: 9; }
    .version-image-5 { order: 10; }
    .version-text-6 { order: 11; }
    .version-image-6 { order: 12; }
    .version-text-7 { order: 13; }
    .version-image-7 { order: 14; }
    .version-text-8 { order: 15; }
    .version-image-8 { order: 16; }
    .version-text-9 { order: 17; }
    .version-image-9 { order: 18; }
    .version-text-10 { order: 19; }
    .version-image-10 { order: 20; }
    .version-text-11 { order: 21; }
    .version-image-11 { order: 22; }
    .version-text-12 { order: 23; }
    .version-image-12 { order: 24; }
    .version-text-13 { order: 25; }
    .version-image-13 { order: 26; }
}


@media (max-width: 768px) {
    body {
        padding-top: 3rem; /* Make space for the absolute-positioned version badge */
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.8rem;
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
    
    .margin-top-4 {
        margin-top: 2rem;
    }

    header {
        margin-top: 0; /* Reset any potential top margin */
    }

    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        padding-right: 0;
        text-align: center;
    }

        .nav-links a {
            margin: 0 0.75rem;
        }

    .mobile-version-badge {
        display: block;
        position: absolute;
        top: 1rem;
        left: 1rem;
        font-size: 1.2rem;
        color: #ffc107;
        font-weight: bold;
        z-index: 10;
    }

    .hero {
        display: flex;
        flex-direction: column;
        padding-top: 0;
    }

    .hero h1 {
        font-size: 3rem;
        display: block;
        order: 1;
    }

    .hero h1 .version-badge {
        display: none; /* Hide original badge on mobile */
    }

    .hero-image-mobile {
        display: block;
        order: 2;
        margin-top: 1.5rem;
    }

    .hero-image-desktop {
        display: none;
    }

    .hero .hero-text-group {
        order: 3;
        margin-top: 1.5rem;
    }

    .hero .subtitle {
        font-size: 1.2rem;
    }
    
    .hero .features-summary,
    .hero .powered-by {
        font-size: 1rem;
    }

    .main-layout {
        gap: 2rem;
    }

    .left-column {
        gap: 2rem;
    }

    /* Reordering logic for the main index page content */
    #main-content-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    #main-content-grid > .left-column,
    #main-content-grid > .right-column {
        display: contents;
    }

    .downloads-section {
        max-width: 100%;
        margin: 0;
    }

    .button-stack {
        align-items: stretch;
    }

    .mobile-order-1 { order: 1; }
    .mobile-order-2 { order: 2; }
    .mobile-order-3 { order: 3; margin-top: 0; }
    .mobile-order-4 { order: 4; }
    .mobile-order-5 { order: 5; }
    .mobile-order-6 { order: 6; margin-top: 0; }

    .justify-start {
        justify-content: center;
    }

    /* Reordering for author photo and license */
    #author-and-license-grid {
        display: flex;
        flex-direction: column;
    }

    #author-and-license-grid > .right-column { order: 1; }
    #author-and-license-grid > .left-column { order: 2; }

    .author-photo-column {
        padding-top: 0rem;
    }

    .lesson-group {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .lesson-details h3 {
        font-size: 2rem;
        color: #ffc107;
        margin-top: 0px;
        margin-bottom: 1.5rem;
    }

    .support-text-content {
        padding-top: 2rem;
    }
}