/* --- VARIABLES & BASE --- */
:root {
    --primary: #00f5ff;
    --secondary: #7c3aed;
    --accent: #ff00ff;
    --bg-color: #030712;
    --surface: rgba(255, 255, 255, 0.03);
    --glass: rgba(0, 245, 255, 0.05);
    --glass-border: rgba(0, 245, 255, 0.2);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Three.js Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary), 0 0 20px var(--primary);
    z-index: 10000;
    transition: width 0.1s ease-out;
    pointer-events: none;
}

/* --- BOOT OVERLAY (ACCESS GRANTED) --- */
#boot-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bootFadeOut 0.6s ease-in-out 2.5s forwards;
    pointer-events: none;
}

.boot-content {
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 40px 60px;
    border: 1px solid var(--primary);
    box-shadow: 0 0 40px var(--primary), inset 0 0 40px rgba(0, 245, 255, 0.05);
}

.boot-scanline {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 245, 255, 0.6);
    animation: scanSweep 2.5s linear forwards;
    box-shadow: 0 0 20px var(--primary);
}

.boot-initializing {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    animation: bootTextIn 0.3s ease 0.2s both;
    margin-bottom: 20px;
}

.boot-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary), 0 0 60px var(--primary);
    letter-spacing: 6px;
    animation: bootTextIn 0.5s ease 0.6s both;
    margin-bottom: 10px;
}

.boot-sub {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
    letter-spacing: 8px;
    animation: bootTextIn 0.5s ease 1.0s both;
}

@keyframes bootFadeOut {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.05); visibility: hidden; }
}

@keyframes scanSweep {
    0%   { top: -5%; }
    100% { top: 105%; }
}

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

/* --- WARP CANVAS --- */
#warp-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#warp-canvas.active {
    opacity: 1;
}

/* --- GLITCH TELEPORT SECTION ENTRY --- */
@keyframes teleportIn {
    0%   { opacity: 0; transform: translateY(30px) scaleX(1.02); filter: brightness(3) blur(4px); }
    30%  { opacity: 0.6; filter: brightness(2) blur(2px); }
    60%  { opacity: 0.9; transform: translateY(-5px) scaleX(1); filter: brightness(1.5) blur(0px); }
    100% { opacity: 1; transform: translateY(0) scaleX(1); filter: brightness(1) blur(0); }
}

.teleport-in {
    animation: teleportIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* CRT Scanlines Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1));
    background-size: 100% 4px;
    z-index: 9998; /* Just below cursor */
    pointer-events: none;
    opacity: 0.6;
}

/* --- TYPOGRAPHY & UTILS --- */
h1,
h2,
h3,
h4,
.nav-logo {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section {
    padding: 100px 5%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-title {
    font-size: clamp(1.4rem, 5.5vw, 2.5rem);
    margin-bottom: 2.5rem;
    color: var(--primary);
    text-shadow: 0 0 12px rgba(0, 245, 255, 0.4);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.section-title span {
    color: var(--accent);
    flex-shrink: 0;
}

.glass-panel {
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    will-change: transform;
}

.glass-panel:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.2);
    transform: translateY(-3px);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-heading);
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.primary-btn {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    box-shadow: 0 0 10px inset transparent, 0 0 10px transparent;
}

.primary-btn:hover {
    background: var(--primary);
    color: var(--bg-color);
    box-shadow: 0 0 15px inset var(--primary), 0 0 15px var(--primary);
}

.secondary-btn {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.secondary-btn:hover {
    background: var(--accent);
    color: var(--bg-color);
    box-shadow: 0 0 15px inset var(--accent), 0 0 15px var(--accent);
}

.coming-soon {
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    margin-top: 1rem;
    opacity: 0.8;
}

.center-text {
    text-align: center;
}

/* --- NAVIGATION --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-logo {
    font-size: 1.5rem;
    color: var(--primary);
    text-shadow: 0 0 5px var(--primary);
    font-weight: 700;
    animation: neonFlicker 6s infinite;
}

@keyframes neonFlicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 0 0 8px var(--primary), 0 0 20px var(--primary), 0 0 40px var(--primary);
        opacity: 1;
    }
    20%, 24%, 55% {
        text-shadow: none;
        opacity: 0.3;
    }
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links li a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-family: var(--font-heading);
    transition: color 0.3s;
}

.nav-links li a:hover {
    color: var(--primary);
    text-shadow: 0 0 5px var(--primary);
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    padding-top: 120px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    height: 100%;
}

.hero-text-container {
    flex: 1;
}

.glitch {
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--text-main);
    position: relative;
    text-shadow: 0.05em 0 0 var(--accent), -0.025em -0.05em 0 var(--primary),
        0.025em 0.05em 0 var(--secondary);
    animation: glitch 500ms infinite;
    margin-bottom: 10px;
}

.typewriter-container {
    font-size: 1.5rem;
    color: var(--primary);
    font-family: var(--font-heading);
    margin-bottom: 20px;
    height: 30px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.hero-socials {
    display: flex;
    gap: 20px;
}

.hero-socials a {
    color: var(--text-main);
    font-size: 1.5rem;
    transition: all 0.3s;
}

.hero-socials a:hover {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
    transform: scale(1.1);
}

.hero-image-container {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    border: 2px solid var(--primary);
}

.glowing-ring {
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: conic-gradient(from 0deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 4px;
    animation: rotate 4s linear infinite, pulseGlow 2s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px var(--primary), inset 0 0 10px var(--primary); }
    100% { box-shadow: 0 0 30px var(--accent), inset 0 0 30px var(--accent); }
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--primary);
    opacity: 0.7;
}

.scroll-line {
    width: 2px;
    height: 50px;
    background: linear-gradient(transparent, var(--primary));
    animation: scroll 2s infinite;
}

/* --- ABOUT SECTION --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    align-items: center;
}

/* About image frame */
.about-img-frame {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 20px auto;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(0, 245, 255, 0.25),
        0 0 30px rgba(0, 245, 255, 0.12),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.about-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 12px;
    transition: transform 0.5s ease;
}

.about-img-frame:hover .about-img {
    transform: scale(1.04);
}

/* Bottom gradient fade */
.about-img-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 35%;
    background: linear-gradient(to top, rgba(3, 7, 18, 0.85) 0%, transparent 100%);
    border-radius: 0 0 12px 12px;
    pointer-events: none;
}

/* Animated scan line */
.about-img-scan {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(0, 245, 255, 0.04) 50%,
        transparent 100%);
    animation: imgScan 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes imgScan {
    0%   { top: -40%; }
    100% { top: 110%; }
}

/* Corner bracket decorators */
.about-img-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 2;
    pointer-events: none;
}
.about-img-corner.tl { top: 8px;    left: 8px;    border-top: 2px solid var(--primary); border-left: 2px solid var(--primary); }
.about-img-corner.tr { top: 8px;    right: 8px;   border-top: 2px solid var(--primary); border-right: 2px solid var(--primary); }
.about-img-corner.bl { bottom: 8px; left: 8px;    border-bottom: 2px solid var(--primary); border-left: 2px solid var(--primary); }
.about-img-corner.br { bottom: 8px; right: 8px;   border-bottom: 2px solid var(--primary); border-right: 2px solid var(--primary); }


.about-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 2.5rem;
    font-family: var(--font-heading);
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.about-text h3 {
    margin-bottom: 20px;
    color: var(--text-main);
}

.status-online {
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
}

.about-text p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.highlight-text {
    font-style: italic;
    color: var(--primary);
    border-left: 3px solid var(--primary);
    padding-left: 15px;
    margin: 20px 0;
}

/* --- PROJECTS SECTION --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.project-card {
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.project-thumb {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 245, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.project-overlay span {
    background: var(--bg-color);
    padding: 8px 16px;
    font-family: var(--font-heading);
    border: 1px solid var(--primary);
    color: var(--primary);
}

.project-card:hover .project-thumb img {
    transform: scale(1.1);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

/* RGB Glitch on Hover */
.project-card:hover .project-thumb img,
.event-card:hover .event-images img,
.cert-card:hover img {
    animation: rgbGlitch 0.3s ease-out;
}

@keyframes rgbGlitch {
    0% { filter: drop-shadow(4px 0 0 rgba(255,0,0,0.8)) drop-shadow(-4px 0 0 rgba(0,255,255,0.8)); transform: translateX(-2px); }
    20% { filter: drop-shadow(-4px 0 0 rgba(255,0,0,0.8)) drop-shadow(4px 0 0 rgba(0,255,255,0.8)); transform: translateX(2px); }
    40% { filter: drop-shadow(2px 0 0 rgba(255,0,0,0.8)) drop-shadow(-2px 0 0 rgba(0,255,255,0.8)); transform: translateX(-1px); }
    60% { filter: drop-shadow(-2px 0 0 rgba(255,0,0,0.8)) drop-shadow(2px 0 0 rgba(0,255,255,0.8)); transform: translateX(1px); }
    80% { filter: drop-shadow(1px 0 0 rgba(255,0,0,0.8)) drop-shadow(-1px 0 0 rgba(0,255,255,0.8)); transform: translateX(0); }
    100% { filter: drop-shadow(0 0 0 transparent); transform: translateX(0); }
}

.project-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    margin-bottom: 10px;
    color: var(--primary);
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
    flex: 1;
}

.live-badge {
    align-self: flex-start;
    font-size: 0.7rem;
    background: rgba(0, 255, 0, 0.1);
    color: #0f0;
    border: 1px solid #0f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--font-heading);
}

/* --- SKILLS SECTION --- */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.skill-category h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--secondary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tags span {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.skill-tags span:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 245, 255, 0.1);
}

/* --- EXPERIENCE SECTION --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
}

.timeline-dot {
    position: absolute;
    left: -46px;
    top: 20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.exp-header h3 {
    color: var(--primary);
    font-size: 1.2rem;
}

.exp-company {
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

.exp-images {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    padding-bottom: 5px;
}

.exp-images img {
    height: 80px;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s;
    cursor: zoom-in;
    position: relative;
    z-index: 1;
    transform-origin: center;
}

.exp-images img:hover,
.exp-images img:active {
    transform: scale(2.5);
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.timeline-item:has(.exp-images img:hover),
.timeline-item:has(.exp-images img:active) {
    z-index: 20;
}

.grid-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.timeline-end {
    padding-top: 20px;
}

/* --- CERTIFICATIONS SECTION --- */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    justify-content: center;
}

.cert-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.cert-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 245, 255, 0.15);
}

.cert-card img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: transform 0.5s ease;
}

.cert-card:hover img {
    transform: scale(1.06);
}

.cert-info h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.cert-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.small-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* --- EVENTS SECTION --- */
.event-carousel-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.event-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

.event-images {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-images img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.event-images img.extra-img {
    display: none;
    margin-top: 15px;
}

.event-images.show-all img.extra-img {
    display: block;
    animation: fadeIn 0.5s ease forwards;
}

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

.event-details h3 {
    color: var(--primary);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.event-meta {
    display: block;
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.event-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    white-space: pre-line;
}

.event-desc.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-family: var(--font-heading);
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.read-more-btn:hover {
    text-decoration: underline;
}

/* --- CONTACT SECTION --- */
.contact-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-info {
    margin-bottom: 40px;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 25px;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.social-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-heading);
    transition: all 0.3s;
}

.social-box:hover {
    background: rgba(0, 245, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

footer {
    margin-top: 80px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: rgba(3, 7, 18, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.modal-content {
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
    min-height: 100vh;
    position: relative;
    padding: 80px 5%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    animation: slideUp 0.4s ease-out;
}

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

.close-modal {
    position: fixed;
    top: 20px;
    right: 30px;
    color: var(--primary);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: var(--accent);
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.8);
}

/* Modal body specifics injected via JS */
.modal-gallery {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 35px;
}

.modal-gallery img {
    height: 350px; /* Made gallery images larger for full screen */
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.modal-text h2 {
    color: var(--primary);
    margin-bottom: 25px;
    font-size: 2.5rem;
}

.modal-text h3 {
    color: var(--accent);
    margin-top: 35px;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.modal-text h4 {
    color: var(--primary);
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.modal-text p {
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.7;
    font-size: 1.05rem;
}

.modal-text ul {
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-left: 20px;
    line-height: 1.7;
    font-size: 1.05rem;
}

.modal-text li {
    margin-bottom: 8px;
}

.modal-text strong {
    color: #ffffff;
}

/* --- ANIMATIONS --- */
@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 var(--accent), -0.025em -0.05em 0 var(--primary), 0.025em 0.05em 0 var(--secondary);
    }

    14% {
        text-shadow: 0.05em 0 0 var(--accent), -0.025em -0.05em 0 var(--primary), 0.025em 0.05em 0 var(--secondary);
    }

    15% {
        text-shadow: -0.05em -0.025em 0 var(--accent), 0.025em 0.025em 0 var(--primary), -0.05em -0.05em 0 var(--secondary);
    }

    49% {
        text-shadow: -0.05em -0.025em 0 var(--accent), 0.025em 0.025em 0 var(--primary), -0.05em -0.05em 0 var(--secondary);
    }

    50% {
        text-shadow: 0.025em 0.05em 0 var(--accent), 0.05em 0 0 var(--primary), 0 -0.05em 0 var(--secondary);
    }

    99% {
        text-shadow: 0.025em 0.05em 0 var(--accent), 0.05em 0 0 var(--primary), 0 -0.05em 0 var(--secondary);
    }

    100% {
        text-shadow: -0.025em 0 0 var(--accent), -0.025em -0.025em 0 var(--primary), -0.025em -0.05em 0 var(--secondary);
    }
}

@keyframes rotate {
    100% {
        transform: rotate(1turn);
    }
}

@keyframes scroll {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }

    50.1% {
        transform: scaleY(1);
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .hero {
        padding-top: 90px;
        min-height: 100vh;
        justify-content: center;
        align-items: center;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }

    .hero-image-container {
        margin-top: 0;
        width: 220px;
        height: 220px;
        flex: none;
    }

    .hero-buttons,
    .hero-socials {
        justify-content: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .event-card {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(3, 7, 18, 0.95);
        flex-direction: column;
        padding: 20px;
        text-align: center;
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    /* Section titles: stack // above the title text on mobile
       Each item is on its own line = no overflow possible */
    .section-title {
        flex-direction: column;
        gap: 0px;
        font-size: clamp(1.3rem, 5.5vw, 2rem);
        letter-spacing: 1px;
        white-space: normal;
    }

    .section-title span {
        font-size: 0.85em;
        margin-bottom: 2px;
    }

    .glitch {
        font-size: 2.6rem;
    }

    .hero-image {
        width: 180px;
        height: 180px;
    }

    .glowing-ring {
        width: 210px;
        height: 210px;
    }
}

@media (max-width: 768px) {
    .hero-image {
        width: 160px;
        height: 160px;
    }
    .glowing-ring {
        width: 180px;
        height: 180px;
    }
    .glitch { font-size: 2.2rem; }
    .section { padding: 80px 5%; }

    /* Boot overlay: prevent it from overflowing or wrapping weirdly on phone screens */
    .boot-content {
        padding: 24px 14px;
        width: 92vw;
        max-width: 480px;
        box-sizing: border-box;
    }

    .boot-title {
        font-size: clamp(0.95rem, 5.2vw, 1.8rem);
        letter-spacing: 2px;
        white-space: nowrap;
        word-break: normal;
    }

    .boot-sub {
        font-size: clamp(0.55rem, 3vw, 0.75rem);
        letter-spacing: 3px;
        white-space: nowrap;
    }

    .boot-initializing {
        font-size: clamp(0.55rem, 2.8vw, 0.7rem);
        letter-spacing: 2px;
        white-space: nowrap;
    }
}

@media (max-width: 420px) {
    .boot-content {
        padding: 20px 10px;
        width: 95vw;
    }

    .boot-title {
        font-size: clamp(0.8rem, 4.6vw, 1.2rem);
        letter-spacing: 1px;
    }

    .boot-sub {
        font-size: 0.55rem;
        letter-spacing: 2px;
    }

    .boot-initializing {
        font-size: 0.52rem;
        letter-spacing: 1.5px;
    }
}

/* --- CUSTOM SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px; /* For horizontal scrollbars like the gallery */
}

::-webkit-scrollbar-track {
    background: rgba(3, 7, 18, 0.9);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary); /* Cyan futuristic color */
    border-radius: 4px;
    box-shadow: 0 0 10px var(--primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent); /* Pinkish on hover */
    box-shadow: 0 0 15px var(--accent);
}
/* --- CUSTOM CURSOR --- */
body {
    cursor: none;
}
a, button, input, .project-card, .event-card, .cert-card, .close-modal {
    cursor: none !important;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    position: fixed;
    border-radius: 50%;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 999999;
    box-shadow: 0 0 10px var(--primary), 0 0 20px var(--primary);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.cursor-outline {
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--accent);
    position: fixed;
    border-radius: 50%;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 999998;
}

.cursor-hover .cursor-dot {
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
}

.cursor-hover .cursor-outline {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 0, 102, 0.1);
    border-color: var(--primary);
    transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
}

@media (max-width: 768px) {
    .cursor-dot, .cursor-outline { display: none !important; }
    body, a, button, .project-card, .event-card, .cert-card, .close-modal { cursor: auto !important; }
    
    /* Make grids stack vertically properly on extremely small screens */
    .project-grid, .cert-grid {
        grid-template-columns: 1fr;
    }
    
    /* Modal layout for mobile */
    .modal-content {
        padding: 40px 15px;
    }
    
    .modal-gallery img {
        height: 250px;
    }
    
    .event-card {
        grid-template-columns: 1fr;
    }
    
    /* Adjust typography for mobile — prominent bold cyber headers on 1 single line */
    .section-title {
        font-size: clamp(1.25rem, 5.2vw, 1.75rem) !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        align-items: center !important;
    }
}
