/* ===== General ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 55px 0 0 0; /* top padding for banner */
    min-height: 100vh;
    background: radial-gradient(circle at top, #1a1035, #090a12 65%, #060608);
    color: #e8d9ff;
    font-family: 'Press Start 2P', cursive;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.25; /* increased for readability */
}

/* Scanline overlay */
.scan-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0.02),
        rgba(255,255,255,0.02) 1px,
        transparent 2px
    );
    pointer-events: none;
    animation: scan 6s linear infinite;
}
@keyframes scan { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }

/* Container */
.container { text-align: center; max-width: 600px; padding: 20px; }

/* Title */
.glow-text { display: block; font-weight: bold; color: #cfaeff; text-shadow: 0 0 12px #8b4dff, 0 0 25px #5d2bff; font-family: 'Press Start 2P', cursive; }
.glow-text .line1 { font-size: 1.55rem; display: block; line-height: 1.3; }
.glow-text .line2 { font-size: 1.9rem; display: block; line-height: 1.3; }

/* Subtext */
.subtext { font-size: 0.85rem; opacity: 0.8; margin-top: 10px; font-family: 'Press Start 2P', cursive; line-height: 1.25; }

/* EE:RR */
.rick-letter {
    cursor: pointer;
    display: inline-block;
    transition: transform 0.2s, text-shadow 0.2s;
}

.rick-letter:hover {
    transform: scale(1.1) rotate(-3deg);
    text-shadow: 0 0 8px #ff66cc, 0 0 16px #ff99ff;
}

/* Spinner */
.spinner {
    margin: 30px auto;
    width: 45px; height: 45px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top: 4px solid #b88cff;
    border-radius: 50%;
    animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Buttons ===== */
.buttons-container {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.resume-btn, .cert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 34px;
    line-height: 1.15; /* slightly increased */
    font-size: 0.95rem;
    border-radius: 6px;
    text-decoration: none;
    letter-spacing: 0.5px;
    box-shadow: 0 0 12px rgba(255,255,255,0.3);
    white-space: nowrap;
    transition: 0.25s;
    color: #fff;
    cursor: pointer;
    border: none;
    outline: none;
    font-family: 'Press Start 2P', cursive;
}

.resume-btn { background: linear-gradient(145deg, #5d2bff, #8d5bff); }
.resume-btn:hover { transform: translateY(-3px); box-shadow: 0 0 18px #8d5bffdd; }

.cert-btn { background: linear-gradient(145deg, #4b00ff, #7b4dff); }
.cert-btn:hover { transform: translateY(-3px); box-shadow: 0 0 18px #7b4dffdd; }

.resume-btn:focus, .cert-btn:focus { outline: none; box-shadow: 0 0 18px #7b4dffdd; }

/* Social links */
.social-links { margin-top: 28px; display: flex; justify-content: center; gap: 22px; font-family: 'Press Start 2P', cursive; line-height: 1.25; }
.social-links a { text-decoration: none; color: #d8c3ff; font-size: 0.95rem; transition: 0.25s; }
.social-links a:hover { color: #fff; text-shadow: 0 0 8px #ba8cff; transform: scale(1.1); }

/* Modal */
.modal {
    display: none;
    position: fixed; z-index: 1000;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex; justify-content: center; align-items: center;
}
.modal-content {
    position: relative;
    background-color: #1a1035;
    padding: 20px;
    border-radius: 8px;
    max-width: 90%; width: 600px;
    text-align: center;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    line-height: 1.25;
}

.modal-content h2 {
    font-size: 0.85rem; /* slightly smaller */
    font-family: 'Press Start 2P', cursive;
    margin-bottom: 15px;
}

.close-btn { position: absolute; top: 10px; right: 20px; font-size: 28px; cursor: pointer; color: #fff; }

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.cert-grid img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    border-radius: 6px;
    transition: transform 0.2s;

    /* === Added for readability of black text on badges === */
    background: rgba(255, 255, 255, 0.18);
    padding: 10px;
    backdrop-filter: blur(2px);
}
.cert-grid img:hover { transform: scale(1.05); }

/* Responsive buttons */
@media (max-width: 768px) { .resume-btn, .cert-btn { padding: 12px 28px; font-size: 0.85rem; } }
@media (max-width: 480px) { .resume-btn, .cert-btn { padding: 10px 20px; font-size: 0.8rem; } }

/* ===== Top Animated Banner ===== */
.top-banner {
    width: 100%;
    overflow: hidden;
    background-color: rgba(26, 16, 53, 0.8);
    backdrop-filter: blur(8px);
    color: #cfaeff;
    padding: 10px 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    border-bottom: 1px solid rgba(200,170,255,0.3);
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    box-shadow: 0 0 12px rgba(141,91,255,0.2);
}

.banner-text {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: #cfaeff;
    text-shadow: 0 0 10px #8b4dff, 0 0 20px #5d2bff, 0 0 30px #a57fff;
    
    animation: scroll-banner 12s linear infinite,
               glow-flicker 12s linear infinite;
}

@keyframes scroll-banner {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@keyframes glow-flicker {
    0%, 100%   { text-shadow: 0 0 12px #8b4dff, 0 0 25px #5d2bff, 0 0 40px #a57fff; opacity: 1; }
    2%   { text-shadow: 0 0 25px #cfaeff, 0 0 50px #8b4dff, 0 0 60px #a57fff; opacity: 0.9; }
    4%   { text-shadow: 0 0 15px #b88cff, 0 0 30px #5d2bff; opacity: 1; }
    6%   { text-shadow: 0 0 22px #cfaeff, 0 0 40px #8b4dff; opacity: 0.95; }
    8%   { text-shadow: 0 0 12px #8b4dff, 0 0 25px #5d2bff, 0 0 40px #a57fff; opacity: 1; }
    9%   { text-shadow: 0 0 10px #8b4dff, 0 0 20px #5d2bff; opacity: 1; }
}

/* Rick Roll container */
.rick-roll-container {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* 16:9 responsive frame */
    width: min(560px, 90vw);
    aspect-ratio: 16 / 9;

    background: rgba(0,0,0,0.85);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(255, 0, 120, 0.6);
    z-index: 99999;
    animation: fadeIn 0.4s ease-out;
}

.rick-roll-container video {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 8px;
    object-fit: contain; /* show full video inside frame */
    background: #000;    /* clean black letterbox if needed */
}

/* Fade-in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* Close button window (Rick Roll) */
.rick-close-btn {
    position: absolute;
    top: 6px;
    right: 8px;

    font-size: 20px;
    font-weight: normal;
    line-height: 1;

    color: #ffffff;
    background: none;
    border: none;
    padding: 0;
    margin: 0;

    cursor: pointer;
    z-index: 999999;
}

.rick-close-btn:hover {
    opacity: 0.8;
}

/* ===== CRT Glitch Overlay ===== */
.crt-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.1), rgba(0,0,0,1));
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 12000;
    opacity: 0;
}

.crt-active {
    animation: crtFlash 0.35s steps(2, end);
}

@keyframes crtFlash {
    0%   { opacity: 0; transform: scale(1, 1.02); }
    25%  { opacity: 1; }
    50%  { opacity: 0.4; }
    75%  { opacity: 1; }
    100% { opacity: 0; transform: scale(1, 1.0); }
}

/* ===== Terminal Overlay ===== */
.terminal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 13000;
    justify-content: center;
    align-items: center;
}

.terminal-window {
    background: #050608;
    border: 1px solid #33ff99;
    box-shadow: 0 0 20px rgba(0, 255, 150, 0.4);
    padding: 16px 18px 18px;
    max-width: 90vw;
    width: 600px;
    color: #33ff99;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.75rem;
    position: relative;
}

.terminal-header {
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #1a3f2a;
    opacity: 0.9;
}

.terminal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.terminal-line {
    margin: 4px 0;
    white-space: pre-wrap;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
    gap: 8px;
}

.terminal-input-line span {
    flex-shrink: 0;
}

#terminalInput {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid #33ff99;
    color: #33ff99;
    font-family: inherit;
    font-size: inherit;
    padding: 2px 0;
    outline: none;
}

.terminal-output {
    margin-top: 10px;
    max-height: 30vh;
    overflow-y: auto;
}

/* Terminal close button */
.terminal-close-btn {
    position: absolute;
    top: 6px;
    right: 8px;

    font-size: 16px;
    line-height: 1;
    color: #33ff99;
    cursor: pointer;
}

.terminal-close-btn:hover {
    opacity: 0.8;
}