:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --text-secondary: #a3a3a3;
    --accent-color: #3b82f6;
    --card-bg: #ffffff;
    --card-text: #000000;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

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

/* Scrollbar */
html::-webkit-scrollbar {
    width: 8px;
}
html::-webkit-scrollbar-track {
    background: var(--bg-color);
}
html::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
html::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Navigation */
.btn {
    position: fixed;
    width: 40px;
    height: 40px;
    filter: invert(1);
    right: 20px;
    top: 20px;
    z-index: 100;
    transition: 0.3s ease;
    cursor: pointer;
}
.btn img {
    width: 100%;
}

.navd {
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 300px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 90;
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    transform: translateX(100%);
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
}

.navd.active {
    transform: translateX(0);
}

.navd a {
    font-size: 1.5rem;
    font-family: var(--font-mono);
    text-decoration: none;
    color: #000;
    margin: 1rem 2rem;
    padding: 0.5rem 1rem;
    transition: 0.2s ease;
    border-radius: 4px;
}

.navd a:hover {
    background-color: #000;
    color: #fff;
    transform: translateX(10px);
}

/* Slider Animation */
.slider {
    width: 100%;
    height: 100vh;
    background-color: #000;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    animation: slideUp 1.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
    animation-delay: 0.5s;
}

@keyframes slideUp {
    to {
        transform: translateY(-100%);
    }
}

/* Sections */
section {
    min-height: 100vh;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #fff, #666);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.section-title.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.container {
    align-items: center;
    text-align: center;
}

.hero-content {
    z-index: 2;
    max-width: 800px;
}

.container h1 {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 1.8s;
}

.highlight {
    color: var(--accent-color);
}

.container h3 {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 2s;
}

.intropara {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 2.2s;
}

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

.gears {
    position: absolute;
    bottom: -10%;
    right: -10%;
    opacity: 0.3;
    pointer-events: none;
}

.gears img {
    width: 40vw;
    filter: invert(1);
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Education Section */
.cont2 {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    width: 100%;
    max-width: 1200px;
}

.edu-details {
    flex: 1;
}

.edu-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.edu-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.edu-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.edu-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.edu-card h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.edu-card .year {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-color);
}

.edu-image {
    flex: 1;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.edu-image.visible {
    opacity: 1;
    transform: translateX(0);
}

.edu-image img {
    width: 100%;
    border-radius: 12px;
    filter: grayscale(100%);
    transition: 0.5s;
}

.edu-image img:hover {
    filter: grayscale(0%);
}

/* Projects Section - PRESERVED HOVER EFFECTS */
.projects {
    align-items: center;
    height: auto;
    min-height: 100vh;
}

#projectpara {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    max-width: 800px;
}

.hover-instruction {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 3rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.cards {
    border: 1px solid rgba(255,255,255,0.2);
    width: 100%;
    max-width: 1400px;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 20px;
    padding: 3rem 3rem; /* Increased horizontal padding */
    margin: 0 auto; /* Center the container */
    transform-style: preserve-3d;
    transform: perspective(1000px);
    border-radius: 20px;
    background: rgba(255,255,255,0.02);
}

.card {
    border: none;
    margin: 0;
    width: 240px;
    min-width: 240px;
    height: 350px;
    text-align: left;
    background-color: var(--card-bg);
    color: var(--card-text);
    transition: 0.5s;
    filter: brightness(0);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    flex-shrink: 0;
}

/* CRITICAL HOVER EFFECTS */
.card:hover{
    filter: brightness(1);
    transform: translateZ(100px);
}

.card:hover + *{
    transform: translateZ(30px) rotateY(30deg);
    filter: brightness(0.3);
}
.card:hover + * + *{
    transform: translateZ(0px) rotateY(10deg);
    filter: brightness(0.08);
}

.card:has(+ *:hover){
    transform: translateZ(50px) rotateY(-30deg);
    filter: brightness(0.3);
}

.card:has(+ * + *:hover){
    transform: translateZ(0px) rotateY(-10deg);
    filter: brightness(0.08);
}

/* Card Content Styling */
.card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #000;
}

.tech-stack {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

.card p:not(.tech-stack) {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.4;
    flex-grow: 1;
}

.visit {
    margin-top: auto;
    background: #000;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
}

.visit:hover {
    background: var(--accent-color);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    width: 100%;
    justify-content: center;
    justify-items: center;
}

.skill-category {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
    width: 100%;
    max-width: 400px;
}

.skill-category.visible {
    opacity: 1;
    transform: translateY(0);
}

.skill-category:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.skill-category h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.skill-category p {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Socials */
.socials {
    text-align: center;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
}

.sicon {
    width: 60px;
    height: 60px;
    transition: 0.3s;
}

.sicon img {
    width: 100%;
    filter: invert(1);
    transition: 0.3s;
}

.sicon:hover {
    transform: scale(1.2);
}

/* .sicon:hover img {
    filter: invert(0.5) sepia(1) saturate(5) hue-rotate(190deg);
} */

.footer {
    margin-top: auto;
    padding: 2rem;
    color: #555;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .container h1 { font-size: 4rem; }
    .card { width: 45%; margin-bottom: 1rem; }
    /* Disable 3D hover on tablets/mobile as it's tricky */
    .cards { transform-style: flat; transform: none; }
    .card { filter: brightness(1); transform: none !important; }
    .card:hover { transform: translateY(-5px) !important; }
}

@media (max-width: 768px) {
    .container h1 { font-size: 3rem; }
    .cont2 { flex-direction: column; }
    .edu-image { display: none; }
    .card { width: 100%; }
    .navd { width: 100%; }
    .gears { display: none; }
}



.card a{
    text-decoration: none;
    color: inherit;
}

.card a button{
    display: flex;
    align-items: center;
    background: #000;
    color: #fff;
    border: none;
    padding: 0.2rem 1rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.25s;
    width: 100%;
    border: 3px solid transparent;
}

.card a button img{
    width: 40px;
    height: 40px;
    filter: invert(1);
    margin-right: 8px;
    transition: 0.25s;
}

.card a button:hover {
    background-color: white;
    color: black;
    border: 3px solid black;
}

.card a button:hover img{
    filter: invert(0);
}


.more_proj{
    margin-top: 2rem;
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--accent-color);
    text-decoration: none;
    padding: 0.2rem 0.3rem;
    border-radius: 6px;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;

}

.more_proj p{
    /* border: 1px solid var(--accent-color); */
    padding: 0.5em;
    margin-bottom: 0.5rem;
    font-size: 0.8em;
}

.viewmorebtn{
    position: relative;
    width: 150px;
    height: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
    perspective: 600px;
}

.top{
    width: 100%;
    height: 100%;
    background-color: rgb(255, 255, 255);
    font-family:var(--font-mono);
    font-size: 1.5em;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 25px;
    outline: 2px solid black;
    box-sizing: border-box;
    transition: 0.2s;
    overflow: hidden;
    transition-delay: 0.05s;
}


.bottom{
    width: 100%;
    height: 100%;
    background-color: rgb(150, 150, 150);
    font-family:var(--font-mono);
    font-size: 1.5em;
    color: black;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    justify-content: center;
    border-radius: 25px;
    outline: 2px solid black;
    position: absolute;
    top: 10px;
    left: 0;
    z-index: -1;
}

.bottom::after{
    content: "";
    width: 2px;
    height: 9px;
    background-color: black;
    position: absolute;
    bottom: 0;
    left: 85%
}

.bottom::before{
    content: "";
    width: 2px;
    height: 9px;
    background-color: black;
    position: absolute;
    bottom: 0;
    left: 15%
}

.viewmorebtn::before{
    content: "";
    width: calc(100% + 2px);
    height: 100%;
    background-color: rgb(171, 171, 171);
    border-radius: 20px;
    outline: 2px solid black;
    position: absolute;
    top: 14px;
    left: -1px;
    z-index: -2;
}

.viewmorebtn:active .top{
    transform: translateY(10px);
}

.top::before{
    content: "";
    width: 15px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.27);
    transform: skewX(30deg);
    transition: 0.25s;
    position: absolute;
    left: -20px;

}

.viewmorebtn:active .top::before{
    left: calc(100% + 20px);
}

.contact-subtext{
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-color);
    margin-top: 1rem;
}