:root {
    --bg-color: #0a0a0a;
    --card-bg: #1a1a1a;
    --card-bg-hover: #252525;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #00ff9d;
    --accent-secondary: #7000ff;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --card-bg-hover: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent-color: #00cc7d;
    --accent-secondary: #6200ea;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    width: 100%;
    max-width: 1200px;
    position: relative;
    z-index: 1;
}

#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.1;
    pointer-events: none;
}

/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 1.5rem;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

h1,
h2,
h3 {
    font-weight: 800;
    margin-bottom: 1rem;
}

.icon {
    margin-right: 0.5rem;
}

/* Profile Card */
.profile-card {
    grid-column: span 2;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.profile-header {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.profile-img-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-color);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tagline {
    font-family: var(--font-mono);
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.bio {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    width: fit-content;
    margin-top: 1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 157, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 157, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 157, 0);
    }
}

/* Skills Card */
.skills-card {
    grid-column: span 1;
    grid-row: span 2;
}

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: border-color 0.3s;
}

.tag:hover {
    border-color: var(--accent-color);
}

/* Languages Card */
.languages-card {
    grid-column: span 1;
    grid-row: span 2;
}

.tech-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tech-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tech-name {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    opacity: 0.9;
}

/* Projects Card */
.projects-card {
    grid-column: span 2;
    grid-row: span 1;
    display: flex;
    flex-direction: column;
    max-height: 450px;
    /* Fixed height */
}

/* Projects Grid (Scrollable Area) */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    /* Responsive Grid */
    gap: 1rem;
    margin-top: 1rem;
    overflow-y: auto;
    padding-right: 5px;
    flex-grow: 1;
}

/* Custom Scrollbar for Projects */
.projects-grid::-webkit-scrollbar {
    width: 6px;
}

.projects-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.projects-grid::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
    opacity: 0.5;
}

.projects-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* Collapsed Project Items (Grid Card Style) */
.project-item.collapsed {
    min-height: 120px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 16px;
    transition: all 0.3s ease;
    text-align: center;
}

.project-item.collapsed .project-icon {
    display: block;
    /* Show Icon */
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.project-item.collapsed .project-details p {
    display: none;
    /* Hide Description */
}

.project-item.collapsed .project-details h3 {
    margin: 0;
    font-size: 0.85rem;
    white-space: normal;
    /* Allow wrapping */
    line-height: 1.2;
}

.project-item.collapsed:hover {
    background: var(--card-bg-hover);
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

/* Expanded Project Items (Reveal Animation) */
.project-item.reveal-anim {
    animation: revealItem 0.5s ease forwards;
}

@keyframes revealItem {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Experience Badge */
.exp-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    border: 1px solid var(--card-border);
}

.exp-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-secondary);
    line-height: 1;
}

.exp-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Socials Card */
.social-card {
    grid-column: span 1;
    grid-row: span 1;
    background: var(--accent-secondary);
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.social-btn {
    text-decoration: none;
    color: white;
    font-weight: 600;
    padding: 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s;
    text-align: center;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Location Card */
.location-card {
    grid-column: span 1;
    grid-row: span 1;
    background: linear-gradient(135deg, #ff0080, #7928ca);
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.location-content h3 {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.location-content p {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

/* Digital Clock */
.clock-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: inline-block;
}

.digital-clock {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    position: relative;
}

.digital-clock::before,
.digital-clock::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    /* Fix for text overlay */
}

.digital-clock::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.digital-clock::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(30px, 9999px, 10px, 0);
    }

    5% {
        clip: rect(85px, 9999px, 81px, 0);
    }

    10% {
        clip: rect(60px, 9999px, 21px, 0);
    }

    15% {
        clip: rect(4px, 9999px, 96px, 0);
    }

    20% {
        clip: rect(18px, 9999px, 56px, 0);
    }

    25% {
        clip: rect(93px, 9999px, 29px, 0);
    }

    30% {
        clip: rect(46px, 9999px, 16px, 0);
    }

    35% {
        clip: rect(7px, 9999px, 73px, 0);
    }

    40% {
        clip: rect(35px, 9999px, 53px, 0);
    }

    45% {
        clip: rect(59px, 9999px, 94px, 0);
    }

    50% {
        clip: rect(2px, 9999px, 26px, 0);
    }

    55% {
        clip: rect(81px, 9999px, 2px, 0);
    }

    60% {
        clip: rect(14px, 9999px, 69px, 0);
    }

    65% {
        clip: rect(52px, 9999px, 41px, 0);
    }

    70% {
        clip: rect(28px, 9999px, 87px, 0);
    }

    75% {
        clip: rect(96px, 9999px, 3px, 0);
    }

    80% {
        clip: rect(63px, 9999px, 19px, 0);
    }

    85% {
        clip: rect(10px, 9999px, 58px, 0);
    }

    90% {
        clip: rect(42px, 9999px, 34px, 0);
    }

    95% {
        clip: rect(76px, 9999px, 91px, 0);
    }

    100% {
        clip: rect(23px, 9999px, 12px, 0);
    }
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--card-bg);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    z-index: 100;
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-card {
        grid-column: span 2;
    }

    .projects-card {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .profile-card,
    .skills-card,
    .languages-card,
    .projects-card,
    .social-card,
    .location-card {
        grid-column: span 1;
        grid-row: auto;
    }
}

/* Sword Animation Styles */
.sword-toggle-container {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.sword-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}

.sword-toggle-container:hover .sword-wrapper {
    transform: rotate(-45deg);
}

.sword {
    position: relative;
    width: 4px;
    height: 30px;
    background: #ccc;
    /* Blade */
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.sword::before {
    /* Point */
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
    border-bottom: 4px solid #ccc;
}

.pommel {
    position: absolute;
    bottom: -4px;
    left: -2px;
    width: 8px;
    height: 8px;
    background: #444;
    border-radius: 50%;
}

.grip {
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 4px;
    height: 10px;
    background: #8b4513;
}

.guard {
    position: absolute;
    bottom: 14px;
    left: -6px;
    width: 16px;
    height: 4px;
    background: #444;
    border-radius: 2px;
}

.sword-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.sword-toggle-container:hover .sword-label {
    color: var(--accent-color);
}

.sword-toggle-container.active .sword-wrapper {
    transform: rotate(135deg);
}

/* Fire Particles */
.fire-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.fire-particles span {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #ff4500;
    border-radius: 50%;
    opacity: 0;
    animation: fire-rise 1s infinite;
}

.fire-particles span:nth-child(1) {
    animation-delay: 0s;
    left: 40%;
}

.fire-particles span:nth-child(2) {
    animation-delay: 0.2s;
    left: 60%;
}

.fire-particles span:nth-child(3) {
    animation-delay: 0.4s;
    left: 45%;
}

.fire-particles span:nth-child(4) {
    animation-delay: 0.6s;
    left: 55%;
}

.fire-particles span:nth-child(5) {
    animation-delay: 0.8s;
    left: 50%;
}

@keyframes fire-rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-20px) scale(0);
        opacity: 0;
    }
}