/* smooth scroll + navbar offset */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

section {
    scroll-margin-top: 90px;
}

/* Animation Initial States */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

/* State when active (scrolled into view) */
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delay for the grid cards */
.about-grid .reveal:nth-child(2) {
    transition-delay: 0.2s;
}

.system-stack-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.system-stack-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
/* Matrix Canvas Background */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;   /* Force viewport width */
    height: 100vh;  /* Force viewport height */
    z-index: -1;
    opacity: 0.15;
    pointer-events: none; /* Allows user to click "through" the animation */
    display: block;
}

/* Preloader Styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Fira Code', monospace;
}

.loader-terminal {
    color: #00ffb4;
    width: 300px;
}

.load-cmd {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #00ffb4;
    animation: typing 1s steps(30, end), blink-caret 0.5s step-end infinite;
}

.progress-bar {
    width: 100%;
    height: 2px;
    background: rgba(0, 255, 180, 0.1);
    margin-top: 15px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #00ffb4;
    animation: fillProgress 2s forwards;
}

@keyframes fillProgress {
    to { width: 100%; }
}

@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: #00ffb4 } }
/* ===== SYSTEM VARIABLES & RESET ===== */
:root {
    --bg-color: #050505;
    --terminal-green: #00ff9d;
    --system-blue: #00d4ff;
    --text-dim: #a0a0a0;
    --grid-color: rgba(0, 255, 157, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    background: var(--bg-color);
    color: white;
    overflow-x: hidden;
    /* Custom cursor works best on desktop; hidden on mobile via media query below */
}

/* ===== GLOBAL TECH GRID ===== */
.tech-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: clamp(20px, 5vw, 40px) clamp(20px, 5vw, 40px);
}

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

nav a {
    margin-left: clamp(10px, 2vw, 20px);
    color: var(--terminal-green);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== HERO SECTION (System Design Theme) ===== */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    min-height: 100vh;
    padding: 80px 8%;
}
.hero-content {
    flex: 1;
    z-index: 2;
}

/* tablet */
@media (min-width: 768px) {
    .hero {
        grid-template-columns: 1.2fr 1fr;
        padding: 120px 60px;
    }
}


/* Typography with Clamp for Responsiveness */
.hero-name {
    font-size: clamp(2.2rem, 8vw, 4.5rem);
    margin: 10px 0;
    font-weight: 900;
    text-transform: uppercase;
}

.hero-role {
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    line-height: 1.1;
    margin: 20px 0;
    border-left: 4px solid var(--system-blue);
    padding-left: 15px;
    color: #fff;
}

.neon {
    color: var(--terminal-green);
    text-shadow: 0 0 15px rgba(0, 255, 157, 0.4);
}

.system-status {
    font-size: 0.75rem;
    color: var(--terminal-green);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.status-dot {
    height: 8px;
    width: 8px;
    background-color: var(--terminal-green);
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    animation: blink 1.5s infinite;
    box-shadow: 0 0 8px var(--terminal-green);
}

.terminal-bio {
    background: rgba(255, 255, 255, 0.03);
    padding: clamp(15px, 3vw, 25px);
    border: 1px solid var(--border-color);
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    line-height: 1.6;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto; /* Center on mobile */
}

@media (min-width: 992px) {
    .terminal-bio { margin: 0; }
}

/* ===== PROFILE IMAGE & BLUEPRINT FRAME ===== */
.image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.profile-img {
     width: 420px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;

    border-radius: 18px;
    border: 1px solid #00ffaa33;

    margin: auto;
}


.frame-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--terminal-green);
    z-index: 2;
}

.top-left { top: 0; left: 0; border-right: none; border-bottom: none; }
.bottom-right { bottom: 0; right: 0; border-left: none; border-top: none; }

/* ===== BUTTONS & INTERACTABLES ===== */
.btn-system {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 30px;
    border: 1px solid var(--terminal-green);
    color: var(--terminal-green);
    text-decoration: none;
    font-weight: bold;
    letter-spacing: 1px;
    transition: 0.3s ease;
    background: transparent;
}

.btn-system:hover {
    background: var(--terminal-green);
    color: var(--bg-color);
    box-shadow: 0 0 25px rgba(0, 255, 157, 0.5);
}

/* ===== CURSOR (Hidden on touch devices) ===== */
@media (hover: none) and (pointer: coarse) {
    body { cursor: auto; }
    .cursor-dot, .cursor-ring { display: none; }
}

.cursor-dot {
    width: 6px; height: 6px;
    background: var(--terminal-green);
    position: fixed; border-radius: 50%;
    pointer-events: none; z-index: 9999;
}

.cursor-ring {
    width: 30px; height: 30px;
    border: 1px solid var(--terminal-green);
        opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    position: fixed; border-radius: 50%;
    pointer-events: none; z-index: 9998;
    transition: transform 0.1s ease-out;
}


/* show only on devices with mouse */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: none;
    }
}

/* ---------------------------------------------------updated css after skills------------------------------------------- */

/* ======================================================
   GLOBAL RESET
====================================================== */

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

img {
    max-width: 100%;
    display: block;
}

:root {
    --accent: #00ffb4;
    --card-bg: rgba(0,255,170,0.04);
    --card-border: rgba(0,255,170,0.25);
    --card-hover: #00ffb4;
}



/* ======================================================
   ANIMATIONS
====================================================== */

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



/* ======================================================
   SECTION BASE
====================================================== */

.skills-section {
    padding: 80px 20px;
    margin-top: 80px;
}

.section-title {
    color: var(--accent);
    margin-bottom: 40px;
    letter-spacing: 2px;
    font-size: 20px;
}



/* ======================================================
   RESPONSIVE GRID (MOBILE FIRST)
====================================================== */

.skills-grid {
    display: grid;
    gap: 20px;
    align-items: stretch;

    /* Define the grid template */
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
}

/* tablet */
@media (min-width: 768px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* desktop */
@media (min-width: 1200px) {
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}



/* ======================================================
   CARDS
====================================================== */

.skill-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 22px;
    border-radius: 12px;
height: 100%; /* Force card to fill the grid cell */
    backdrop-filter: blur(6px);

    transition: 0.25s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--card-hover);
}

.skill-card h3 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 16px;
}

.skill-card p {
    line-height: 1.6;
    opacity: 0.9;
    font-size: 14px;
}



/* ======================================================
   TITLE + ICON LAYOUT
====================================================== */

.skill-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}



/* ======================================================
   ICON BASE (GitHub + LeetCode)
====================================================== */

.github-icon,
.leetcode-icon {
    position: relative;

    width: 20px;
    height: 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.github-icon img,
.leetcode-icon img {
    width: 20px;
    height: 20px;

    filter: invert(1);

    transition: transform 0.25s ease, filter 0.25s ease;
}



/* glow only for devices that support hover */
@media (hover: hover) {

    .github-icon:hover img,
    .leetcode-icon:hover img {
        transform: scale(1.2);
        filter: invert(1) drop-shadow(0 0 6px var(--accent));
    }
}



/* ======================================================
   POPUP CARDS (DESKTOP ONLY)
====================================================== */

.github-popup,
.leetcode-popup {
    position: absolute;

    top: -95px;
    left: 50%;
    transform: translate(-50%, 8px);

    width: 170px;
    padding: 10px;

    background: #0b0f12;
    border: 1px solid var(--accent);
    border-radius: 6px;

    font-size: 12px;
    text-align: center;

    opacity: 0;
    pointer-events: none;

    transition: 0.25s ease;

    z-index: 100;
}

/* show only on hover-capable devices */
@media (hover: hover) {

    .github-icon:hover .github-popup,
    .leetcode-icon:hover .leetcode-popup {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* completely disable on touch devices */
@media (hover: none) {
    .github-popup,
    .leetcode-popup {
        display: none !important;
    }
}



/* ======================================================
   SMALL UTILITIES
====================================================== */

.leetcode-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card {
    border: 1px solid rgba(255,255,255,0.08);
    padding: 20px;
    background: rgba(255,255,255,0.02);
    transition: 0.3s;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}


/* //=====================ABOUT ME=================================================== */
/* --- Global Section Management --- */
#about, #education {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px; /* Reduced from 80px to pull sections closer */
    width: 100%;
}

.section-title {
    margin-bottom: 25px; /* Tighter gap between title and content */
}

/* --- About Grid --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px; /* Reduced gap */
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .about-grid {
        grid-template-columns: 1.5fr 1fr;
    }
}

/* --- Shared Terminal Box Style --- */
.education-box {
    width: 100%;
    background: rgba(0, 255, 170, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px; /* Tighter internal padding */
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.education-box.verbose {
    max-width: 900px; /* Centered verbose box */
}

/* --- Commands & Text --- */
.command {
    color: var(--accent);
    font-family: 'Fira Code', monospace;
    font-weight: bold;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
}

.command::before {
    content: "➜ ";
    opacity: 0.6;
}

.bio-block {
    margin-bottom: 15px;
}

.bio-block p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
}

/* --- List Management --- */
.edu-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.edu-list li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    position: relative;
}

/* For the simple list in About Me */
.mini .edu-list li {
    padding-left: 15px;
}
.mini .edu-list li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* --- Verbose Section Details --- */
.timestamp {
    color: var(--accent);
    opacity: 0.5;
    font-family: monospace;
    font-size: 11px;
    min-width: 95px;
}

.edu-text {
    flex-grow: 1;
}

.status-tag {
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid rgba(0, 255, 180, 0.3);
    border-radius: 4px;
    color: var(--accent);
    margin-left: 10px;
}

.system-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 255, 180, 0.1);
    font-family: monospace;
    font-size: 11px;
    display: flex;
}

.system-footer .label { opacity: 0.4; margin-right: 5px; }
.system-footer .val { margin-right: 20px; }

@keyframes blink {
    50% { opacity: 0.5; }
}
.pulse { animation: blink 2s infinite; }

/* 
//===========================image hero styles=============================================== */

/* ======================================================
   HERO SCROLL ANIMATION EFFECT
   ====================================================== */

/* smooth GPU animation */
#heroText,
#heroImage {
    transition:
        transform 0.15s linear,
        opacity 0.15s linear,
        filter 0.15s linear;

    will-change: transform, opacity, filter;
}

/* optional smoother feeling */
.hero {
    overflow: hidden;
}
/* ======================================================
   MOBILE BREAKPOINT
   ====================================================== */

@media (max-width: 768px) {

    .hero {
        flex-direction: column;   /* stack vertically */
        text-align: center;
        padding-top: 120px;
        gap: 40px;
    }

    .hero-content {
        order: 1;
    }

    .image-container {
        order: 2;
        width: 100%;
    }

    .profile-img {
        width: 85%;
        max-width: 320px;
    }

    /* smaller fonts for mobile */
    .hero-name {
        font-size: 34px;
    }

    .hero-role {
        font-size: 22px;
    }

    .hero-summary {
        font-size: 14px;
    }

    /* buttons stacked nicely */
    .cta-group {
        flex-direction: column;
        gap: 14px;
        align-items: center;
    }
}



/* ======================================================
   FOOTER (Cyber Terminal Style)
   ====================================================== */
/* =====================================================
   FOOTER STYLES (PRO TERMINAL LOOK)
===================================================== */
.footer {
    margin-top: 80px;
    padding: 40px 20px 20px;
    border-top: 1px solid rgba(0,255,180,0.25);
    background: rgba(0,255,180,0.03);
    backdrop-filter: blur(10px);
    font-family: 'Courier New', monospace;
    color: #fff;
}

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

/* Terminal, clock, contact */
.footer-terminal,
.footer-worldclock,
.footer-contact {
    font-size: 14px;
    line-height: 1.6;
}

/* Highlight text */
.footer .highlight {
    color: #00ffb4;
    font-weight: bold;
}

/* World clock spacing */
.clock-list p {
    margin-bottom: 4px;
    opacity: 0.9;
}

/* Contact form */
.footer-contact form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-contact input,
.footer-contact textarea {
    background: transparent;
    border: 1px solid rgba(0,255,180,0.3);
    padding: 6px;
    color: white;
    font-size: 13px;
}

.footer-contact textarea {
    min-height: 70px;
}

.footer-contact button {
    background: #00ffb4;
    border: none;
    color: black;
    padding: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.footer-contact button:hover {
    background: transparent;
    color: #00ffb4;
    border: 1px solid #00ffb4;
}

/* Footer nav links */
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-nav .footer-link {
    text-decoration: none;
    color: #00ffb4;
    font-size: 14px;
    transition: 0.3s;
}

.footer-nav .footer-link:hover {
    text-decoration: underline;
}

/* Social icons compact */
.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid rgba(0,255,180,0.3);
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    color: #00ffb4;
    transition: all 0.3s;
}

.social-btn img {
    width: 16px;
    height: 16px;
    filter: invert(1);
    transition: transform 0.3s;
}

.social-btn:hover {
    border-color: #00ffb4;
    box-shadow: 0 0 6px #00ffb4;
    transform: translateY(-2px);
}

.social-btn:hover img {
    transform: scale(1.1);
}

/* Footer bottom */
.footer-bottom {
    text-align: center;
    margin-top: 30px;
    font-size: 12px;
    opacity: 0.6;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .social-btn {
        justify-content: center;
        width: 100%;
    }
    .footer-nav {
        justify-content: center;
    }
}

/* ======================================================
   GLOBAL RESPONSIVE FIX (MOBILE + TABLET PATCH ONLY)
   DO NOT MODIFY DESKTOP
====================================================== */

/* prevent horizontal scroll / zoom gap */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}


/* ==============================
   TABLET
============================== */
@media (max-width: 1024px) {

    /* reduce side padding */
    section,
    .skills-section,
    .footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* hero tighter */
    .hero {
        gap: 30px;
    }

    /* prevent large image overflow */
    .profile-img {
        width: 100%;
        max-width: 340px;
    }
}


/* ==============================
   MOBILE (phones)
============================== */
@media (max-width: 768px) {

    /* fix zoom spacing */
    body {
        font-size: 14px;
    }

    /* NAV */
    nav {
        padding: 14px 16px;
    }

    nav a {
        font-size: 12px;
        margin-left: 12px;
    }


    /* HERO STACK */
    .hero {
        flex-direction: column;
        padding: 110px 18px 40px;
        gap: 30px;
        text-align: center;
    }

    .hero-content,
    .image-container {
        width: 100%;
    }

    .profile-img {
        width: 90%;
        max-width: 280px;
    }


    /* SKILLS GRID → single column */
    .skills-grid {
        grid-template-columns: 1fr !important;
    }

    .skill-card {
        padding: 18px;
    }


    /* ABOUT GRID */
    .about-grid {
        grid-template-columns: 1fr;
    }


    /* FOOTER */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }

    .social-btn {
        width: 100%;
        justify-content: center;
    }


    /* reduce big typography */
    .hero-name {
        font-size: 28px;
    }

    .hero-role {
        font-size: 18px;
    }
}


/* ==============================
   VERY SMALL DEVICES (<400px)
============================== */
@media (max-width: 400px) {

    .hero-name {
        font-size: 24px;
    }

    .profile-img {
        max-width: 240px;
    }

    nav a {
        font-size: 11px;
    }
}
/* ======================================================
   PROJECTS SECTION – FORCE HORIZONTAL LAYOUT
   (only for project cards, does not affect skills)
   ====================================================== */

.projects-grid {
    display: grid;
    gap: 24px;

    /* Desktop → horizontal 3 cards */
    grid-template-columns: repeat(3, 1fr);

    align-items: stretch;
}

/* Tablet */
@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* make project cards equal height */
.projects-grid .skill-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}






/* ===== 3 COLUMN HORIZONTAL LAYOUT ===== */
.about-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}


/* cards */
.bio-card {
    padding: 25px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.45);
    border-radius: 14px;
    min-height: 260px;
}


/* terminal list */
.terminal-list {
    list-style: none;
    padding-left: 0;
    margin-top: 12px;
}

.terminal-list li {
    margin-bottom: 8px;
}

.terminal-list li::before {
    content: "› ";
    color: var(--terminal-green);
}


/* MOBILE STACK */
@media (max-width: 1000px) {
    .about-grid-3 {
        grid-template-columns: 1fr;
    }
}
