/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #181b25;
    --bg-tertiary: #222633;
    --text-primary: #e2e6ef;
    --text-secondary: #8b92a8;
    --accent: #4A9EF5;
    --accent-hover: #3578d0;
    --border: #2d3244;
    --error: #e5534b;
    --success: #4A9EF5;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

h1, h2, h3, .logo {
    font-weight: 700;
    letter-spacing: -0.03em;
}

p, .subtitle, .workplace {
    font-weight: 400;
    letter-spacing: 0.01em;
}

.skill-label {
    font-weight: 500;
    letter-spacing: 0.02em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(15, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.1em;
}



.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.nav-menu a:hover {
    color: var(--accent);
}

.lang-toggle {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--accent);
    border-radius: 4px;
    font-size: 0.85rem;
}

.nav-github {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-github:hover {
    color: var(--accent);
    transform: scale(1.15);
}

.nav-github-icon {
    width: 22px;
    height: 22px;
}

.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: 0.3s;
}

/* Main Header Section */
.main-header {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
    /* Fallback color */
}

/* Background Video (not currently used) */
.header-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    object-fit: cover;
}

/* Video Overlay */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
            rgba(15, 17, 23, 0.3) 0%,
            rgba(15, 17, 23, 0.85) 100%);
    z-index: 1;
}

.header-content {
    max-width: 800px;
    position: relative;
    z-index: 2;
    /* Ensure content is above video and overlay */
}

/* Header Avatar */
.header-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: none;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.7);
    object-position: center top;
}

.main-header h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);

}

.subtitle {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.workplace {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.8);
}

.header-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 0.9rem 2rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: inline-block;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-secondary:hover {
    background-color: var(--accent);
    color: var(--bg-primary);
}

/* About Section */
.about {
    padding: 6rem 2rem;
    background-color: var(--bg-secondary);
}

.about-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.about-heading h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin: 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}


.about-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.certifications {
    margin-top: 3rem;
    padding: 2rem 0;
}

.certifications h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.cert-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}
.cert-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.cert-badge:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}
.cert-badge img {
    width: 20px;
    height: 20px;
}

/* Technical Stack Section */
.technical-stack {
    padding: 6rem 2rem;
    background-color: var(--bg-primary);
}

.technical-stack h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin: 0 auto;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 1.5rem;
    border-radius: 8px;
    background-color: transparent;
    border: none;
    transition: all 0.3s;
}

.skill-item:hover {
    transform: translateY(-8px);
}

.skill-icon {
    width: 60px;
    height: 60px;
}

.skill-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

/* Projects Section */
.projects {
    padding: 6rem 2rem;
    background-color: var(--bg-secondary);
}

.projects h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.project-card {
    background-color: transparent;
    border-radius: 8px;
    overflow: hidden;
    border: none;
    transition: all 0.3s;
    aspect-ratio: 1 / 1.18;
}

.project-card:hover {
    transform: translateY(-8px);
}

.project-placeholder {
    height: 200px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.project-info {
    flex: 1;
    padding: 1.5rem;
    overflow: hidden;
    min-height: 0;
}

.project-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.project-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.tag:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.tag img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Contact Section */
.contact {
    padding: 6rem 2rem;
    background-color: var(--bg-primary);
    background-image: url('../Images/MyOffice1.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

.contact::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 23, 0.8);
}

.contact .container {
    position: relative;
    z-index: 1;
}

.contact h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.contact-info p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

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

.linkedin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding: 0.65rem 1.25rem;
    background-color: #0a66c2;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.linkedin-badge:hover {
    background-color: #004182;
    transform: translateY(-2px);
}

.linkedin-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.contact-form {
    background-color: var(--bg-secondary);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.9rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
}

.form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
}

.form-status.success {
    display: block;
    background-color: rgba(74, 158, 245, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.form-status.error {
    display: block;
    background-color: rgba(229, 83, 75, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

/* Footer */
.footer {
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
}

/* Certificate Modal */
.cert-item {
    cursor: pointer;
    transition: all 0.3s;
}

.cert-item:hover {
    color: var(--accent);
    transform: translateX(5px);
}

.hyperlink {
    transition: all 0.3s;
}

.hyperlink:hover {
    transform: translateX(5px);
}

.hyperlink a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.hyperlink a:hover {
    color: var(--accent);
}

.cert-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 2rem;
    border: 1px solid var(--accent);
    animation: slideUp 0.3s;
    z-index: 2001;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
}

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

.cert-images-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.cert-images-container img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    border-radius: 4px;
}

.cert-images-container.multi img {
    max-width: calc(50% - 0.75rem);
    max-height: 60vh;
}

.cert-modal-title {
    text-align: center;
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: 500;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== PROJECT CARDS (v2) ===== */
.project-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.project-cover {
    flex: 0 0 45%;
    background-color: transparent;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    position: relative;
}

.project-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(15, 17, 23, 0.4) 100%);
}

.project-lang {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ===== PROJECT MODAL ===== */
.project-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.project-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1rem;
    overflow-y: auto;
}

.project-modal .modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(5px);
}

.project-modal-content {
    position: relative;
    max-width: 1400px;
    width: 100%;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--accent);
    z-index: 2001;
    overflow: hidden;
    overflow-x: hidden;
    animation: slideUp 0.3s;
}

.project-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(15, 17, 23, 0.8);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
    transition: all 0.2s;
    padding: 0;
}

.project-modal-close:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.case-hero--ai-economics {
    background-position: center 20% !important;
}

/* Case study layout */
.case-hero {
    height: 240px;
    background-size: cover;
    background-position: center;
    background-color: white;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.case-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 17, 23, 0.3) 0%, rgba(24, 27, 37, 0.95) 100%);
}

.case-hero-title {
    position: absolute;
    bottom: 1.5rem;
    left: 2.5rem;
    right: 2.5rem;
    z-index: 2;
}

.case-hero-title .lang-label {
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
}

.case-hero-title h2 {
    font-size: 1.8rem;
    text-align: left;
    margin: 0;
    color: var(--text-primary);
}

.case-body {
    padding: 2.5rem;
}

.case-section {
    margin-bottom: 2.5rem;
}

.case-section:last-child {
    margin-bottom: 0;
}

.case-section h3 {
    color: var(--accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.case-section p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.case-section p:last-child {
    margin-bottom: 0;
}

.case-section strong {
    color: var(--text-primary);
    font-weight: 500;
}

.case-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.case-tech .tag {
    background-color: var(--bg-tertiary);
    border-color: var(--border);
    color: var(--text-secondary);
}

.case-plot {
    margin: 1.5rem 0;
    background-color: white;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
}

.case-plot iframe {
    width: 100%;
    max-width: 100%;
}

.case-plot img {
    width: 100%;
    height: auto;
    display: block;
}

.case-plot-caption {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.8rem !important;
    font-style: italic;
    padding-left: 1rem;
    border-left: 2px solid var(--accent);
}

.case-callout {
    background-color: var(--bg-tertiary);
    border-left: 3px solid var(--accent);
    padding: 1.5rem;
    border-radius: 0 6px 6px 0;
    margin: 1.5rem 0;
}

.case-callout h4 {
    color: var(--text-primary);
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
}

.case-callout p {
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.case-callout code,
.case-section code {
    background-color: var(--bg-primary);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
    color: var(--accent);
    font-family: 'Courier New', monospace;
}

.case-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.case-metric {
    background-color: var(--bg-tertiary);
    padding: 1.2rem 1rem;
    border-radius: 6px;
    text-align: center;
    border: 1px solid var(--border);
}

.case-metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 0.2rem;
}

.case-metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.case-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
    .case-body {
        padding: 1.5rem;
    }

    .case-hero-title {
        left: 1.5rem;
        right: 1.5rem;
    }

    .case-hero-title h2 {
        font-size: 1.4rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-secondary);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .main-header h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .header-cta {
        flex-direction: column;
        align-items: center;
    }

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

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .certifications ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-header h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 2rem;
    }

    .container {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 1rem;
    }

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

.network-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}

.case-map {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin: 1.5rem 0;
}

.case-map iframe {
    display: block;
    width: 100%;
    height: 500px;
}

@media (max-width: 768px) {
    .project-modal.active {
        padding: 0;
        align-items: flex-end;
    }

    .project-modal-content {
        max-width: 100%;
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 92vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .case-hero {
        height: 160px;
    }

    .case-hero-title h2 {
        font-size: 1.1rem;
    }

    .case-body {
        padding: 1.2rem;
        overflow-x: hidden;
    }

    .case-section code {
        white-space: pre-wrap;
        word-break: break-word;
    }

    .case-metrics {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .case-metric-value {
        font-size: 1.3rem;
    }

    .case-metric-label {
        font-size: 0.7rem;
    }

    .case-map iframe {
        height: 300px;
    }

    .case-plot {
        padding: 0.5rem;
        overflow: hidden;
    }

    .case-plot iframe {
        height: 280px !important;
        max-height: 50vh;
    }

    .case-plot--duo {
        grid-template-columns: 1fr;
    }

    .case-callout code {
        white-space: pre-wrap;
        word-break: break-word;
        font-size: 0.75rem;
    }

    .dash-quartiles {
        grid-template-columns: 1fr;
    }

    .funnel-row {
        grid-template-columns: 80px 1fr 60px 40px;
        gap: 0.4rem;
    }

    .funnel-label {
        font-size: 0.75rem;
    }

    .case-actions {
        flex-direction: column;
    }

    .case-actions .btn {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .case-hero-title h2 {
        font-size: 1rem;
    }

    .case-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }

    .case-map iframe {
        height: 250px;
    }

    .case-plot iframe {
        height: 220px !important;
        max-height: 40vh;
    }

    .funnel-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .funnel-label {
        text-align: left;
        font-size: 0.8rem;
    }

    .dash-kpi-value {
        font-size: 1.2rem;
    }
}

/* ===== SALES OPS DASHBOARD ===== */

/* Featured project card */

.project-cover--dashboard {
    background: var(--bg-primary);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    gap: 0.5rem;
    min-height: 200px;
}

.dashboard-preview {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    width: 100%;
    height: 120px;
}

.dp-bar {
    flex: 1;
    background: var(--accent);
    opacity: 0.7;
    border-radius: 3px 3px 0 0;
    transition: opacity 0.3s;
}

.project-card--featured:hover .dp-bar {
    opacity: 1;
}

/* KPI Cards in dashboard */
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.dash-kpi {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.2rem 1rem;
    text-align: center;
    transition: border-color 0.2s;
}

.dash-kpi:hover {
    border-color: var(--accent);
}

.dash-kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 0.2rem;
    font-variant-numeric: tabular-nums;
}

.dash-kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Chart containers */
.dash-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.dash-chart-full {
    margin: 1.5rem 0;
}

.dash-chart-wrap {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.2rem;
}

.dash-chart-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 600;
}

.dash-chart-wrap canvas {
    max-height: 220px;
}

.dash-chart-full .dash-chart-wrap canvas {
    max-height: 200px;
}

/* Loading state */
.dash-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.dash-loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 1rem auto 0;
    animation: spin 0.8s linear infinite;
}

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

/* Insight callout */
.dash-insight {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.5rem;
    border-radius: 0 6px 6px 0;
    margin: 1rem 0;
}

.dash-insight p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.dash-insight strong {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .project-card--featured {
        grid-template-columns: 1fr;
    }

    .project-cover--dashboard {
        min-height: 120px;
    }

    .dash-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .dash-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

#chart-funnel {
    padding: 1rem 0;
    width: 100%;
}

.funnel-row {
    display: grid;
    grid-template-columns: 110px 1fr 80px 50px;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.funnel-label {
    color: #e2e6ef;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: right;
}

.funnel-bar-wrap {
    background: #181b25;
    border-radius: 3px;
    height: 36px;
    display: flex;
    align-items: center;
}

.funnel-bar {
    height: 100%;
    border-radius: 3px;
    display: flex;
    align-items: center;
    padding-left: 0.75rem;
    transition: width 0.3s ease;
    min-width: 60px;
}

.funnel-count {
    color: #e2e6ef;
    font-size: 0.8rem;
    white-space: nowrap;
}

.funnel-value {
    color: #8b92a8;
    font-size: 0.82rem;
    text-align: right;
}

.funnel-pct {
    color: #8b92a8;
    font-size: 0.82rem;
    text-align: right;
}

.dash-quartiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quartile-box {
    background: #151821;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #2d3244;
}

.quartile-top {
    border-left: 3px solid #4A9EF5;
}

.quartile-bottom {
    border-left: 3px solid #e5534b;
}

.quartile-header {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #8b92a8;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #2d3244;
}

.quartile-top .quartile-header {
    color: #4A9EF5;
}

.quartile-bottom .quartile-header {
    color: #e5534b;
}

.quartile-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #181b25;
}

.quartile-rep {
    color: #e2e6ef;
    font-size: 0.85rem;
    font-weight: 500;
    grid-column: 1;
    grid-row: 1;
}

.quartile-manager {
    color: #555d75;
    font-size: 0.75rem;
    grid-column: 1;
    grid-row: 2;
}

.quartile-metric {
    color: #8b92a8;
    font-size: 0.85rem;
    font-weight: 600;
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
}

.code-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.45rem 1rem;
    background-color: var(--bg-tertiary);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.case-plot--duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: none;
    padding: 0;
    border: none;
}

.case-plot--duo img {
    width: 100%;
    border-radius: 8px;
}