:root {
    --thm-bg: #0a0a0a; /* Dark background */
    --thm-bg-dark: #1a1a1a; /* Darker background for cards */
    --thm-bg-hover: #242424; /* For card hover */
    --thm-fg: #e0e0e0; /* Light text */
    --thm-green: #00ff9d; /* Vibrant green accent */
    --thm-yellow: #ffd700; /* Gold accent */
    --thm-blue: #00bfff; /* Bright blue accent */
    --thm-purple: #bf00ff; /* Purple accent */
    --thm-red: #ff4d4d; /* Red accent */
    --thm-pink: #ff007f; /* Pink accent */
    --thm-orange: #ff9500; /* Orange accent */
    --thm-gray: #a0a0a0; /* Gray for secondary text */
    --thm-border: #333333; /* Border color for cards */
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* Light Theme Variables */
body.light-theme {
    --thm-bg: #f5f5f5;
    --thm-bg-dark: #ffffff; /* Cards are white */
    --thm-bg-hover: #f0f0f0;
    --thm-fg: #333333;
    --thm-green: #00cc7a;
    --thm-yellow: #ccac00;
    --thm-blue: #0099cc;
    --thm-purple: #9900cc;
    --thm-red: #cc3d3d;
    --thm-pink: #cc0066;
    --thm-orange: #cc7a00;
    --thm-gray: #555555;
    --thm-border: #dddddd;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* Universal Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base Styles */
html {
    background: var(--thm-bg);
    color: var(--thm-fg);
    font-family: 'JetBrains Mono', monospace;
    scroll-behavior: smooth;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body {
    background: var(--thm-bg);
    color: var(--thm-fg);
    font-family: 'JetBrains Mono', monospace;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Container */
.container {
    max-width: 960px;
    width: 90%;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

/* Profile Card */
.profile-card {
    background: var(--thm-bg-dark);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    animation: fadeInScaleUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    width: 100%;
    border: 1px solid var(--thm-border);
}

/* Profile Picture */
.profile-pic {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.profile-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 4px solid var(--thm-green);
    object-fit: cover;
    box-shadow: 0 0 15px 5px rgba(0, 255, 157, 0.4);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.profile-img:hover {
    transform: scale(1.08);
    box-shadow: 0 0 25px 10px rgba(0, 255, 157, 0.6);
}

.profile-img[alt] {
    font-size: 0.9rem;
    color: var(--thm-gray);
    text-align: center;
    line-height: 152px;
    background-color: var(--thm-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}


/* Headings and Alias */
h1 {
    font-size: 2.2rem;
    text-align: center;
    margin: 0.5rem 0 0.25rem;
    color: var(--thm-fg);
    font-weight: 600;
}

.alias {
    text-align: center;
    color: var(--thm-gray);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Typing Bio */
.typing-bio-container {
    min-height: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.typing-bio {
    font-size: 1.1rem;
    color: var(--thm-green);
    text-align: center;
}

.bio-line {
    white-space: nowrap;
    display: block;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    line-height: 1.4;
}

.bio-line:nth-child(1) { animation-delay: 0s; }
.bio-line:nth-child(2) { animation-delay: 0.3s; }


@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

.typing-cursor {
    display: inline-block;
    width: 9px;
    height: 1.1rem;
    background: var(--thm-green);
    animation: blink 0.7s infinite;
    vertical-align: middle;
    margin-left: 3px;
}

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

/* Terminal Box */
.terminal-box {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    border: 1px solid #333;
}

.terminal-header {
    background: #2a2a2a;
    padding: 0.6rem 0.8rem;
    display: flex;
    align-items: center;
}

.terminal-controls {
    display: flex;
    gap: 0.5rem;
}

.control {
    width: 13px;
    height: 13px;
    border-radius: 50%;
}

.red { background: #ff605c; }
.yellow { background: #ffbd44; }
.green { background: #00ca4e; }

.terminal-title {
    color: var(--thm-gray);
    font-size: 0.9rem;
    margin-left: 1rem;
    font-weight: 500;
}

.terminal-body {
    padding: 1rem 1.2rem;
    font-size: 0.95rem;
    color: #e0e0e0;
    max-height: 150px;
    overflow-y: auto;
    line-height: 1.5;
}

.terminal-line {
    margin: 0.4rem 0;
    word-break: break-all;
}

.prompt {
    color: var(--thm-green);
    margin-right: 0.6rem;
}

/* Gruvbox Colors */
.gruv-yellow { color: var(--thm-yellow); }
.gruv-green { color: var(--thm-green); }
.gruv-purple { color: var(--thm-purple); }
.gruv-red { color: var(--thm-red); }
.gruv-blue { color: var(--thm-blue); }
.gruv-pink { color: var(--thm-pink); }
.gruv-orange { color: var(--thm-orange); }


/* Buttons */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.gruv-button {
    background: transparent;
    color: var(--thm-fg);
    border: 1.5px solid var(--thm-gray);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
}

.gruv-button i {
    transition: transform 0.3s ease;
    font-size: 0.95em;
}

.gruv-button:hover {
    background: var(--thm-gray);
    color: var(--thm-bg);
    transform: translateY(-3px) scale(1.02);
    border-color: var(--thm-gray);
    box-shadow: 0 4px 10px rgba(160, 160, 160, 0.3);
}

.gruv-button:hover i {
    transform: rotate(-5deg) scale(1.1);
}

.gruv-button.active {
    background: var(--thm-green);
    color: var(--thm-bg-dark) !important;
    border-color: var(--thm-green);
    box-shadow: 0 2px 8px rgba(0, 255, 157, 0.4);
}
.gruv-button.active:hover {
    background: var(--thm-green);
    color: var(--thm-bg-dark) !important;
    box-shadow: 0 4px 12px rgba(0, 255, 157, 0.6);
}


/* Sections */
.section {
    display: none;
    opacity: 0;
    margin-top: 2rem;
}

.section.visible {
    display: block;
    animation: fadeInSlideUp 0.6s ease-out forwards;
}

.section-header {
    font-size: 1.8rem;
    color: var(--thm-blue);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--thm-blue);
    border-radius: 2px;
}


/* Filter Buttons */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-btn {
    background: var(--thm-bg-dark);
    color: var(--thm-fg);
    border: 1.5px solid var(--thm-gray);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease, border-color 0.3s ease, box-shadow 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-btn:hover {
    background: var(--thm-gray);
    color: var(--thm-bg);
    transform: translateY(-2px);
    border-color: var(--thm-gray);
    box-shadow: 0 3px 8px rgba(160, 160, 160, 0.25);
}

.filter-btn.active {
    background: var(--thm-green);
    color: var(--thm-bg-dark);
    border-color: var(--thm-green);
    box-shadow: 0 2px 6px rgba(0, 255, 157, 0.3);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--thm-bg-dark);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid var(--thm-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUpItem 0.5s ease-out forwards;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--thm-green);
}

.project-title {
    font-size: 1.3rem;
    color: var(--thm-green);
    margin: 0 0 0.75rem 0;
    font-weight: 600;
}

.project-description-github {
    color: var(--thm-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.project-readme-content {
    color: var(--thm-fg);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid var(--thm-border);
    padding-top: 1rem;
    margin-top: 1rem;
}

.project-readme-content h1, .project-readme-content h2, .project-readme-content h3 {
    color: var(--thm-blue);
    margin-top: 0.8rem;
    margin-bottom: 0.4rem;
    font-size: 1.1em;
}
.project-readme-content h1 { font-size: 1.2em; }
.project-readme-content p { margin-bottom: 0.5rem; }
.project-readme-content ul, .project-readme-content ol { margin-left: 1.2rem; margin-bottom: 0.5rem; }
.project-readme-content code {
    background-color: var(--thm-bg);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
    border: 1px solid var(--thm-border);
}
.project-readme-content pre {
    background-color: var(--thm-bg);
    padding: 0.8rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 0.8rem;
    border: 1px solid var(--thm-border);
}
.project-readme-content pre code {
    background-color: transparent;
    padding: 0;
    border: none;
}
.project-readme-content a {
    color: var(--thm-blue);
    text-decoration: none;
}
.project-readme-content a:hover {
    text-decoration: underline;
}


.project-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--thm-fg);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--thm-border);
}

.project-stats i {
    margin-right: 0.4rem;
    color: var(--thm-yellow);
}
.project-stats span {
    display: inline-flex;
    align-items: center;
}

.project-card .gruv-button {
    margin-top: auto;
    align-self: flex-start;
}


/* Certificates Grid */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.certificate-card {
    background: var(--thm-bg-dark);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid var(--thm-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUpItem 0.5s ease-out forwards;
}

.certificate-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--thm-yellow);
}

.certificate-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.certificate-icon {
    color: var(--thm-yellow);
    font-size: 1.8rem;
}

.certificate-card h4 {
    font-size: 1.25rem;
    color: var(--thm-fg);
    margin: 0;
    font-weight: 600;
}

.certificate-content {
    margin-bottom: 1rem;
    flex-grow: 1;
}

.certificate-description {
    font-size: 0.95rem;
    color: var(--thm-gray);
    line-height: 1.5;
}

.certificate-footer {
    margin-top: auto;
}
.certificate-card .gruv-button {
    align-self: flex-start;
}

/* CTF Grid */
.ctf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.ctf-card {
    background: var(--thm-bg-dark);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid var(--thm-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: var(--card-shadow);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUpItem 0.5s ease-out forwards;
}

.ctf-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--thm-red);
}

.ctf-title {
    font-size: 1.3rem;
    color: var(--thm-red);
    margin-bottom: 1rem;
    font-weight: 600;
}

.ctf-badge-container {
    margin-top: 1rem;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--thm-border);
}

.ctf-badge-container iframe {
    display: block;
    border: none;
    background: transparent;
    max-width: 100%;
    width: 100% !important;
    height: 300px;
}

/* Contact Info */
.contact-info {
    padding: 1rem 0;
}
.contact-info p {
    margin: 0.8rem 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--thm-fg);
    font-size: 1.05rem;
}

.contact-info i {
    color: var(--thm-blue);
    font-size: 1.2rem;
}

.contact-info a {
    color: var(--thm-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--thm-green);
    text-decoration: underline;
}

/* CLI Container */
.cli-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(5px);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-sizing: border-box;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.cli-container:not(.hidden) {
    opacity: 1;
    transform: scale(1);
}


.cli-output {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Style for ASCII art banner */
.cli-banner {
    white-space: pre;
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.1;
    text-align: left;
    color: var(--thm-green);
}

.cli-input {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #2a2a2a;
    border-top: 1px solid var(--thm-gray);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.cli-input input {
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    flex-grow: 1;
    outline: none;
    padding: 0.5rem 0;
}


/* Hidden Class */
.hidden {
    display: none !important;
}

/* Bunny Trigger */
.bunny-trigger {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--thm-bg-dark);
    color: var(--thm-fg);
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1.5px solid var(--thm-gray);
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.bunny-trigger:hover {
    transform: scale(1.08) translateY(-3px);
    background: var(--thm-gray);
    color: var(--thm-bg);
    border-color: var(--thm-gray);
    box-shadow: 0 6px 15px rgba(160,160,160,0.4);
}

.bunny-trigger:hover .try-me {
    color: var(--thm-pink);
}

.try-me {
    color: var(--thm-fg);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

/* Scroll to Top Button */
.scroll-to-top-btn {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    background: var(--thm-green);
    color: var(--thm-bg-dark);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 255, 157, 0.3);
    z-index: 998;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

.scroll-to-top-btn.hidden {
    opacity: 0 !important;
    transform: translateY(20px) !important;
}

.scroll-to-top-btn:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}


.scroll-to-top-btn:hover {
    background: var(--thm-yellow);
    box-shadow: 0 6px 15px rgba(255, 215, 0, 0.4);
    transform: scale(1.1);
}


/* Loading Animation */
.loading {
    text-align: center;
    color: var(--thm-gray);
    padding: 2rem;
    font-size: 1.1rem;
}
.loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--thm-green);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.75rem;
    vertical-align: middle;
}

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


/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInScaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

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


/* Responsive Adjustments */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .profile-card { padding: 2rem; }
    .social-links { gap: 0.5rem; }
    .gruv-button { padding: 0.5rem 1rem; font-size: 0.85rem; }
    .filter-btn { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
    .section-header { font-size: 1.6rem; }
    .project-title, .certificate-card h4, .ctf-title { font-size: 1.2rem; }
    .projects-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
    .project-readme-content { max-height: 150px; }
}

@media (max-width: 480px) {
    .container { width: 95%; padding: 1rem 0.5rem; }
    .profile-card { padding: 1.5rem; border-radius: 8px; }
    .profile-img { width: 130px; height: 130px; }
    h1 { font-size: 1.7rem; }
    .alias { font-size: 1rem; }
    .typing-bio { font-size: 1rem; }
    .social-links { justify-content: center; }
    .gruv-button { padding: 0.5rem 0.9rem; font-size: 0.8rem; }
    .bunny-trigger { padding: 0.6rem 1rem; font-size: 0.85rem; right: 1rem; bottom: 1rem; }
    .terminal-box { margin: 1rem 0; }
    .projects-grid { grid-template-columns: 1fr; }
    .scroll-to-top-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
    .section-header { font-size: 1.4rem; }
}