/*
 * Custom CSS for Nazmul Hasan's Portfolio
 * Theme: Comic Book & Space Aesthetics
 */

/* ==================== Comic & Space Typography ==================== */
@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Press+Start+2P&display=swap');

body {
    font-family: 'Press Start 2P', monospace;
}

h1, h2 {
    font-family: 'Bangers', cursive;
}

/* ==================== Glitch Effect for Title ==================== */
.glitch {
    position: relative;
    color: #fff;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    overflow: hidden;
    clip: rect(0, 900px, 0, 0);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(25px, 900px, 60px, 0); }
    10% { clip: rect(100px, 900px, 80px, 0); }
    20% { clip: rect(10px, 900px, 40px, 0); }
    30% { clip: rect(70px, 900px, 90px, 0); }
    40% { clip: rect(50px, 900px, 30px, 0); }
    50% { clip: rect(80px, 900px, 10px, 0); }
    60% { clip: rect(20px, 900px, 50px, 0); }
    70% { clip: rect(90px, 900px, 100px, 0); }
    80% { clip: rect(40px, 900px, 70px, 0); }
    90% { clip: rect(60px, 900px, 25px, 0); }
    100% { clip: rect(0, 900px, 0, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(100px, 900px, 80px, 0); }
    15% { clip: rect(25px, 900px, 60px, 0); }
    30% { clip: rect(70px, 900px, 90px, 0); }
    45% { clip: rect(10px, 900px, 40px, 0); }
    60% { clip: rect(80px, 900px, 10px, 0); }
    75% { clip: rect(50px, 900px, 30px, 0); }
    90% { clip: rect(20px, 900px, 50px, 0); }
    100% { clip: rect(90px, 900px, 100px, 0); }
}


/* ==================== Comic Button & Pulse Animation ==================== */
.comic-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: #fca311;
    color: #1a1a1a;
    font-weight: bold;
    text-transform: uppercase;
    border: 3px solid #1a1a1a;
    border-radius: 8px;
    box-shadow: 6px 6px 0px #1a1a1a;
    transition: all 0.2s ease-in-out;
}

.comic-btn:hover {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0px #1a1a1a;
    background-color: #ffb700;
}

.comic-btn:active {
    transform: translate(6px, 6px);
    box-shadow: 0px 0px 0px #1a1a1a;
}

.pulse {
    animation: pulse-anim 1.5s infinite ease-in-out;
}

@keyframes pulse-anim {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Download Button Style */
.comic-btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: #fca311;
    color: #1a1a1a;
    font-weight: bold;
    text-transform: uppercase;
    border: 3px solid #1a1a1a;
    border-radius: 8px;
    box-shadow: 4px 4px 0px #1a1a1a;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}
.comic-btn-download:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #1a1a1a;
}
.comic-btn-download:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px #1a1a1a;
}
.comic-download-icon {
    margin-right: 0.5rem;
}


/* ==================== Comic Panel & Speech Bubble Styles ==================== */
.comic-panel {
    position: relative;
    border: 4px solid #fff;
    border-radius: 12px;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.4);
    background-color: rgba(0, 0, 0, 0.6);
    padding: 2rem;
    transition: transform 0.3s ease-in-out;
}

.comic-panel:hover {
    transform: translateY(-5px);
}

.comic-panel-title {
    position: relative;
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: #fca311;
    color: #1a1a1a;
    border: 3px solid #1a1a1a;
    border-radius: 8px;
    box-shadow: 4px 4px 0px #1a1a1a;
    text-shadow: 2px 2px 0px #fff;
}

.comic-bubble {
    position: relative;
    background: #fca311;
    border-radius: .4em;
    padding: 1rem;
    color: #1a1a1a;
    font-weight: bold;
}

.comic-bubble:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 0;
    border: 1.25rem solid transparent;
    border-top-color: #fca311;
    border-bottom: 0;
    border-left: 0;
    margin-left: -0.625rem;
    margin-bottom: -1.25rem;
}

/* New: Comic Page Grid for Gallery */
.comic-page-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    border: 4px solid #fff;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.4);
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.6);
}

.comic-panel-image {
    position: relative;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: 8px;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.3);
}

.comic-panel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.comic-panel-image:hover img {
    transform: scale(1.05);
}

.comic-caption {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background-color: #1a1a1a;
    color: #fca311;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    border: 1px solid #fca311;
    border-radius: 4px;
    text-transform: uppercase;
}

/* ==================== General Styles & Animations ==================== */
html {
    scroll-behavior: smooth;
}

body {
    background-color: #0d0d0d;
    background-image:
        radial-gradient(circle, #2a2a2a 1px, transparent 1px),
        radial-gradient(circle, #2a2a2a 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
}

/* Scroll Animation for Navbar */
.navbar-scrolled {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

/* Smooth Scroll for Anchors */
a {
    transition: color 0.3s ease-in-out;
}

/* Image Hover Effect */
img:hover {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Placeholder for the Three.js canvas */
#starfield {
    display: block;
    width: 100%;
    height: 100%;
}