/* Base Variables */
:root {
    --bg-color-main: #050505;
    --bg-color-alt: #0a0a0c;
    --text-color-main: #e0e0e0;
    --text-color-muted: #a0a0a0;

    /* Red Team Palette */
    --accent-light: #ff6b6b;
    --accent-main: #ff3333;
    --accent-dark: #cc0000;

    --font-main: 'Inter', sans-serif;
    --font-heading: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;

    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.2s ease;

    /* 3D Parallax Hover Card Easings */
    --hover-easing: cubic-bezier(0.23, 1, 0.32, 1);
    --return-easing: cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

/* Reset & Scaffolding */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color-main);
    color: var(--text-color-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 100px;
    /* Accounts for fixed footer */
}

/* Canvas Background */
#network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

/* Typography Utilities */
.font-space {
    font-family: var(--font-heading);
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-main) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Base style to ensure outline text works without gradient conflict */
.pixel-text-outline {
    font-family: var(--font-heading);
    color: transparent;
    -webkit-text-stroke: 1px var(--accent-main);
    text-shadow: 0 0 15px rgba(255, 51, 51, 0.3);
    letter-spacing: 2px;
    -webkit-text-fill-color: initial;
    text-transform: uppercase;
}

/* 
 * Sleek Cyber Effect for Titles
 */
.pixel-text {
    font-family: var(--font-heading);
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.4);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.carved-border {
    border: 1px solid rgba(255, 51, 51, 0.2);
    box-shadow:
        inset 1px 1px 3px rgba(0, 0, 0, 0.8),
        inset -1px -1px 2px rgba(255, 255, 255, 0.05),
        0 4px 6px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.carved-icon {
    filter: drop-shadow(1px 1px 1px rgba(255, 51, 51, 0.8)) drop-shadow(-1px -1px 1px rgba(0, 0, 0, 1));
    color: var(--accent-main);
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}


/* 
 * The "Liquid Glass" / Apple Glassmorphism Effect 
 */
.liquid-glass {
    background-color: rgba(10, 10, 12, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
}

.glass-card {
    border-radius: 16px;
    padding: 2rem;
}

.expertise-card {
    min-height: 600px;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.blur-backdrop {
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-box {
    padding: 0.2rem 0.5rem;
    display: flex;
    align-items: center;
    background: transparent;
}

.logo-image {
    height: 45px;
    width: auto;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo-box:hover .logo-image {
    animation: logoDestructure 0.2s infinite;
    filter: drop-shadow(0 0 12px var(--accent-main));
}

.header-logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 0;
    /* Override any span margins */
    transition: filter 0.3s ease;
}

.logo-box:hover .header-logo-text {
    filter: drop-shadow(0 0 8px var(--accent-main));
}

@media (max-width: 480px) {
    .header-logo-text {
        font-size: 1.1rem;
        /* Scale down on very small screens */
    }
}

@keyframes logoDestructure {
    0% {
        transform: translate(0) skew(0deg);
        clip-path: inset(0 0 0 0);
    }

    20% {
        transform: translate(-5px, 2px) skew(10deg);
        clip-path: inset(10% 0 70% 0);
        filter: drop-shadow(4px 0 var(--accent-light));
    }

    40% {
        transform: translate(5px, -2px) skew(-5deg);
        clip-path: inset(60% 0 10% 0);
        filter: drop-shadow(-4px 0 var(--accent-main));
    }

    60% {
        transform: translate(-2px, 5px) skew(20deg);
        clip-path: inset(30% 0 30% 0);
        opacity: 0.8;
    }

    80% {
        transform: translate(5px, 2px) skew(-10deg);
        clip-path: inset(45% 0 45% 0);
        filter: drop-shadow(2px 2px var(--accent-dark));
    }

    100% {
        transform: translate(0) skew(0deg);
        clip-path: inset(0 0 0 0);
    }
}

@keyframes neonFlicker {

    0%,
    18%,
    22%,
    25%,
    53%,
    57%,
    100% {
        opacity: 1;
    }

    20%,
    24%,
    55% {
        opacity: 0.7;
    }
}

.desktop-nav {
    display: none;
    /* Mobile first, hidden on small screens */
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-color-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--accent-main);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: rgba(255, 51, 51, 0.05);
    color: var(--accent-main);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 51, 51, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: rgba(255, 51, 51, 0.15);
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.3);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 6rem;
    /* Account for fixed header */
    position: relative;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-logo-container {
    margin-bottom: 1rem;
}

/* Organic animated background shape (Blob) */
.hero-content::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: -2rem;
    right: -2rem;
    bottom: -2rem;
    background: rgba(255, 51, 51, 0.05);
    box-shadow: 0 0 50px rgba(255, 51, 51, 0.1), inset 0 0 30px rgba(255, 51, 51, 0.15);
    border: 2px solid rgba(255, 51, 51, 0.3);
    z-index: -1;
    animation: blobBounce 8s infinite alternate ease-in-out;
}

@keyframes blobBounce {
    0% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: scale(1) rotate(0deg);
    }

    34% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
        transform: scale(1.05) rotate(5deg);
    }

    67% {
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
        transform: scale(0.95) rotate(-5deg);
    }

    100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: scale(1.02) rotate(2deg);
    }
}

.hero-logo {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 51, 51, 0.6));
    /* Stronger fade effect on the edges */
    -webkit-mask-image: radial-gradient(circle, black 10%, transparent 50%);
    mask-image: radial-gradient(circle, black 10%, transparent 90%);
    position: relative;
    z-index: 1;
}

.main-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.slogan {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--accent-main);
    margin-bottom: 2rem;
    font-style: italic;
}

.hero-description {
    font-size: 1rem;
    color: var(--text-color-muted);
    margin-bottom: 2.5rem;
}

/* Marquee Section */
.marquee-section {
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 51, 51, 0.1);
    border-bottom: 1px solid rgba(255, 51, 51, 0.1);
    background: rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

a.glass-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.2) !important;
    border-color: rgba(255, 51, 51, 0.4);
}

.marquee {
    display: flex;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.marquee-content {
    display: flex;
    animation: scroll 40s linear infinite;
    align-items: center;
}

.marquee span {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--accent-light);
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.marquee .dot {
    margin: 0 1.5rem;
    color: var(--text-color-muted);
    opacity: 0.5;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Expertise Section */
.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* 3D Parallax Hover Cards */
.parallax-card-wrap {
    transform: perspective(1200px);
    transform-style: preserve-3d;
    cursor: pointer;
}

.parallax-card-wrap:hover .parallax-card-info {
    transform: translateY(0);
}

.parallax-card-wrap:hover .parallax-card-info p {
    opacity: 1;
}

.parallax-card-wrap:hover .parallax-card-info,
.parallax-card-wrap:hover .parallax-card-info p {
    transition: 0.6s var(--hover-easing);
}

.parallax-card-wrap:hover .parallax-card-bg {
    transition: 0.5s var(--hover-easing), opacity 4s var(--hover-easing);
    opacity: 0.8;
}

.parallax-card-wrap:hover .parallax-card {
    transition: 0.5s var(--hover-easing);
    box-shadow: 0 0 40px rgba(255, 51, 51, 0.3);
    /* Red Team glow */
    border-color: rgba(255, 51, 51, 0.6);
}

.parallax-card {
    position: relative;
    width: 100%;
    height: 320px;
    background-color: var(--bg-color-main);
    overflow: hidden;
    transition: 0.8s var(--return-easing);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.parallax-card-bg {
    opacity: 0.4;
    position: absolute;
    top: -30px;
    left: -30px;
    bottom: -30px;
    right: -30px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    transition: 0.8s var(--return-easing), opacity 4s 0.8s var(--return-easing);
    pointer-events: none;
    z-index: 0;
}

.parallax-card-info {
    padding: 2rem;
    position: relative;
    z-index: 10;
    color: #fff;
    transform: translateY(70%);
    transition: 0.6s 1.6s cubic-bezier(0.215, 0.61, 0.355, 1);
    background: linear-gradient(to top, rgba(5, 5, 5, 0.98) 0%, rgba(5, 5, 5, 0.85) 60%, transparent 100%);
}

.parallax-card-info h3 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0 0 15px rgba(0, 0, 0, 1), 0 0 25px rgba(255, 51, 51, 0.6);
}

.parallax-card-info p {
    opacity: 0;
    text-shadow: rgba(0, 0, 0, 1) 0 2px 3px;
    transition: 0.6s 1.6s cubic-bezier(0.215, 0.61, 0.355, 1);
    margin-top: 10px;
}

.card {
    border-radius: 12px;
    padding: 2rem;
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.expertise-block {
    margin-bottom: 15vh;
    /* Adds scroll separation only for expertise cards */
}

.expertise-block:not(:first-child) {
    margin-top: 10vh;
    /* Pushes the next cards further down so they don't overlap too quickly */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(255, 51, 51, 0.15);
    border-color: rgba(255, 51, 51, 0.3);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color-main);
}

.card-text {
    color: var(--text-color-muted);
    font-size: 0.95rem;
}

/* About Section */
.about-content {
    position: relative;
    overflow: hidden;
    text-align: center;
}

.about-text {
    font-size: 1.1rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.about-text strong {
    color: var(--accent-main);
    font-weight: 600;
}

.map-overlay {
    position: relative;
    height: 200px;
    width: 100%;
    margin: 0 auto;
    border: 1px solid rgba(255, 51, 51, 0.1);
    border-radius: 8px;
    background: radial-gradient(circle at center, rgba(255, 51, 51, 0.05) 0%, transparent 70%);
}

.node {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent-main);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--accent-main);
    z-index: 2;
    cursor: pointer;
}

.node::after {
    content: attr(title);
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-color-main);
    white-space: nowrap;
    opacity: 0.7;
    pointer-events: none;
}

.pulse {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 51, 51, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 51, 51, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 51, 51, 0);
    }
}

.connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.tech-line {
    stroke: rgba(255, 51, 51, 0.3);
    stroke-width: 1.5;
    stroke-dasharray: 5, 5;
    animation: dash 20s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: 100;
    }
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    background: rgba(5, 5, 5, 0.85);
    /* Ensure it has a backdrop when scrolling over content */
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.copyright {
    color: var(--text-color-muted);
    font-size: 0.85rem;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Media Queries (Tablet and Desktop) */
@media (min-width: 768px) {
    .main-title {
        font-size: 3.5rem;
    }

    .slogan {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 1.15rem;
    }

    .desktop-nav {
        display: flex;
    }

    .grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .map-overlay {
        height: 300px;
    }
}

/* Profile Image */
.profile-img {
    float: left;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 2rem 1rem 0;
    shape-outside: circle(50%);
    shape-margin: 1.5rem;
    border: 3px solid var(--accent-main);
    box-shadow: 0 0 30px rgba(255, 51, 51, 0.3);
    filter: drop-shadow(0 0 15px rgba(255, 51, 51, 0.5));
    position: relative;
    z-index: 1;
    animation: breathe-red 4s infinite alternate ease-in-out;
}

@keyframes breathe-red {
    0% {
        box-shadow: 0 0 20px rgba(255, 51, 51, 0.2);
        filter: drop-shadow(0 0 10px rgba(255, 51, 51, 0.3));
    }

    100% {
        box-shadow: 0 0 50px rgba(255, 51, 51, 0.6), inset 0 0 20px rgba(255, 51, 51, 0.2);
        filter: drop-shadow(0 0 30px rgba(255, 51, 51, 0.8));
    }
}

@media (max-width: 768px) {
    .profile-img {
        float: none;
        display: block;
        margin: 0 auto 1.5rem auto;
    }
}

/* Interactive Card Matrix Beam Effect (Evervault/Blacklead inspired) */
.card-ascii {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    background: rgba(0, 0, 0, 0.9);
    -webkit-mask-image: radial-gradient(circle 120px at var(--mouseX, 50%) var(--mouseY, 50%), black 0%, transparent 100%);
    mask-image: radial-gradient(circle 120px at var(--mouseX, 50%) var(--mouseY, 50%), black 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.expertise-image:hover .card-ascii {
    opacity: 1;
}

.ascii-content {
    color: var(--accent-main);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 14px;
    white-space: pre-wrap;
    word-break: break-all;
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
    text-shadow: 0 0 5px var(--accent-main);
}