/* --- Color Variables & Base Setup --- */
:root {
    --primary-bg: #000000;   /* al Black */
    --secondary-text: #00FF00; /* Green */
    --accent: #32CD32;         /* Accent */
    --disabled: #A9A9A9;       /* Downloaded */
}

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

body {
    background-color: var(--primary-bg);
    color: var(--secondary-text);
    font-family: 'Roboto Mono', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

/* --- Main Layout Container --- */
.container {
    width: 100%;
    max-width: 600px;
    border: 1px solid var(--secondary-text);
    padding: 2rem;
    animation: fadeIn 1s ease-in-out;
}

/* --- Typography & Content Sections --- */
h1, h2 {
    color: var(--secondary-text);
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--secondary-text);
    padding-bottom: 0.5rem;
}

h1 {
    font-size: 2rem;
    text-align: center;
}

h2 {
    font-size: 1.25rem;
}

p {
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

section {
    margin-bottom: 2.5rem;
}

/*
* --- MODIFICATION 1 ---
* The entire app-links section is framed and glows to make it the focus.
*/
.app-links {
    border: 1px solid var(--accent);
    padding: 1.5rem 1.5rem 0.5rem 1.5rem; /* Add padding around the buttons */
    border-radius: 4px;
    box-shadow: 0 0 15px -2px var(--accent); /* Glowing effect */
}

/* --- Call-to-Action (CTA) Links & Buttons --- */
.cta-link {
    display: block;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.25s ease-in-out;
    margin-bottom: 1rem;
    border-radius: 4px;
}

/*
* --- MODIFICATION 2 (Part A) ---
* Primary buttons have a thicker border for more visual weight by default.
*/
.cta-link-primary {
    background-color: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

/*
* --- MODIFICATION 2 (Part B) ---
* The "Inverted Hover" effect is applied to buttons inside the glowing section.
*/
.cta-link-primary:hover {
    background-color: var(--secondary-text); /* Brightest green fill */
    color: var(--primary-bg);                /* Black text for high contrast */
    border-color: var(--secondary-text);
    box-shadow: 0 0 20px var(--secondary-text); /* Vibrant glow effect */
    transform: scale(1.03);                  /* Slight zoom to lift off page */
}

/* The API key button remains a less-emphasized outline button */
.cta-link-secondary {
    background-color: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 50px;
}

.cta-link-secondary:hover {
    background-color: var(--accent);
    color: var(--primary-bg);
}


/* Example of a disabled/downloaded state */
.cta-link.downloaded {
    background-color: transparent;
    border-color: var(--disabled);
    color: var(--disabled);
    cursor: not-allowed;
}

.cta-link.downloaded:hover {
    background-color: transparent;
    color: var(--disabled);
}

/* --- Footer & Animations --- */
footer {
    text-align: center;
    font-size: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid var(--secondary-text);
    color: var(--disabled);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive Design for Larger Screens --- */
@media (min-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .container {
        padding: 3rem;
    }

    .app-links {
        display: flex;
        gap: 1rem;
        padding: 1.5rem;
    }

    .cta-link {
        width: 100%;
        margin-bottom: 0;
    }
}
/* --- Ad Portal Styles --- */
.ad-section {
    margin-bottom: 2.5rem;
}

.ad-portal {
    width: 280px;
    height: 280px;
    margin: 0.5rem auto 0;
    border-radius: 50%;
    background: #000000;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    outline: none;
}

/* Accessible focus ring */
.ad-portal:focus {
    box-shadow: 0 0 0 2px var(--accent);
}

.ad-portal-inner {
    position: absolute;
    inset: 0;
}

.binary-rain {
    position: absolute;
    inset: 6px;
    display: flex;
}

.rain-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
}

.rain-cell {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: #00FF00; /* matrix green */
    user-select: none;
}

.ad-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-content {
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-image-wrap {
    width: 70%;
    aspect-ratio: 1 / 1;
    background: #001000;
    border-radius: 10px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.ad-image-placeholder {
    width: 100%;
    height: 100%;
    background: #EFEFEF;
    border-radius: 8px;
}

.ad-caption {
    margin-top: 6px;
    color: #FFFFFF;
    font-size: 16px;
    text-align: center;
    padding: 0 6px;
    line-height: 1.2;
}

/* Simple fade for rotation */
.fade-in {
    animation: adFade 350ms ease;
}

@keyframes adFade {
    from { opacity: 0.4; transform: scale(0.99); }
    to   { opacity: 1;   transform: scale(1); }
}

/* Responsive scaling on larger screens */
@media (min-width: 768px) {
    .ad-portal {
        width: 320px;
        height: 320px;
    }
    .ad-content { width: 220px; }
}
