/* style.css */

/* --- GLOBAL RESETS --- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a; 
    color: #ccd;               
    font-family: 'Courier New', Courier, monospace;
    
    overflow-x: hidden; 
    width: 100%;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

main {
    /* Ensures content stays centered even if it wants to be wide */
    width: 100%;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* i literally have no idea why this is necessary but without it the centering breaks */
 */

pre.ascii-art {
    /* Forces the box to be exactly as wide as the text, no wider */
    width: fit-content; 
    width: -moz-fit-content; /* Firefox support */
    
    /* Pushes the shrink-wrapped box to the middle */
    margin-left: auto; 
    margin-right: auto;
    display: inline-block;
    
    white-space: pre;
    text-align: left; /* Keep the characters inside aligned to each other */
    overflow: hidden;
    margin-bottom: 2rem;
}

/* --- RESPONSIVE LOGIC --- */

/* DESKTOP RULES (Screens wider than 768px) */
@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: block;
        /* Tuned size for the Aperture logo */
        font-size: 0.55vw; 
        line-height: 0.8;
    }
}

/* MOBILE RULES (Screens smaller than 768px) */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block;
        font-size: 10px;
        line-height: 1;
    }
}

/* --- TYPING ANIMATION (JS CONTROLLED) --- */
.tagline-container {
    margin-bottom: 1rem;
    display: inline-block;
    font-family: 'Courier New', Courier, monospace;
}

/* The actual cursor block */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2rem;
    background-color: #ccd;
    margin-left: 5px;
    margin-bottom: -2px;
    
    /* Only the blinking is handled by CSS now */
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}


/* --- LINKS --- */
a {
    color: #fff;
    text-decoration: underline;
}
a:hover {
    color: #aaa;
    text-decoration: none;
}

::selection {
    background: #ccd; /* The background of the selection */
    color: #1a1a1a;   /* The text color inside the selection */
}

.barrel-roll {
    animation: spin 1s ease-in-out;
}

.barrel-roll-backwards {
    animation: spin-backwards 1s ease-in-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin-backwards {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

/* The class we will temporarily add to the body */
.flickering-overlay {
    animation: fluorescent-fail 2s linear forwards;
}

/* Invert satellite map during flicker */
.flickering-overlay .iss-module {
    animation: map-flicker 2s linear forwards;
}

@keyframes fluorescent-fail {
    0%   { background-color: #fff; color: #000; }   /* ON */
    10%  { background-color: #333; color: #ccd; }   /* OFF */
    20%  { background-color: #fff; color: #000; }   /* ON */
    30%  { background-color: #ccc; color: #000; }   /* DIM */
    40%  { background-color: #fff; color: #000; }   /* ON */
    50%  { background-color: #1a1a1a; color: #ccd; }/* OFF */
    60%  { background-color: #fff; color: #000; }   /* ON */
    70%  { background-color: #fff; color: #000; }   /* ON */
    75%  { background-color: #fff; color: #000; }   /* ON */
    80%  { background-color: #888; color: #222; }   /* DYING... */
    90%  { background-color: #fff; color: #000; }   
    100% { background-color: #1a1a1a; color: #ccd; } /* OFF */
}

@keyframes map-flicker {
    0%   { filter: invert(1); }   /* ON */
    10%  { filter: invert(0); }   /* OFF */
    20%  { filter: invert(1); }   /* ON */
    30%  { filter: invert(0.7); } /* DIM */
    40%  { filter: invert(1); }   /* ON */
    50%  { filter: invert(0); }   /* OFF */
    60%  { filter: invert(1); }   /* ON */
    70%  { filter: invert(1); }   /* ON */
    75%  { filter: invert(1); }   /* ON */
    80%  { filter: invert(0.5); } /* DYING... */
    90%  { filter: invert(1); }   
    100% { filter: invert(0); }   /* OFF */
}

/* Ticker Container (Hidden by default) */
.ticker-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px; /* Fixed height helps with alignment */
    overflow: hidden;
    background: #ccd; /* Inverted colors for "Alert" look */
    color: #1a1a1a;   
    z-index: 10;
    
    /* Hide it below the screen initially */
    transform: translateY(100%); 
    transition: transform 0.5s ease-out; /* Smooth pop-up */
}

/* The class JS will add to pop it up */
.ticker-wrap.active {
    transform: translateY(0);
}

/* The Text inside */
.ticker {
    display: inline-block;
    white-space: nowrap;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 1rem;
    line-height: 30px; /* Vertically centers text */
    
    /* Start completely off-screen to the right */
    position: absolute; 
    left: 100%; 
}

/* The Animation Class (We add this in JS) */
.scroll-across {
    animation: ticker-once 10s linear forwards; 
}

@keyframes ticker-once {
    0% { left: 100%; transform: translateX(0); }
    100% { left: 0; transform: translateX(-100%); }
}

.version-display {
    position: fixed;
    bottom: 10px;
    right: 15px;
    
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem; /* Tiny text */
    color: #444;       /* Very dim grey */
    
    z-index: 5; /* below ticker (which is z-index 10) */
    cursor: default;
    user-select: none;
}

/* Optional: Glow slightly on hover */
.version-display:hover {
    color: #ccd;
    text-shadow: 0 0 5px #ccd;
}

.iss-module {
    margin-top: 2rem;
    border: 1px solid #333;
    padding: 10px;
    display: inline-block;
    background: #0f0f0f;
}

.module-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    position: relative;
}

.title-text {
    flex: 1;
    text-align: center;
}

.collapse-btn {
    background: none;
    border: none;
    color: #888;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 5px;
    flex-shrink: 0;
}

.collapse-btn:hover {
    color: #ccd;
}

.iss-header {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
    text-align: left;
    display: flex;
    justify-content: space-between;
}

.iss-footer {
    font-size: 1rem;
    color: #444;
    margin-top: 0.5rem;
    text-align: right;
}

#sat-name {
    color: #ccd;
    font-weight: bold;
}

#ascii-map-display {
    margin: 0;
    color: #444; /* Dim background map */
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.15; /* Tweak this if lines look gappy */
    font-weight: bold;
    overflow: hidden;
    white-space: pre; /* Essential for ASCII alignment */
}

/* Make the satellites glow */
.sat-active {
    color: #fff;
    text-shadow: 0 0 5px #fff;
    background-color: #333;
}