:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.7);
    --card-border: rgba(48, 54, 61, 0.8);
    --primary: #58a6ff;
    --secondary: #238636;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --text-heading: #f0f6fc;
    --gradient: linear-gradient(135deg, var(--primary) 0%, #8957e5 100%);
    --nav-bg: rgba(13, 17, 23, 0.9);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Effects */
.background-grid {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -2;
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
}

.background-effects {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    animation: float 25s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%; left: -10%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(88,166,255,0.2) 0%, transparent 70%);
}

.orb-2 {
    bottom: -10%; right: -10%;
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(137,87,229,0.15) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 15%) scale(1.1); }
}

/* Typography */
h1, h2, h3, .logo {
    font-family: 'Outfit', sans-serif;
    color: var(--text-heading);
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-primary { color: var(--primary); }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.text-center { text-align: center; }

/* Navbar */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 1.5rem 0;
    background: transparent;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 1rem 0;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo .accent {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-heading);
}

.hamburger {
    display: none;
    cursor: pointer;
    color: var(--text-heading);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
}

.small-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--primary);
    color: #000 !important;
}

.btn-primary:hover {
    background: #79b8ff;
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.4);
}

.btn-secondary {
    background: var(--card-border);
    color: var(--text-heading) !important;
}

.btn-secondary:hover {
    background: #484f58;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-heading);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Common Layout */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.section-header {
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.section-header .line {
    height: 1px;
    flex-grow: 1;
    background: linear-gradient(90deg, var(--card-border), transparent);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2rem;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

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

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

.greeting {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero .title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero .subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 700px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary);
}

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

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

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card-header i {
    color: var(--primary);
}

.card-header h3 {
    font-size: 1.2rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags span {
    background: rgba(255,255,255,0.05);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

/* Projects Section */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    font-size: 0.9rem;
}

.filter-btn:hover, .filter-btn.active {
    background: rgba(255,255,255,0.1);
    color: var(--text-heading);
    border-color: var(--text-muted);
}

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

.project-card {
    display: flex;
    flex-direction: column;
}

.project-card h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.project-card p {
    flex-grow: 1;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Infrastructure Grid */
.infra-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.infra-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.infra-item:hover {
    background: rgba(88,166,255,0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.infra-item i {
    color: var(--primary);
    width: 20px; height: 20px;
}

/* QA & DevOps Dashboard */
.qa-devops-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.qa-card h3, .devops-card h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.qa-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.clean-list {
    list-style: none;
}

.clean-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.clean-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.visual-pipeline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.pipeline-node {
    background: var(--card-bg);
    border: 1px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-heading);
}

.pipeline-arrow {
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .pipeline-arrow { transform: rotate(-90deg); } /* Right arrow on desktop */
}

.devops-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.dashboard-module {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    transition: all 0.3s;
}

.dashboard-module:hover {
    border-color: var(--primary);
    background: rgba(88,166,255,0.05);
}

.dashboard-module i {
    color: var(--primary);
    width: 32px; height: 32px;
}

/* Professional Journey Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: var(--card-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-dot {
    position: absolute;
    left: -2.35rem;
    top: 1.5rem;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--primary);
}

.timeline-content h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.timeline-content p {
    font-size: 0.95rem;
}

/* Contact */
.contact-grid {
    display: flex;
    justify-content: center;
}

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

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    width: 100%;
    max-width: 300px;
    border: 1px solid var(--card-border);
    transition: all 0.3s;
}

.contact-link:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--text-muted);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    overflow: auto;
}

.modal-content {
    margin: 10% auto;
    width: 90%;
    max-width: 700px;
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

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

.close-modal {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--text-heading);
}

.modal-body {
    margin-top: 1.5rem;
    font-size: 0.95rem;
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.5, 0, 0, 1);
}

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

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--card-border);
    color: var(--text-heading);
    width: 45px; height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary);
    color: #000;
}

/* Responsive */
@media (max-width: 992px) {
    .qa-devops-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hamburger { display: block; }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--nav-bg);
        border-bottom: 1px solid var(--card-border);
        flex-direction: column;
        padding: 2rem;
        gap: 2rem;
        display: none;
    }

    .nav-links.active {
        display: flex;
    }

    .hero .title { font-size: 2.5rem; }
    .hero-actions { flex-direction: column; align-items: flex-start; }
    .btn-primary, .btn-secondary, .btn-outline { width: 100%; }
    
    .timeline::before { left: 0; }
    .timeline { padding-left: 1.5rem; }
    .timeline-dot { left: -1.85rem; }
}

/* ==========================================================================
   CASE STUDY SPECIFIC STYLES
   ========================================================================== */
.case-study-page {
    background-color: var(--bg-color);
    color: var(--text-main);
}
.case-study-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 120px 2rem 4rem;
}
.cs-header {
    text-align: center;
    margin-bottom: 4rem;
}
.cs-subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 300;
    max-width: 800px;
    margin: 1rem auto 0;
    line-height: 1.6;
}
.cs-category-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.cs-tag {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}
.cs-section {
    margin-bottom: 4rem;
}
.cs-section-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}
.cs-card {
    padding: 2rem;
    border-radius: 12px;
}
.cs-domain {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: monospace;
    background: rgba(255,255,255,0.05);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: var(--primary);
    font-size: 1.1rem;
    border: 1px solid var(--card-border);
}
.cs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cs-tags span {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.cs-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}
.cs-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}
.cs-mini-card {
    padding: 1.5rem;
    border-radius: 8px;
}
.cs-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}
.cs-list li:last-child {
    border-bottom: none;
}
.cs-list li i {
    width: 16px;
    color: var(--primary);
}
.cs-info-box {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.5rem;
}
.cs-col-span-3 {
    grid-column: 1 / -1;
}
.highlight-card {
    border: 1px solid var(--primary);
    background: linear-gradient(145deg, rgba(var(--primary-rgb),0.05) 0%, rgba(255,255,255,0.02) 100%);
}
.cs-statement {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-main);
    text-align: center;
    line-height: 1.6;
}

/* Diagrams */
.cs-diagram {
    background: #0f1115;
    border: 1px solid #1f2229;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: auto;
}
.cs-mini-diagram {
    background: rgba(0,0,0,0.3);
    border: 1px dashed var(--card-border);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.node {
    background: #1a1d24;
    border: 1px solid #2d3139;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    color: #e2e8f0;
    font-family: monospace;
    font-size: 0.95rem;
    text-align: center;
    position: relative;
    z-index: 2;
}
.node.small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}
.node.highlight {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}
.node.top-node {
    border-color: #64748b;
    font-weight: bold;
    padding: 1rem 2rem;
}
.node.api-node {
    border-color: #f59e0b;
    color: #f59e0b;
}
.node.db-node {
    border-color: #10b981;
    color: #10b981;
}
.node.abstract-node {
    background: transparent;
    border: 1px dashed #475569;
    color: #94a3b8;
}
.v-line {
    width: 2px;
    height: 30px;
    background: #334155;
    margin: 0 auto;
    color: #64748b;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
}
.v-line.tall {
    height: 80px;
}
.h-line {
    height: 2px;
    background: #334155;
}
.h-line.wide {
    width: 400px;
}
.h-line.narrow {
    width: 200px;
}
.flow-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
}
.flow-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.left-align {
    align-items: flex-start;
}
.cs-horizontal-flow {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    overflow-x: auto;
}
.flow-item {
    background: #1a1d24;
    border: 1px solid #2d3139;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.9rem;
}
.flow-item.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}
.flow-item.highlight {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: bold;
}
.flow-arrow {
    color: #64748b;
    font-weight: bold;
}

/* Timeline */
.cs-timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.cs-tl-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}
.cs-tl-num {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

@media (max-width: 768px) {
    .h-line.wide { width: 250px; }
    .h-line.narrow { width: 150px; }
    .cs-horizontal-flow { flex-direction: column; }
    .flow-arrow { transform: rotate(90deg); margin: 0.5rem 0; }
}
