/* ---------------- GLOBAL FIXES ---------------- */
* {
    box-sizing: border-box;
    max-width: 100%;
}

html, body {
    overflow-x: hidden;
}

/* ---------------- BASE STYLES ---------------- */
body {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    background-color: black;
    color: #00FF00;
    scroll-behavior: smooth;
    transition: all 0.3s ease;
}

main {
    padding: 2em;
}

/* ---------------- HEADER & NAV ---------------- */
header {
    position: sticky;
    top: 0;
    background-color: #000;
    padding: 0.5em 1em;
    z-index: 1000;
    border-bottom: 1px solid #00ff00;

    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
}

nav a,
.toggle-crt {
    color: #00FF00;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
}

nav a:hover {
    text-decoration: underline;
}

/* AI NOTE FIXED IN HEADER */
.ai-note {
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    color: #00ff00;
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.85;
    white-space: nowrap;
}

.ai-note a {
    color: #00ff00;
    text-decoration: none;
}

.ai-note a:hover {
    text-decoration: underline;
}

.ai-note::after {
    content: '_';
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ---------------- SCREEN & CRT EFFECT ---------------- */
#crt-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    mix-blend-mode: overlay;
    transition: opacity 0.3s ease-in-out;
    background: repeating-linear-gradient(
            to bottom,
            rgba(0, 255, 0, 0.05),
            rgba(0, 255, 0, 0.05) 2px,
            transparent 2px,
            transparent 4px
    );
}

body.crt-active {
    text-shadow: 0 0 5px #0f0, 0 0 10px #0f0, 0 0 20px #0f0;
    animation: flicker 0.15s infinite;
    filter: contrast(1.2) brightness(0.9);
}

body.crt-active #crt-overlay {
    opacity: 1;
}

.screen {
    border-radius: 20px;
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(0,255,0,0.02) 0%, transparent 80%);
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.3);
    padding: 2em;
    transition: all 0.3s ease;
}

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

/* ---------------- ABOUT ME ---------------- */
.about-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2em;
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(0, 255, 0, 0.03);
    border-radius: 12px;
    border: 1px solid #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.1);
}

@media (min-width: 700px) {
    .about-section {
        flex-direction: row;
    }
}

.about-text {
    flex: 1 1 60%;
    line-height: 1.6;
}

.about-text h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.about-text p {
    font-size: 1rem;
    line-height: 1.6;
}

.about-photo {
    flex: 1 1 35%;
}

.about-photo img {
    width: 100%;
    height: auto;
    border: 2px solid #00ff00;
    border-radius: 8px;
    display: block;
}

/* ---------------- PROJECTS ---------------- */
.highlighted-projects {
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid #00ff00;
    border-radius: 12px;
    padding: 2em;
    max-width: 1100px;
    margin: 4rem auto;
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.3);
}

.highlighted-projects h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.highlighted-projects .subtitle {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 2rem;
    opacity: 0.8;
}

/* Project cards grid */
.projects-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 600px) {
    .projects-list {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

.project-card {
    background: rgba(0, 255, 0, 0.02);
    border: 1px solid #00ff00;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px #00ff00;
}

.project-card h2 a {
    font-size: 1.3rem;
    color: #00ff00;
    text-decoration: underline;
}

.project-card p {
    margin-top: 0.5rem;
    font-size: 1rem;
}

/* Tag filters */
.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0 2rem;
}

.tag-btn {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.tag-btn:hover {
    background: #00ff00;
    color: black;
}

.tag-btn.active {
    background: #00ff00;
    color: black;
    font-weight: bold;
}

/* Tags inside project cards */
.tag-list {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    border: 1px solid #00ff00;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0.9;
}

.tag:hover {
    background: rgba(0, 255, 0, 0.2);
}

/* Hide filtered out projects */
.project-card.hidden {
    display: none;
}

/* ---------------- INDIVIDUAL PROJECT PAGE ---------------- */
.project-page {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

.project-page h1 {
    color: #00ff00;
    margin-bottom: 1rem;
}

.project-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 2rem auto;
    border: 2px solid #00ff00;
    border-radius: 8px;
}

/* Code blocks */
pre, code {
    text-shadow: none !important;
    filter: none !important;
    animation: none !important;
    color: #00ff88 !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    border-radius: 6px;
    padding: 1rem;
    line-height: 1.4;
    overflow-x: auto;
}

p code {
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    color: #00ffaa !important;
    font-size: 0.9rem;
}

/* Image grid inside project pages */
.image-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 600px) {
    .image-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

.image-grid img {
    width: 100%;
    height: auto;
    border: 1px solid #00ff00;
    border-radius: 6px;
}

.back-link {
    color: #00ff00;
    text-decoration: underline;
    display: inline-block;
    margin-top: 2rem;
}

/* ---------------- CONTACT SECTION ---------------- */
#contact {
    background: rgba(0, 255, 0, 0.03);
    border: 1px solid #00ff00;
    border-radius: 12px;
    padding: 2em;
    max-width: 800px;
    margin: 4rem auto;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    text-align: center;
}

#contact h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

#contact p, #contact a {
    font-size: 1rem;
    color: #00ff00;
    text-decoration: underline;
    display: block;
    margin: 0.5rem 0;
}

#contact a:hover {
    color: black;
    background: #00ff00;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

/* Additional project-page layout tweaks */
.project-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 3rem 0;
    align-items: start;
}

@media (min-width: 900px) {
    .project-section {
        grid-template-columns: 1fr 1fr;
    }
}

.project-section img {
    width: 100%;
    height: auto;
    border: 2px solid #00ff00;
    border-radius: 8px;
    display: block;
}

.project-section h3 {
    color: #00ff00;
    margin-bottom: 0.5rem;
}

.project-section p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

pre {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.github-link {
    display: inline-block;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border: 1px solid #00ff00;
    border-radius: 6px;
    text-decoration: none;
    color: #00ff00;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
}

.github-link:hover {
    background: #00ff00;
    color: black;
}
/* ---------------- MOBILE FIXES FOR CODE + IMAGES + TEXT ---------------- */

/* Force code blocks to wrap and scroll instead of pushing layout wider */
pre, code {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    max-width: 100%;
}

/* Handle long lines inside <pre> */
pre {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Images scale properly, even inside grid/flex */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent text from stretching layout */
p, li, h1, h2, h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

